heyujie
2021-06-22 9963acdd7115d804508909d5c893b619aa8ce73e
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) {