diff --git a/src/jmapNew/shape/Section/index.js b/src/jmapNew/shape/Section/index.js index a3c93df42..84e977518 100644 --- a/src/jmapNew/shape/Section/index.js +++ b/src/jmapNew/shape/Section/index.js @@ -874,4 +874,12 @@ export default class Section extends Group { return super.getBoundingRect(); } } + + drawSelected(selected) { + if (selected) { + this.section.setStyle({stroke: '#CFF'}); + } else { + this.section.setStyle({stroke: this.style.Section.line.spareColor}); + } + } } diff --git a/src/views/newMap/newMapdraft/index.vue b/src/views/newMap/newMapdraft/index.vue index 10e6faf08..46b2db22e 100644 --- a/src/views/newMap/newMapdraft/index.vue +++ b/src/views/newMap/newMapdraft/index.vue @@ -76,6 +76,7 @@ export default { viewDraft: 'draft', autoSaveTask: null, selected: null, + oldSelected: null, mapInfo: { name: this.$t('map.pleaseSelectMap') }, timeDemon: null }; @@ -158,9 +159,9 @@ export default { this.autoSaveTask = null; } }, - handleSelectControlPage (model) { + handleSelectControlPage (model, oldModel) { if (this.$refs.mapOperate) { - this.$refs.mapOperate.handleSelectControlPage(model); + this.$refs.mapOperate.handleSelectControlPage(model, oldModel); this.$store.dispatch('menuOperation/setMapDrawSelectCount'); } }, @@ -185,8 +186,11 @@ export default { return device; }, onSelect(device) { + if (this.selected) { + this.oldSelected = this.selected; + } this.selected = device || null; - this.selected && this.handleSelectControlPage(device); + this.selected && this.handleSelectControlPage(device, this.oldSelected); }, onContextmenu(em) { this.point = { diff --git a/src/views/newMap/newMapdraft/mapoperate/index.vue b/src/views/newMap/newMapdraft/mapoperate/index.vue index 34c234b4c..9931cbd36 100644 --- a/src/views/newMap/newMapdraft/mapoperate/index.vue +++ b/src/views/newMap/newMapdraft/mapoperate/index.vue @@ -278,7 +278,8 @@ export default { }); }); }, - handleSelectControlPage(device) { + handleSelectControlPage(device, oldDevice) { + console.log(device, type, this.feild, device, oldDevice); const type = device._type; if (this.stationType) { this.enabledTab = 'Station'; @@ -290,6 +291,12 @@ export default { this.enabledTab = 'Section'; } else { this.enabledTab = type; + if (type === 'Section' && device ) { + device.instance.drawSelected(true); + } + if ( oldDevice && oldDevice._type === 'Section') { + oldDevice.instance.drawSelected(false); + } } }, stationEnabledTab(type) {