Selaa lähdekoodia

修改传感器

JX.LI 2 vuotta sitten
vanhempi
commit
8d10abc83a
1 muutettua tiedostoa jossa 8 lisäystä ja 8 poistoa
  1. 8 8
      src/views/monitor.vue

+ 8 - 8
src/views/monitor.vue

@@ -431,7 +431,7 @@ export default {
       let markersList = [];
       getSensorListByDeptId(that.deptId).then(function (res) {
         that.visuForestCloudCameraBOListSearch = []
-        that.sensorNum = res.data.length
+        // that.sensorNum = res.data.length
         if (res.data != null && res.data.length > 0) {
           for (let j = 0; j < res.data.length; j++) {
             let dat = {
@@ -452,19 +452,19 @@ export default {
               keepBindPopup: false,
               isAggregation: false,
             };
-            if (res.data[i].deviceCode == '001') {  // 水质传感器
+            if (res.data[i].deviceType == 1) {  // 水质传感器
               markersMap.icon = "sj-icon-map-centerdata_water_quality_sensor";
-            } else if (res.data[i].deviceCode == '002') {  // 水尺
+            } else if (res.data[i].deviceType == '002') {  // 水尺
               markersMap.icon = "sj-icon-map-centerdata_water_gauge";
-            } else if (res.data[i].deviceCode == '003') {  // 水文监测设备
+            } else if (res.data[i].deviceType == '003') {  // 水文监测设备
               markersMap.icon = "sj-icon-map-centerdata_hydrological_monitoring_equipment";
-            } else if (res.data[i].deviceCode == '004') {  // 土壤监测设备
+            } else if (res.data[i].deviceType == 2) {  // 土壤监测设备
               markersMap.icon = "sj-icon-map-centerdata_soil_monitoring_equipment";
-            } else if (res.data[i].deviceCode == '005') {  // 病虫害监测站
+            } else if (res.data[i].deviceType == 4) {  // 病虫害监测站
               markersMap.icon = "sj-icon-map-centerdata_pest_and_disease_monitoring_station";
-            } else if (res.data[i].deviceCode == '006') {  // 大气传感器
+            } else if (res.data[i].deviceType == 5) {  // 大气传感器
               markersMap.icon = "sj-icon-map-centerdata_atmospheric_sensor";
-            } else if (res.data[i].deviceCode == '007') {  // 水压传感器
+            } else if (res.data[i].deviceType == 6) {  // 水压传感器
               markersMap.icon = "sj-icon-map-centerdata_water_pressure_sensor";
             }