Quellcode durchsuchen

monitor 列表查询bug

qinhouyu vor 2 Jahren
Ursprung
Commit
f1f237a751
1 geänderte Dateien mit 21 neuen und 4 gelöschten Zeilen
  1. 21 4
      src/views/monitor.vue

+ 21 - 4
src/views/monitor.vue

@@ -230,6 +230,7 @@
           deviceName: "摄像头"
         }],
         visuForestCloudCameraBOList: [],
+        tempList: [],
         cameraMarkersList: [],
         sourceData: [],
         keyAreaList: [], //重点区域
@@ -264,10 +265,20 @@
         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]);
+            }
           }
         }
       }
@@ -451,6 +462,7 @@
         getDlblistBydeptId(deptId).then(function(res) {
             that.loudspeakerNum = res.data.length
             that.visuForestCloudCameraBOListSearch = []
+            that.tempList = []
             if (res.data != null && res.data.length > 0) {
               for (let j = 0; j < res.data.length; j++) {
                 let dat = {
@@ -459,6 +471,7 @@
                   latitude: res.data[j].latitude,
                 }
                 that.visuForestCloudCameraBOListSearch.push(dat)
+                that.tempList = that.visuForestCloudCameraBOListSearch
               }
               for (let i = 0; i < res.data.length; i++) {
                 let markersMap = {
@@ -555,6 +568,7 @@
         let markersList = [];
         getMonitorDeviceAndDataList(deptId).then((res) => {
           this.visuForestCloudCameraBOListSearch = []
+          this.tempList = []
           list = res.data
           //this.sensorNum = list.length
           list.forEach(item => {
@@ -564,6 +578,7 @@
               latitude: item.latitude,
             }
             this.visuForestCloudCameraBOListSearch.push(dat)
+            this.tempList = this.visuForestCloudCameraBOListSearch;
             let markersMap = {
               lng: 124.59,
               lat: 43.02,
@@ -1258,7 +1273,9 @@
         let that = this
         selectDeviceType().then(res => {
           that.cameraMarkersList = []
+          that.tempList = []
           that.visuForestCloudMapDeviceBOList = res.data.visuForestCloudMapDeviceBOList
+          that.tempList = res.data.visuForestCloudMapDeviceBOList
 
           that.region = res.data.visuForestCloudTodaySjfbBOList