瀏覽代碼

修改传感器

JX.LI 2 年之前
父節點
當前提交
69df849f76
共有 1 個文件被更改,包括 16 次插入16 次删除
  1. 16 16
      src/views/monitor.vue

+ 16 - 16
src/views/monitor.vue

@@ -440,7 +440,7 @@
         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 = {
@@ -461,21 +461,21 @@
                   keepBindPopup: false,
                   isAggregation: false,
                 };
-                if (res.data[i].deviceCode == '001') { // 水质传感器
-                  markersMap.icon = "sj-icon-map-centerdata_water_quality_sensor";
-                } else if (res.data[i].deviceCode == '002') { // 水尺
-                  markersMap.icon = "sj-icon-map-centerdata_water_gauge";
-                } else if (res.data[i].deviceCode == '003') { // 水文监测设备
-                  markersMap.icon = "sj-icon-map-centerdata_hydrological_monitoring_equipment";
-                } else if (res.data[i].deviceCode == '004') { // 土壤监测设备
-                  markersMap.icon = "sj-icon-map-centerdata_soil_monitoring_equipment";
-                } else if (res.data[i].deviceCode == '005') { // 病虫害监测站
-                  markersMap.icon = "sj-icon-map-centerdata_pest_and_disease_monitoring_station";
-                } else if (res.data[i].deviceCode == '006') { // 大气传感器
-                  markersMap.icon = "sj-icon-map-centerdata_atmospheric_sensor";
-                } else if (res.data[i].deviceCode == '007') { // 水压传感器
-                  markersMap.icon = "sj-icon-map-centerdata_water_pressure_sensor";
-                }
+            if (res.data[i].deviceType == 1) {  // 水质传感器
+              markersMap.icon = "sj-icon-map-centerdata_water_quality_sensor";
+            } else if (res.data[i].deviceType == '002') {  // 水尺
+              markersMap.icon = "sj-icon-map-centerdata_water_gauge";
+            } else if (res.data[i].deviceType == '003') {  // 水文监测设备
+              markersMap.icon = "sj-icon-map-centerdata_hydrological_monitoring_equipment";
+            } else if (res.data[i].deviceType == 2) {  // 土壤监测设备
+              markersMap.icon = "sj-icon-map-centerdata_soil_monitoring_equipment";
+            } else if (res.data[i].deviceType == 4) {  // 病虫害监测站
+              markersMap.icon = "sj-icon-map-centerdata_pest_and_disease_monitoring_station";
+            } else if (res.data[i].deviceType == 5) {  // 大气传感器
+              markersMap.icon = "sj-icon-map-centerdata_atmospheric_sensor";
+            } else if (res.data[i].deviceType == 6) {  // 水压传感器
+              markersMap.icon = "sj-icon-map-centerdata_water_pressure_sensor";
+            }
 
                 markersMap.lng = res.data[i].longitude;
                 markersMap.lat = res.data[i].latitude;