diff --git a/src/views/newMap/newMapdraft/mapoperate/index.vue b/src/views/newMap/newMapdraft/mapoperate/index.vue index b4201c5c2..fb18ef92e 100644 --- a/src/views/newMap/newMapdraft/mapoperate/index.vue +++ b/src/views/newMap/newMapdraft/mapoperate/index.vue @@ -261,7 +261,8 @@ export default { mapEditShow: false, mapPaintShow: true }, - oldDevice: null + oldDevice: null, + isSwitchSection: false }; }, computed: { @@ -319,10 +320,26 @@ export default { this.enabledTab = 'Section'; } else { this.enabledTab = type; - if ( this.oldDevice && this.oldDevice.instance && typeof this.oldDevice.instance.drawSelected === 'function') { + if (this.oldDevice && this.oldDevice.instance && typeof this.oldDevice.instance.drawSelected === 'function') { + if (this.isSwitchSection) { + if (this.oldDevice._type == 'Section' && this.oldDevice.type == '04') { + this.oldDevice.relevanceSectionList.forEach(item => { + const sectionModel = this.$store.getters['map/getDeviceByCode'](item); + sectionModel.instance.drawSelected(false); + }); + this.isSwitchSection = false; + } + } this.oldDevice.instance.drawSelected(false); } - if ( device && device.instance && typeof device.instance.drawSelected === 'function' ) { + if (device && device.instance && typeof device.instance.drawSelected === 'function' ) { + if (device._type == 'Section' && device.type == '04') { + this.isSwitchSection = true; + device.relevanceSectionList.forEach(item => { + const sectionModel = this.$store.getters['map/getDeviceByCode'](item); + sectionModel.instance.drawSelected(true); + }); + } device.instance.drawSelected(true); } this.oldDevice = device;