From c3152a35ed1cd9364f92d183a9cb0aba620f5650 Mon Sep 17 00:00:00 2001
From: ZZJ <10913410+zzj2100@user.noreply.gitee.com>
Date: 星期一, 06 六月 2022 17:21:29 +0800
Subject: [PATCH] 处理场景数量异常的情况

---
 src/views/search/components/LeftNav.vue               |    2 +-
 src/Pool/VideoRuleData.ts                             |   22 ++++++++++++++++++----
 src/views/hashrate/CameraManage/CameraRules/index.vue |    6 +-----
 3 files changed, 20 insertions(+), 10 deletions(-)

diff --git a/src/Pool/VideoRuleData.ts b/src/Pool/VideoRuleData.ts
index eb15d61..13c433c 100644
--- a/src/Pool/VideoRuleData.ts
+++ b/src/Pool/VideoRuleData.ts
@@ -1,7 +1,8 @@
 import { getCameraInfo } from "@/api/camera";
 import { getAllPolygon } from "@/api/polygon";
 import { getDirDetails, findAllFileByStackId } from "@/api/localVedio";
-import { getCameraSceneRule } from '@/api/scene'
+import { getCameraSceneRule,getLinkSceneRule } from '@/api/scene'
+
 
 export default class VideoRuleData {
   public selectTask: Array<object>;
@@ -24,6 +25,7 @@
   public resolutionOption: Array<any>;
   public selectResolution: string;
   public hasCtrlC: boolean;
+  public allSceneRule:Array<any>;
 
   constructor(id: string) {
     this.loading = false;
@@ -34,6 +36,7 @@
     this.type = 0;
     this.selectTask = [];
     this.polygonData = [];
+    this.allSceneRule = []
     this.canvasData = {
       line: [],
       arrow: [],
@@ -73,8 +76,8 @@
   public async update() {
     await this.getInfo();
     await this.getSceneRule();
-    
     await this.getPolygon();
+    await this.getLinkRule()
   }
 
   public async getInfo() {
@@ -157,7 +160,18 @@
       this.dealWay = rsp.data.cameraInfo.run_type === 1 ? true : false
       this.runServerName = rsp.data.cameraInfo.runServerName
     }
-  
-    
+  }
+
+  public async getLinkRule() {
+    const rsp: any = await getLinkSceneRule({ cameraIds: [this.cameraId] });
+    if (rsp && rsp.success) {
+     let rules = rsp.data.rules;
+      // 缁熶竴瑙勫垯缂栬緫鐨勬暟鎹粨鏋�
+      for (let i = 0; i < rules.length; i++) {
+        rules[i].group_rules = rules[i].rules;
+      }
+      rules = rsp.data.rules;
+      this.allSceneRule = this.rules.concat(rules)
+    }
   }
 }
diff --git a/src/views/hashrate/CameraManage/CameraRules/index.vue b/src/views/hashrate/CameraManage/CameraRules/index.vue
index 6c3c454..5a8aea3 100644
--- a/src/views/hashrate/CameraManage/CameraRules/index.vue
+++ b/src/views/hashrate/CameraManage/CameraRules/index.vue
@@ -6,7 +6,7 @@
           <!-- 鍦烘櫙鍙婅鍒� -->
           <div class="left-top-left">
             <div class="title">鍦烘櫙</div>
-            <slide-scene :sceneData="Camera.rules"></slide-scene>
+            <slide-scene :sceneData="Camera.allSceneRule"></slide-scene>
           </div>
 
           <!-- 绠楀姏淇℃伅杩涘害鏉� -->
@@ -593,10 +593,6 @@
             }
 
             this.linkageRule = rules;
-
-            console.log(this.linkageRule);
-
-            this.$set(this.Camera, "rules", this.Camera.rules.concat(rules));
 
             this.$nextTick(() => {
               this.connectLine2();
diff --git a/src/views/search/components/LeftNav.vue b/src/views/search/components/LeftNav.vue
index 9907514..f98977d 100644
--- a/src/views/search/components/LeftNav.vue
+++ b/src/views/search/components/LeftNav.vue
@@ -777,7 +777,7 @@
     }
     // padding: 24px 0px;
     // padding-top: 24px;
-    padding-bottom: 12px;
+    // padding-bottom: 12px;
     input:nth-child(1) {
       height: 34px;
       box-shadow: 0 2px 11px -6px rgba(95, 95, 95, 0.5);

--
Gitblit v1.8.0