根据设备code高亮 地图对应的设备

This commit is contained in:
joylink_cuiweidong 2019-12-19 15:52:36 +08:00
parent 30fc3132d3
commit 882bb44fb2
3 changed files with 30 additions and 25 deletions

View File

@ -320,31 +320,35 @@ export default {
this.enabledTab = 'Section'; this.enabledTab = 'Section';
} else { } else {
this.enabledTab = type; this.enabledTab = type;
if (this.oldDevice && this.oldDevice.instance && typeof this.oldDevice.instance.drawSelected === 'function') { this.deviceHighLight(device);
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._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;
} }
}, },
//
deviceHighLight(device) {
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._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;
},
esqTab(type) { esqTab(type) {
this.esqType = type; this.esqType = type;
}, },
@ -383,6 +387,9 @@ export default {
}, },
setCenter(code) { setCenter(code) {
this.$emit('setCenter', code); this.$emit('setCenter', code);
//
const model = this.$store.getters['map/getDeviceByCode'](code);
this.deviceHighLight(model);
} }
} }
}; };

View File

@ -192,7 +192,6 @@ export default {
deviceChange(code) { deviceChange(code) {
this.$emit('setCenter', code); this.$emit('setCenter', code);
this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code)); this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code));
this.edit();
}, },
hover(field) { hover(field) {
this.field = field === this.field ? '' : field; this.field = field === this.field ? '' : field;

View File

@ -253,7 +253,6 @@ export default {
deviceChange(code) { deviceChange(code) {
this.$emit('setCenter', code); this.$emit('setCenter', code);
this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code)); this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code));
this.edit();
}, },
hover(field) { hover(field) {
this.field = field === this.field ? '' : field; this.field = field === this.field ? '' : field;