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); });