qinhouyu 1 year ago
parent
commit
e9397068d1
2 changed files with 79 additions and 65 deletions
  1. 69 62
      src/views/eventdetailsdialog.vue
  2. 10 3
      src/views/firespread.vue

+ 69 - 62
src/views/eventdetailsdialog.vue

@@ -3665,37 +3665,40 @@ export default {
           that.centermonitorTCamera = null;
           that.centermonitorTCamera = res.data.centermonitorTCamera;
           that.cameraCode = res.data.centermonitorTCamera.id;
-          let markersMap = {
-            lng: 124.59,
-            lat: 43.02,
-            icon: "camera",
-            bindPopupHtml: "",
-            click: "preview",
-            parameter: {
-              code: res.data.centermonitorTCamera.cameraCode,
-              type: res.data.centermonitorTCamera.cameraFactory,
-              name: res.data.centermonitorTCamera.cameraName,
-            },
-            keepBindPopup: false,
-            isAggregation: true,
-            radius: 0,
-          };
-          markersMap.bindPopupHtml =
-            '<div class="map-tip">' +
-            "<span>" +
-            '                  <div class="d-l-con">' +
-            '                  <div class="d-l-l-text">' +
-            "                  <h4>摄像头名称:" +
-            res.data.centermonitorTCamera.cameraName +
-            "</h4>" +
-            "                </div>" +
-            "                </div>" +
-            "                </span>" +
-            "<span>" +
-            "</div>";
-          markersMap.lng = res.data.centermonitorTCamera.longitude;
-          markersMap.lat = res.data.centermonitorTCamera.latitude;
-          markersMapList.push(markersMap);
+          if(res.data.centermonitorTCamera.longitude != null && res.data.centermonitorTCamera.latitude != null) {
+
+            let markersMap = {
+              lng: 124.59,
+              lat: 43.02,
+              icon: "camera",
+              bindPopupHtml: "",
+              click: "preview",
+              parameter: {
+                code: res.data.centermonitorTCamera.cameraCode,
+                type: res.data.centermonitorTCamera.cameraFactory,
+                name: res.data.centermonitorTCamera.cameraName,
+              },
+              keepBindPopup: false,
+              isAggregation: true,
+              radius: 0,
+            };
+            markersMap.bindPopupHtml =
+              '<div class="map-tip">' +
+              "<span>" +
+              '                  <div class="d-l-con">' +
+              '                  <div class="d-l-l-text">' +
+              "                  <h4>摄像头名称:" +
+              res.data.centermonitorTCamera.cameraName +
+              "</h4>" +
+              "                </div>" +
+              "                </div>" +
+              "                </span>" +
+              "<span>" +
+              "</div>";
+            markersMap.lng = res.data.centermonitorTCamera.longitude;
+            markersMap.lat = res.data.centermonitorTCamera.latitude;
+            markersMapList.push(markersMap);
+          }
         }
         setTimeout(() => {
           that.$refs.supermapDialog.dynamicPlotting(); //弹出动态绘制窗口,防止截图位置改变
@@ -3788,38 +3791,42 @@ export default {
         if (res.data.centermonitorTCamera != null) {
           that.centermonitorTCamera = null;
           that.centermonitorTCamera = res.data.centermonitorTCamera;
-          let markersMap = {
-            lng: 124.59,
-            lat: 43.02,
-            icon: "camera",
-            bindPopupHtml: "",
-            click: "preview",
-            parameter: {
-              code: res.data.centermonitorTCamera.cameraCode,
-              type: res.data.centermonitorTCamera.cameraFactory,
-              name: res.data.centermonitorTCamera.cameraName,
-            },
-            keepBindPopup: false,
-            isAggregation: true,
-            radius: 0,
-          };
-          markersMap.bindPopupHtml =
-            '<div class="map-tip">' +
-            "<span>" +
-            '                  <div class="d-l-con">' +
-            '                  <div class="d-l-l-text">' +
-            "                  <h4>摄像头名称:" +
-            res.data.centermonitorTCamera.cameraName +
-            "</h4>" +
-            "                </div>" +
-            "                </div>" +
-            "                </span>" +
-            "<span>" +
-            "</div>";
-          markersMap.lng = res.data.centermonitorTCamera.longitude;
-          markersMap.lat = res.data.centermonitorTCamera.latitude;
+          that.cameraCode = res.data.centermonitorTCamera.id;
+          if(res.data.centermonitorTCamera.longitude != null && res.data.centermonitorTCamera.latitude != null) {
+
+            let markersMap = {
+              lng: 124.59,
+              lat: 43.02,
+              icon: "camera",
+              bindPopupHtml: "",
+              click: "preview",
+              parameter: {
+                code: res.data.centermonitorTCamera.cameraCode,
+                type: res.data.centermonitorTCamera.cameraFactory,
+                name: res.data.centermonitorTCamera.cameraName,
+              },
+              keepBindPopup: false,
+              isAggregation: true,
+              radius: 0,
+            };
+            markersMap.bindPopupHtml =
+              '<div class="map-tip">' +
+              "<span>" +
+              '                  <div class="d-l-con">' +
+              '                  <div class="d-l-l-text">' +
+              "                  <h4>摄像头名称:" +
+              res.data.centermonitorTCamera.cameraName +
+              "</h4>" +
+              "                </div>" +
+              "                </div>" +
+              "                </span>" +
+              "<span>" +
+              "</div>";
+            markersMap.lng = res.data.centermonitorTCamera.longitude;
+            markersMap.lat = res.data.centermonitorTCamera.latitude;
 
-          markersMapList.push(markersMap);
+            markersMapList.push(markersMap);
+          }
         }
         setTimeout(() => {
           that.$refs.supermapDialog.clearM(false);

+ 10 - 3
src/views/firespread.vue

@@ -3313,6 +3313,8 @@ export default {
           that.centermonitorTCamera = null;
           that.centermonitorTCamera = res.data.centermonitorTCamera;
           that.cameraCode = res.data.centermonitorTCamera.id;
+          if(res.data.centermonitorTCamera.longitude != null && res.data.centermonitorTCamera.latitude != null) {
+
           let markersMap = {
             lng: 124.59,
             lat: 43.02,
@@ -3348,7 +3350,7 @@ export default {
           markersMap.lng = res.data.centermonitorTCamera.longitude
           markersMap.lat = res.data.centermonitorTCamera.latitude
           markersMapList.push(markersMap)
-        }
+        }}
         setTimeout(() => {
           that.$refs.supermapDialog1.dropLocation10(
             res.data.catalogue.latitude,
@@ -3419,7 +3421,12 @@ export default {
 
         markersMapList.push(markersMap)
         if (res.data.centermonitorTCamera != null) {
-          let markersMap = {
+          that.centermonitorTCamera = null;
+          that.centermonitorTCamera = res.data.centermonitorTCamera;
+          that.cameraCode = res.data.centermonitorTCamera.id;
+          if(res.data.centermonitorTCamera.longitude != null && res.data.centermonitorTCamera.latitude != null) {
+
+            let markersMap = {
             lng: 124.59,
             lat: 43.02,
             icon: 'camera',
@@ -3448,7 +3455,7 @@ export default {
           markersMap.lat = res.data.centermonitorTCamera.latitude
 
           markersMapList.push(markersMap)
-        }
+        }}
         setTimeout(() => {
           that.$refs.supermapDialog1.dropLocation10(
             res.data.catalogue.latitude,