From ccee429d379e0108b7445f72ade8d97c110a6fb3 Mon Sep 17 00:00:00 2001
From: ZZJ <zzjdsg2300@163.com>
Date: 星期二, 09 十一月 2021 18:01:59 +0800
Subject: [PATCH] 问题修复

---
 src/pages/panoramicView/components/History.vue |   22 +++++++++++++---------
 1 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/src/pages/panoramicView/components/History.vue b/src/pages/panoramicView/components/History.vue
index c7e179b..418701f 100644
--- a/src/pages/panoramicView/components/History.vue
+++ b/src/pages/panoramicView/components/History.vue
@@ -25,7 +25,7 @@
           class="list-item"
           v-for="item in personList"
           :key="item.id"
-          :style="selectedID == item.id ? 'border-color:#3D68E1': ''"
+          :style="searching ? '' : item.selected ? 'border-color:#3D68E1': 'opacity: 0.3;'"
           @click="checkTarget(item)"
         >
           <!-- <img src alt :style="{backgroundColor:item.color}"/> -->
@@ -33,7 +33,7 @@
           <el-image
             style="width: 70px; height: 70px;border-radius: 50%;"
             :src="item.humanImg"
-            fit="cover"
+            fit="contain"
           ></el-image>
         </div>
       </div>
@@ -74,11 +74,12 @@
   name: "histroy",
   computed: {
     videos() {
-      if (this.selectedID == "") {
+      if (this.searching) {
         return this.videoList
       }
 
-      return this.videoList.filter(v => v.id == this.selectedID);
+      // return this.videoList.filter(v => v.id == this.selectedID);
+      return this.videoList.filter(v => v.selected);
     }
   },
   data() {
@@ -115,7 +116,7 @@
           }
         }]
       },
-      selectedID: "",
+      search: "",
       personList: [],
       videoList: [
         // {
@@ -125,6 +126,9 @@
         // }
       ]
     }
+  },
+  mounted() {
+    this.searchData();
   },
   methods: {
     checkTime() {
@@ -137,15 +141,15 @@
       }
 
       this.searchData();
-
     },
     checkTarget(item) {
-      this.selectedID = item.id;
+      this.searching = false;
+      this.$set(item, 'selected', item.selected != undefined ? !item.selected : true);
     },
     searchData() {
-      this.selectedID = "";
-
       findTraceResult({ searchTime: this.searchTime }).then(rsp => {
+        this.searching = true;
+
         this.videoList = this.personList = [];
 
         if (rsp && rsp.success && rsp.data) {

--
Gitblit v1.8.0