ソースを参照

fix: 主控台修正

sunhongyao341504 2 年 前
コミット
435c15d7ce

+ 1 - 1
.env.development

@@ -14,7 +14,7 @@ VITE_DROP_CONSOLE = true
 #VITE_PROXY = [["/appApi","http://localhost:8001"],["/upload","http://localhost:8001/upload"]]
 # VITE_PROXY=[["/temp","http://172.16.23.144:8800"],["/upload","http://172.16.23.144:8086"]]
 # VITE_PROXY=[["/skyeye-admin-api","http://172.16.23.144:8800/api"]]
-VITE_PROXY=[["/skyeye-admin-api","http://192.168.1.102:8800/api"]]
+VITE_PROXY=[["/skyeye-admin-api","http://192.168.1.102:8800/api"],["/push_stream_host","http://192.168.1.100:8080"]]
 
 # API 接口地址
 VITE_GLOB_API_URL = 

+ 11 - 10
src/views/dashboard/home/components/CameraInfo.vue

@@ -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 {

+ 8 - 4
src/views/dashboard/home/types/index.ts

@@ -21,10 +21,14 @@ export const timeTypeList = [
 ];
 
 export enum ViolationHandleStat {
-  UNTREAT = 'untreat',
-  TREATED = 'treated',
-  OVERTIME = 'overtime',
-  LONGTIME = 'longtime',
+  // UNTREAT = 'untreat',
+  // TREATED = 'treated',
+  // OVERTIME = 'overtime',
+  // LONGTIME = 'longtime',
+  UNTREAT = '1',
+  TREATED = '2',
+  OVERTIME = '3',
+  LONGTIME = '4',
 }
 
 export const violationHandleCounts = [

+ 2 - 2
src/views/system/role/CreateUserDrawer.vue

@@ -210,9 +210,9 @@
 
   function clickNode(tree, nodeInfo, _, __) {
     console.log('tree', tree);
-    console.log('nodeInfo', nodeInfo.isShop);
+    console.log('nodeInfo', nodeInfo.data.isShop);
 
-    if (nodeInfo.isShop) {
+    if (nodeInfo.data.isShop) {
       selectedNodeKey.value = tree.code;
     } else {
       selectedNodeKey.value = '';