This commit is contained in:
zyy 2019-12-04 11:32:06 +08:00
commit 1f73a54c32
3 changed files with 23 additions and 4 deletions

View File

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

View File

@ -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 = {

View File

@ -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) {