From 41d4f207aa2a34908ee82b33b5f05c3b82be969d Mon Sep 17 00:00:00 2001
From: heyujie <516346543@qq.com>
Date: 星期三, 23 六月 2021 11:41:17 +0800
Subject: [PATCH] 解决删除label全部消失的问题

---
 src/pages/shuohuangMonitorAnalyze/components/videoAnalyze.vue |   45 +++++++++++++++++++++++----------------------
 1 files changed, 23 insertions(+), 22 deletions(-)

diff --git a/src/pages/shuohuangMonitorAnalyze/components/videoAnalyze.vue b/src/pages/shuohuangMonitorAnalyze/components/videoAnalyze.vue
index 331b1f6..70c1652 100644
--- a/src/pages/shuohuangMonitorAnalyze/components/videoAnalyze.vue
+++ b/src/pages/shuohuangMonitorAnalyze/components/videoAnalyze.vue
@@ -52,10 +52,10 @@
           <div class="v-name-block">
             <div
               class="video-name"
-              :class="{ current: curVideo.ID == video.ID }"
+              :class="{ current: curVideo.id == video.id }"
               @click="checkVideo(video, index)"
               v-for="(video, index) in curRoomVideos"
-              :key="video.ID"
+              :key="video.id"
             >
               <i class="el-icon-film"></i>
               <span>{{ video.VideoDate }}</span>
@@ -396,7 +396,7 @@
     this.renderLabelOpts();
     this.setGuid(1);
     this.getCurVideos(this.videoDetails);
-    // this.getRelatedVideos(this.videoDetails);
+    this.getRelatedVideos(this.videoDetails);
   },
   destroyed() {
     this.videoArrs.length = 0;
@@ -569,14 +569,7 @@
         CarNumber: v.CarNumber,
         Driver1: v.Driver1,
       }).then((res) => {
-        // 濉厖鍗曠獥鍙g殑涓嬫媺鑿滃崟
-        res.data.forEach((item) => {
-          _this.popDownArr.push(item);
-        });
-        // if (_this.popDownArr.length) {
-        //   _this.curCamera = _this.popDownArr[0].CameraPosition;
-        // }
-
+ 
         res.data.forEach((item) => {
           item.marks = _this.mergeMarks(item);
         });
@@ -616,15 +609,15 @@
     getRelatedVideos(video) {
       let _this = this;
       getRelatedVideoInfo({ GroupID: video.GroupID }).then((res) => {
-        let arr = [];
-        let map = {};
         res.data.forEach((item) => {
           _this.popDownArr.push(item);
         });
+        // _this.popDownArr = res.data
         if (_this.popDownArr.length) {
           _this.curCamera = _this.popDownArr[0].CameraPosition;
         }
       });
+      _this.popDownArr
     },
     renderLabelOpts() {
       let _this = this;
@@ -633,13 +626,22 @@
       });
     },
     refreshCurVideoLabel(video) {
+      let _this = this;
+      _this.popDownArr = []
       getRelatedVideoInfo({ GroupID: video.GroupID }).then((res) => {
-        res.data.forEach((d) => {
-          if (d.ID === video.ID) {
-            video.LableLst = d.LableLst;
+        res.data.forEach((item) => {
+          _this.popDownArr.push(item);
+          if (item.ID === video.ID) {
+            video.LableLst = item.LableLst;
           }
         });
+        // res.data.forEach((d) => {
+        //   if (item.ID === video.ID) {
+        //     video.LableLst = item.LableLst;
+        //   }
+        // });
       });
+      _this.popDownArr
     },
     checkVideo(video, index) {
       this.refreshCurVideoLabel(video);
@@ -738,11 +740,10 @@
     },
     removeCurLabel(mark) {
       let _this = this;
+      debugger
       let obj = {
-        Desc: mark.Desc,
-        ParentUniqID: mark.ParentUniqID,
-        Time: mark.Time,
-        ParentID: mark.ParentID
+        ID: mark.ID,
+        VideoIds: mark.VideoIds
       };
       delLabel(obj).then((rsp) => {
         if (rsp && rsp.success) {
@@ -905,7 +906,7 @@
               height: 8px;
               width: 6px;
               z-index: 1;
-              background-color: lightcoral;
+              background-color:yellowgreen ;
               cursor: pointer;
               -webkit-transform: translateX(-50%);
               transform: translateX(-50%);
@@ -915,7 +916,7 @@
               height: 8px;
               width: 6px;
               z-index: 1;
-              background-color: yellowgreen;
+              background-color: lightcoral;
               cursor: pointer;
               -webkit-transform: translateX(-50%);
               transform: translateX(-50%);

--
Gitblit v1.8.0