Browse Source

石家庄 地图落点(真实)去重复代码

wangzhe 8 months ago
parent
commit
b0fc27d771
1 changed files with 41 additions and 24 deletions
  1. 41 24
      screen-demo/src/views/templateInstance.vue

+ 41 - 24
screen-demo/src/views/templateInstance.vue

@@ -194,23 +194,23 @@ export default {
     this.btnMethod(0)
     this.echarts3q()
     this.echarts4q()
-    // 获取摄像头点位列表信息
-    this.$requestSDK(
-      "/jilin-devloper/jilin/querySiteCodeAndDevices",
-      {},
-      {},
-      "post"
-    ).then((res) => {
-      this.markPoints = res.data;
-      // 添加打点
-      if (this.map) {
-        if (this.mapType === "3D" || this.mapType === "2D") {
-          this.addPoint3D(this.map);
-        } else {
-          this.addPoint(this.map.map);
-        }
-      }
-    });
+    // // 获取摄像头点位列表信息
+    // this.$requestSDK(
+    //   "/jilin-devloper/jilin/querySiteCodeAndDevices",
+    //   {},
+    //   {},
+    //   "post"
+    // ).then((res) => {
+    //   this.markPoints = res.data;
+    //   // 添加打点
+    //   if (this.map) {
+    //     if (this.mapType === "3D" || this.mapType === "2D") {
+    //       this.addPoint3D(this.map);
+    //     } else {
+    //       this.addPoint(this.map.map);
+    //     }
+    //   }
+    // });
     // 最新视频弹窗监听方式
     // this.$postMsgUtil.listen('videoListen', (data) => {
     //   // 对应业务逻辑处理
@@ -1845,15 +1845,32 @@ export default {
       this.map = e;
       this.targetId = targetId;
       this.mapInstance = e?.map || e;
-      // 添加打点
-      if (this.markPoints.length) {
+      // 获取摄像头点位列表信息
+      this.$requestSDK(
+        "/jilin-devloper/jilin/querySiteCodeAndDevices",
+        {},
+        {},
+        "post"
+      ).then((res) => {
+        this.markPoints = res.data;
         // 添加打点
-        if (this.mapType === "3D" || this.mapType === "2D") {
-          this.addPoint3D(e);
-        } else { // 当前地图mapType satellite
-          this.addPoint(this.map.map);
+        if (this.map) {
+          if (this.mapType === "3D" || this.mapType === "2D") {
+            this.addPoint3D(this.map);
+          } else {
+            this.addPoint(this.map.map);
+          }
         }
-      }
+      });
+      // 添加打点
+      // if (this.markPoints.length) {
+      //   // 添加打点
+      //   if (this.mapType === "3D" || this.mapType === "2D") {
+      //     this.addPoint3D(e);
+      //   } else { // 当前地图mapType satellite
+      //     this.addPoint(this.map.map);
+      //   }
+      // }
       this.$nextTick(() => {
         this.show = true;
       });