diff --git a/src/store/index.js b/src/store/index.js index ca7077e..7dac9e0 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -26,6 +26,7 @@ const store = new Vuex.Store({ logList: [], // 操作日志列表 messageList: [], // 管理员公告列表 mapStyleList: [], // 地图样式列表 + mapIsStyleReady: false, // 地图样式是否加载完成 在全局入口判断设置 子页面调用地图组件时直接判断该值 crosFrequency: null, // 对频macadd ADSBList: [] // 存放当前活跃的 ADSB 飞机数据 }, @@ -154,6 +155,13 @@ const store = new Vuex.Store({ setMapStyleList (state, list) { state.mapStyleList = list }, + /** + * @description: 确认地图源地址 加载完成 + * @param {bool} status 是否完成 + */ + setMapIsStyleReady (state, status) { + state.mapIsStyleReady = status + }, /** * @description: 清除过期的 ADSB 数据 */ @@ -1201,6 +1209,7 @@ const store = new Vuex.Store({ } }) commit('setMapStyleList', list) + commit('setMapIsStyleReady', true) } else { commit('setMapStyleList', []) Message.error(res.data.msg || '地图样式获取失败') diff --git a/src/views/layout/components/main/home/index.vue b/src/views/layout/components/main/home/index.vue index 2b7535d..3d9101f 100644 --- a/src/views/layout/components/main/home/index.vue +++ b/src/views/layout/components/main/home/index.vue @@ -1,6 +1,6 @@