This commit is contained in:
fan 2020-07-03 11:28:44 +08:00
commit b98f811998
2 changed files with 18 additions and 24 deletions

View File

@ -146,6 +146,7 @@ export default {
});
},
doClose() {
this.row = null;
this.loading = false;
this.dialogShow = false;
this.restoreBeforeDevices();
@ -156,7 +157,9 @@ export default {
//
if (this.beforeSectionList && this.beforeSectionList.length) {
this.beforeSectionList.forEach(elem => {
elem.cutOff = false;
const section = deepAssign({}, this.$store.getters['map/getDeviceByCode'](elem.code)); //
section.cutOff = false;
elem = Object.assign(elem, section);
});
}

View File

@ -238,11 +238,7 @@ export default {
};
},
PhysicalSectionList() {
let list = [];
if (this.sectionList && this.sectionList.length) {
list = this.sectionList.filter(elem => { return elem.type === '01' && !elem.switchSection; });
}
return list;
return this.sectionList.filter(elem => { return elem.type === '01' && !elem.switchSection; });
},
isPointsShow() {
@ -269,7 +265,6 @@ export default {
this.$refs.dataform && this.$refs.dataform.resetFields();
this.activeName = 'first';
this.editModel = deepAssign(this.editModel, selected);
console.log(this.editModel.nameFont, selected, '=========');
//
const beCentralizedStation = {};
this.relStationList = JSON.parse(JSON.stringify(this.stationList));
@ -377,22 +372,18 @@ export default {
createControlMode: item.control
};
const model = Object.assign(stationModel, data);
this.sectionList.forEach(elem => {
if (elem.code === item.sectionCode) {
const l = 0;
const r = elem.points.length - 1;
model.position = {
x: elem.points[l].x + (elem.points[r].x - elem.points[l].x) / 2,
y: elem.points[l].y - this.addModel.positionY
};
if (item.control) {
model.controlModePoint = {
x: elem.points[l].x + (elem.points[r].x - elem.points[l].x) / 2,
y: elem.points[l].y - this.addModel.positionY + 30
};
}
}
});
const sectionModel = this.$store.getters['map/getDeviceByCode'](item.sectionCode);
const last = sectionModel.points.length - 1;
model.position = {
x: sectionModel.points[0].x + (sectionModel.points[last].x - sectionModel.points[0].x) / 2,
y: sectionModel.points[0].y - this.addModel.positionY
};
if (item.control) {
model.controlModePoint = {
x: sectionModel.points[0].x + (sectionModel.points[last].x - sectionModel.points[0].x) / 2,
y: sectionModel.points[0].y - this.addModel.positionY + 30
};
}
models.push(model);
});
this.$emit('updateMapModel', models);
@ -417,7 +408,7 @@ export default {
//
deleteObj() {
const selected = this.$store.getters['map/getDeviceByCode'](this.editModel.code);
if (selected && selected._type.toUpperCase() === 'Station'.toUpperCase()) {
if (selected && selected._type == 'Station') {
this.$confirm(this.$t('tip.confirmDeletion'), this.$t('tip.hint'), {
confirmButtonText: this.$t('tip.confirm'),
cancelButtonText: this.$t('tip.cancel'),