修改代码

This commit is contained in:
zyy 2019-12-13 18:50:01 +08:00
parent a6e8f1376f
commit de30f91aed
2 changed files with 9 additions and 0 deletions

View File

@ -144,7 +144,9 @@ class Jlmap {
setCenter(deviceCode) {
const device = this.mapDevice[deviceCode];
if (device && device.instance) {
console.log(device);
var rect = createBoundingRect(device.instance);
console.log(rect);
var dcenter = calculateDCenter(rect, { width: this.$zr.getWidth(), height: this.$zr.getHeight() });
this.setOptions(dcenter);
}

View File

@ -86,6 +86,7 @@ export default {
deviceSelect(selected) {
if (selected && selected._type.toUpperCase() == 'CheckBox'.toUpperCase()) {
this.clearModelList();
let count = 0;
this.seclectDeviceList.forEach(item => {
if (item._type == 'Section') {
this.modelList[0].list.push(item);
@ -94,7 +95,13 @@ export default {
} else if (item._type == 'Signal') {
this.modelList[2].list.push(item);
}
if (item.stationCode == this.seclectDeviceList[0].stationCode) {
count++;
}
});
if (count == this.seclectDeviceList.length) {
this.stationCode = this.seclectDeviceList[0].stationCode;
}
}
},
clearModelList() {