Prechádzať zdrojové kódy

monitor 列表查询bug

qinhouyu 1 rok pred
rodič
commit
b5c290dfc2
1 zmenil súbory, kde vykonal 17 pridanie a 6 odobranie
  1. 17 6
      src/views/monitor.vue

+ 17 - 6
src/views/monitor.vue

@@ -326,6 +326,7 @@ export default {
       region: [],
       rightDeptName: undefined,
       visuForestCloudCameraBOListSearch: [],
+      tempList: [],
       //左右缩进
       indentStyle: "",
       indentleft: "",
@@ -350,12 +351,20 @@ export default {
       this.$refs.tree.filter(val);
     },
     rightDeptName(val) {
-      this.visuForestCloudCameraBOListSearch = [];
-      for (let i in this.visuForestCloudCameraBOList) {
-        if (this.visuForestCloudCameraBOList[i].cameraName.indexOf(val) != -1) {
-          this.visuForestCloudCameraBOListSearch.push(
-            this.visuForestCloudCameraBOList[i]
-          );
+      if(['chuan','la'].includes(this.localMark)){
+        this.visuForestCloudCameraBOListSearch = [];
+        for (let i in this.tempList) {
+          if (this.tempList[i].cameraName.indexOf(val) != -1) {
+            this.visuForestCloudCameraBOListSearch.push(this.tempList[i]);
+          }
+        }
+      }
+      else{
+        this.visuForestCloudCameraBOListSearch = [];
+        for (let i in this.visuForestCloudCameraBOList) {
+          if (this.visuForestCloudCameraBOList[i].cameraName.indexOf(val) != -1) {
+            this.visuForestCloudCameraBOListSearch.push(this.visuForestCloudCameraBOList[i]);
+          }
         }
       }
     },
@@ -396,6 +405,7 @@ export default {
       let markersList = [];
       getMonitorDeviceAndDataList(deptId).then((res) => {
         this.visuForestCloudCameraBOListSearch = [];
+        this.tempList = []
         list = res.data;
         //this.sensorNum = list.length
         list.forEach((item) => {
@@ -405,6 +415,7 @@ export default {
             latitude: item.latitude,
           };
           this.visuForestCloudCameraBOListSearch.push(dat);
+          this.tempList = this.visuForestCloudCameraBOListSearch;
           let markersMap = {
             lng: 124.59,
             lat: 43.02,