|
|
@@ -9,11 +9,11 @@
|
|
|
:props="treeProp"
|
|
|
node-key="code"
|
|
|
:default-expand-all="true"
|
|
|
- @current-change="onCurrentChange"
|
|
|
+ @node-click="handleNodeClick"
|
|
|
/>
|
|
|
</div>
|
|
|
<div class="video-block">
|
|
|
- <LiveVideo :url="`http://10.94.4.184:8090/live/JJ-GH-test0.flv`" />
|
|
|
+ <LiveVideo :url="streamIp" />
|
|
|
</div>
|
|
|
<div class="flex" style="width: 100%">
|
|
|
<span class="algo-text">相关算法:</span>
|
|
|
@@ -27,10 +27,12 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
- import { nextTick, ref } from 'vue';
|
|
|
+ import { ref } from 'vue';
|
|
|
import LiveVideo from '@/components/LiveVideo/LiveVideo.vue';
|
|
|
import { CompanyInfoItem, AlgoConfig } from '@/api/home/home.ts';
|
|
|
|
|
|
+ const streamIp = ref('');
|
|
|
+
|
|
|
const props = defineProps<{
|
|
|
data: CompanyInfoItem[];
|
|
|
getAlgoes: (cameraId: number) => Promise<AlgoConfig[]>;
|
|
|
@@ -44,13 +46,11 @@
|
|
|
const selectedCamera = ref('');
|
|
|
const algoList = ref<AlgoConfig[]>([]);
|
|
|
|
|
|
- const onCurrentChange = (_, node) => {
|
|
|
- nextTick(() => {
|
|
|
- if (node?.data && node.data.code === selectedCamera.value) {
|
|
|
- props.getAlgoes(node.data.id).then((res) => {
|
|
|
- algoList.value = res;
|
|
|
- });
|
|
|
- }
|
|
|
+ const handleNodeClick = (node) => {
|
|
|
+ console.log(node);
|
|
|
+ streamIp.value = node.pushstreamIp;
|
|
|
+ props.getAlgoes(node.id).then((res) => {
|
|
|
+ algoList.value = res;
|
|
|
});
|
|
|
};
|
|
|
</script>
|
|
|
@@ -79,6 +79,7 @@
|
|
|
margin-top: 16px;
|
|
|
margin-bottom: 28px;
|
|
|
aspect-ratio: 1920/1080;
|
|
|
+ border: 1px solid #e8e8e8;
|
|
|
}
|
|
|
|
|
|
.algo-text {
|