From 0157f32fc08ca47e114422a34c33752aba6d7312 Mon Sep 17 00:00:00 2001 From: ival <610568032@qq.com> Date: Wed, 31 Jul 2019 09:13:37 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=8A=A0=E8=BD=BD=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/store/modules/map.js | 4 ++-- src/views/jlmap/index.vue | 6 +++++- src/views/map/mapdraft/mapedit/index.vue | 4 ++++ 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/store/modules/map.js b/src/store/modules/map.js index 7090320df..4e45c828c 100644 --- a/src/store/modules/map.js +++ b/src/store/modules/map.js @@ -185,7 +185,7 @@ const map = { namespaced: true, state: { - map: {}, // 地图数据 + map: null, // 地图数据 mapList: {}, // 地图数据列表 mapViewLoadedCount: 0, // 地图视图加载完成标识 mapDataLoadedCount: 0, // 地图数据加载完成标识 @@ -445,7 +445,7 @@ const map = { } }, mapClear: (state) => { - state.map = {}; + state.map = null; Vue.prototype.$jlmap && Vue.prototype.$jlmap.clear(); } }, diff --git a/src/views/jlmap/index.vue b/src/views/jlmap/index.vue index 239b62db4..5d1125312 100644 --- a/src/views/jlmap/index.vue +++ b/src/views/jlmap/index.vue @@ -71,7 +71,11 @@ export default { watch: { '$store.state.map.map': function (val, old) { try { - this.setMap(val); + if (val) { + this.setMap(val); + } else { + this.mapViewLoaded(false); + } } catch (error) { console.log('[ERROR] ', error); this.mapViewLoaded(false); diff --git a/src/views/map/mapdraft/mapedit/index.vue b/src/views/map/mapdraft/mapedit/index.vue index 62d548081..640307a91 100644 --- a/src/views/map/mapdraft/mapedit/index.vue +++ b/src/views/map/mapdraft/mapedit/index.vue @@ -148,6 +148,10 @@ export default { if (!isSuccess) { this.$store.dispatch('map/mapClear'); } + + this.$nextTick(() => { + eventBus.$emit('viewLoading', false); + }) }, loadInitPage() { this.$store.dispatch('training/changeMode', { mode: TrainingMode.MAP_EDIT });