浏览代码

修改总览左侧菜单点击后地图聚焦标记位置

画安 3 周之前
父节点
当前提交
39693658af
共有 1 个文件被更改,包括 7 次插入0 次删除
  1. 7 0
      src/views/StatusMonitoring.vue

+ 7 - 0
src/views/StatusMonitoring.vue

@@ -283,6 +283,13 @@ export default {
 
             // 根据Tab来显示不同的弹窗内容
             if (this.activeLeftTab === 'overview') { // 总览
+                // 临时逻辑,有真实接口后可以删除
+                const index = Math.floor(Math.random() * 10);
+                const position = localStorage.getItem(`pos${index + 1}`).split(',');
+
+                // 地图联动
+                this.$refs.trafficMapRef.focusByLocation([Number(position[0]), Number(position[1])]);
+                
                 this.showOverviewDalogs(nodeData);
             } else if (this.activeLeftTab === 'crossing') { // 路口
                 this.showCrossingDalogs(nodeData);