Browse Source

水压传感器数据null判断

wang_xy 1 năm trước cách đây
mục cha
commit
055344757d
1 tập tin đã thay đổi với 45 bổ sung78 xóa
  1. 45 78
      src/views/monitor.vue

+ 45 - 78
src/views/monitor.vue

@@ -645,12 +645,12 @@ export default {
     //     });
     //     });
     // },
     // },
 
 
-    getMonitorDeviceAndDataList() {
+    getMonitorDeviceAndDataList(deptId) {
       let list = [];
       let list = [];
       let markersList = [];
       let markersList = [];
       this.visuForestCloudCameraBOListSearch = [];
       this.visuForestCloudCameraBOListSearch = [];
       this.visuForestCloudCameraBOList=[]
       this.visuForestCloudCameraBOList=[]
-      getMonitorDeviceAndDataList(this.deptId).then((res) => {
+      getMonitorDeviceAndDataList(deptId).then((res) => {
         this.visuForestCloudCameraBOListSearch = [];
         this.visuForestCloudCameraBOListSearch = [];
         list = res.data;
         list = res.data;
         //this.sensorNum = list.length
         //this.sensorNum = list.length
@@ -887,82 +887,49 @@ export default {
           } else if (item.deviceType == 6) {
           } else if (item.deviceType == 6) {
             // 水压传感器
             // 水压传感器
             markersMap.icon = "sj-icon-map-centerdata_water_pressure_sensor";
             markersMap.icon = "sj-icon-map-centerdata_water_pressure_sensor";
-            markersMap.bindPopupHtml +=
-              '<div class="map-tip">' +
-              "<span>" +
-              '                  <div class="d-l-con">' +
-              '                  <div class="d-l-l-text">' +
-              "                  <h4>类型:水压传感器" +
-              "</h4>" +
-              "                </div>" +
-              "                </div>" +
-              "                </span>" +
-              '<div class="map-tip">' +
-              "<span>" +
-              '                  <div class="d-l-con">' +
-              '                  <div class="d-l-l-text">' +
-              "                  <h4>下限警报使能:" +
-              (item.data.thresholdLowEnable ?
-                item.data.thresholdLowEnable + "MPa" :
-                "0MPa") +
-              "</h4>" +
-              "                </div>" +
-              "                </div>" +
-              "                </span>" +
-              "<span>" +
-              '                  <div class="d-l-con">' +
-              '                  <div class="d-l-l-text">' +
-              "                  <h4>上限警报使能:" +
-              (item.data.thresholdHighEnable ?
-                item.data.thresholdHighEnable + "MPa" :
-                "0MPa") +
-              "</h4>" +
-              "                </div>" +
-              "                </div>" +
-              "                </span>" +
-              // "<span>" +
-              // '                  <div class="d-l-con">' +
-              // '                  <div class="d-l-l-text">' +
-              // "                  <h4>信号强度:" +
-              // (item.data.signalPower ? item.data.signalPower : "") +
-              // "</h4>" +
-              // "                </div>" +
-              // "                </div>" +
-              // "                </span>" +
-              "<span>" +
-              '                  <div class="d-l-con">' +
-              '                  <div class="d-l-l-text">' +
-              "                  <h4 style='color:"+(2.0>=item.data.hydraulicValue>=0.5?'green':'red')+"'"+">水压力值:" +
-              (item.data.hydraulicValue ?
-                item.data.hydraulicValue + "MPa" :
-                "0MPa") +'   | 0.5MPa - 2.0MPa'
-              "</h4>" +
-              "                </div>" +
-              "                </div>" +
-              "                </span>" +
-              // "<span>" +
-              // '                  <div class="d-l-con">' +
-              // '                  <div class="d-l-l-text">' +
-              // "                  <h4>水压下限阈值:" +
-              // (item.data.hydraulicThresholdMin ?
-              //   item.data.hydraulicThresholdMin + "MPa" :
-              //   "0MPa") + '| 0.5MPa'
-              // "</h4>" +
-              // "                </div>" +
-              // "                </div>" +
-              // "                </span>" +
-              // "<span>" +
-              // '                  <div class="d-l-con">' +
-              // '                  <div class="d-l-l-text">' +
-              // "                  <h4>水压上限阈值:" +
-              // (item.data.hydraulicThresholdMax ?
-              //   item.data.hydraulicThresholdMax + "MPa" :
-              //   "0MPa") + '| 2.0MPa'
-              // "</h4>" +
-              // "                </div>" +
-              // "                </div>" +
-              // "                </span>" +
-              "</div>";
+            if(item.data != null){
+              markersMap.bindPopupHtml +=
+                '<div class="map-tip">' +
+                "<span>" +
+                '                  <div class="d-l-con">' +
+                '                  <div class="d-l-l-text">' +
+                "                  <h4>类型:水压传感器" +
+                "</h4>" +
+                "                </div>" +
+                "                </div>" +
+                "                </span>" +
+                '<div class="map-tip">' +
+                "<span>" +
+                '                  <div class="d-l-con">' +
+                '                  <div class="d-l-l-text">' +
+                "                  <h4>下限警报使能:" +
+                (item.data.thresholdLowEnable ? item.data.thresholdLowEnable + "MPa" : "0MPa") +
+                "</h4>" +
+                "                </div>" +
+                "                </div>" +
+                "                </span>" +
+                "<span>" +
+                '                  <div class="d-l-con">' +
+                '                  <div class="d-l-l-text">' +
+                "                  <h4>上限警报使能:" +
+                (item.data.thresholdHighEnable ?
+                  item.data.thresholdHighEnable + "MPa" :
+                  "0MPa") +
+                "</h4>" +
+                "                </div>" +
+                "                </div>" +
+                "                </span>" +
+                "<span>" +
+                '                  <div class="d-l-con">' +
+                '                  <div class="d-l-l-text">' +
+                "                  <h4 style='color:"+(2.0>=item.data.hydraulicValue>=0.5?'green':'red')+"'"+">水压力值:" +
+                (item.data.hydraulicValue ? item.data.hydraulicValue + "MPa" : "0MPa") +'   | 0.5MPa - 2.0MPa' +
+                "</h4>" +
+                "                </div>" +
+                "                </div>" +
+                "                </span>" +
+                "</div>";
+            }
           } else if (item.deviceType == 7) {
           } else if (item.deviceType == 7) {
             //水流速传感器
             //水流速传感器
             markersMap.icon = "sj-icon-map-centerdata_water_flow_rate";
             markersMap.icon = "sj-icon-map-centerdata_water_flow_rate";