修改删除绑定逻辑

This commit is contained in:
zyy 2019-12-10 15:06:29 +08:00
parent 18ebc91da2
commit 1ecc091f41
2 changed files with 11 additions and 9 deletions

View File

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

View File

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