From 1ecc091f4168e6e964f8da580885d86cf7904077 Mon Sep 17 00:00:00 2001 From: zyy <1787816799@qq.com> Date: Tue, 10 Dec 2019 15:06:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=88=A0=E9=99=A4=E7=BB=91?= =?UTF-8?q?=E5=AE=9A=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.vue | 2 +- src/store/modules/map.js | 18 ++++++++++-------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/App.vue b/src/App.vue index 717a5dcdf..eec2dddea 100644 --- a/src/App.vue +++ b/src/App.vue @@ -75,7 +75,7 @@ export default { }; }, subscribeMessage(res) { - if (this.$refs.deomonTopic) { + if (this.$refs.deomonTopic && !window.location.href.includes('trainroom')) { this.$refs.deomonTopic.doShow(res); this.$store.dispatch('socket/setRoomInvite'); } diff --git a/src/store/modules/map.js b/src/store/modules/map.js index 779f135c2..0ea93037e 100644 --- a/src/store/modules/map.js +++ b/src/store/modules/map.js @@ -49,13 +49,16 @@ function queryDeleteModels(state, device, dict) { if (!dict[elem.code] || !dict[elem.code]._dispose) { const copyModel = deepAssign({}, elem); if (copyModel.parentCode) { - const setionModel = deepAssign({}, dict[copyModel.parentCode] || state.mapDevice[copyModel.parentCode]); - setionModel.relevanceSectionList.forEach((sectionCode, index) => { - if (sectionCode == copyModel.code) { - setionModel.relevanceSectionList.splice(index, 1); - dict[setionModel.code] = setionModel; - } - }); + const model = dict[copyModel.parentCode] || state.mapDevice[copyModel.parentCode] || {}; + if (model.code) { + const setionModel = deepAssign({}, model); + setionModel.relevanceSectionList.forEach((sectionCode, index) => { + if (sectionCode == copyModel.code) { + setionModel.relevanceSectionList.splice(index, 1); + dict[setionModel.code] = setionModel; + } + }); + } } copyModel.relSwitchCode = ''; copyModel.isSwitchSection = false; @@ -650,7 +653,6 @@ const map = { const list = Object.values(dict); handleOperation(state, list); - commit('mapRender', list); resolve(list); });