Browse Source

学校设备位置优化

gzb
wangzhonglu 9 months ago
parent
commit
77504ab040
1 changed files with 14 additions and 7 deletions
  1. 14
    7
      src/views/schoolSection/deviceManage/deviceManage.vue

+ 14
- 7
src/views/schoolSection/deviceManage/deviceManage.vue View File

484
                 }"
484
                 }"
485
                 :show="baiduMapInfo.markerInfo.show"
485
                 :show="baiduMapInfo.markerInfo.show"
486
                 @close="closeBmInfoWindow()"
486
                 @close="closeBmInfoWindow()"
487
+                @open="openBmInfoWindow()"
487
               >
488
               >
488
-                <div>地址: {{ baiduMapInfo.markerInfo.address }}</div>
489
+                <div v-if="baiduMapInfo.markerInfo.address">
490
+                  地址: {{ baiduMapInfo.markerInfo.address }}
491
+                </div>
489
                 <div>经度:{{ baiduMapInfo.markerInfo.lng }}</div>
492
                 <div>经度:{{ baiduMapInfo.markerInfo.lng }}</div>
490
                 <div>维度:{{ baiduMapInfo.markerInfo.lat }}</div>
493
                 <div>维度:{{ baiduMapInfo.markerInfo.lat }}</div>
491
               </bm-info-window>
494
               </bm-info-window>
1111
               lng: this.baiduMapInfo.positions[0].lng,
1114
               lng: this.baiduMapInfo.positions[0].lng,
1112
               lat: this.baiduMapInfo.positions[0].lat
1115
               lat: this.baiduMapInfo.positions[0].lat
1113
             };
1116
             };
1114
-            this.baiduMapInfo.markerInfo = {
1115
-              show: false,
1116
-              address: "",
1117
-              lng: this.baiduMapInfo.center.lng,
1118
-              lat: this.baiduMapInfo.center.lat
1119
-            };
1120
           } else {
1117
           } else {
1121
             this.baiduMapInfo.center = "郑州市";
1118
             this.baiduMapInfo.center = "郑州市";
1122
           }
1119
           }
1149
               lng: item.lng,
1146
               lng: item.lng,
1150
               lat: item.lat
1147
               lat: item.lat
1151
             };
1148
             };
1149
+          } else {
1150
+            this.baiduMapInfo.markerInfo = {
1151
+              show: true,
1152
+              address: "",
1153
+              lng: item.lng,
1154
+              lat: item.lat
1155
+            };
1152
           }
1156
           }
1153
         });
1157
         });
1154
       }
1158
       }
1155
     },
1159
     },
1160
+    openBmInfoWindow() {
1161
+      this.baiduMapInfo.markerInfo.show = true;
1162
+    },
1156
     closeBmInfoWindow() {
1163
     closeBmInfoWindow() {
1157
       this.baiduMapInfo.markerInfo.show = false;
1164
       this.baiduMapInfo.markerInfo.show = false;
1158
     },
1165
     },

Loading…
Cancel
Save