From 9963acdd7115d804508909d5c893b619aa8ce73e Mon Sep 17 00:00:00 2001
From: heyujie <516346543@qq.com>
Date: 星期二, 22 六月 2021 20:41:51 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.5.5:10010/r/vue-smart-ai

---
 src/pages/panoramicView/components/History.vue |   20 ++++++++++++--------
 1 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/src/pages/panoramicView/components/History.vue b/src/pages/panoramicView/components/History.vue
index c7e179b..4b9656c 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="item.selected ? 'border-color:#3D68E1': ''"
           @click="checkTarget(item)"
         >
           <!-- <img src alt :style="{backgroundColor:item.color}"/> -->
@@ -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