地图绘图代码调整

This commit is contained in:
joylink_cuiweidong 2020-08-11 14:17:00 +08:00
parent be112d3b96
commit c82edc8516
3 changed files with 41 additions and 26 deletions

View File

@ -72,7 +72,7 @@ export default {
break;
}
case 'StationStand': case 'TrainWindow': {
this.$emit('updateMapModel', selected);
this.$emit('updateMapModel', selected, true);
break;
}
default : {

View File

@ -400,20 +400,28 @@ export default {
});
return beCentralizedStation[stationCode] || '';
},
updateMapModel(selected) {
const models = [];
models.push(deepAssign(selected, { _dispose: true }));
this.espList.forEach(item => {
if (item.standCode == selected.code) {
models.push(deepAssign(item, { _dispose: true }));
}
});
this.psdList.forEach(item => {
if (item.standCode == selected.code) {
models.push(deepAssign(item, { _dispose: true }));
}
});
this.$emit('updateMapModel', models);
updateMapModel(selected, isSpecialTreat) {
//
if (isSpecialTreat) {
//
const models = [];
models.push(deepAssign(selected, { _dispose: true }));
this.espList.forEach(item => {
if (item.standCode == selected.code) {
models.push(deepAssign(item, { _dispose: true }));
}
});
this.psdList.forEach(item => {
if (item.standCode == selected.code) {
models.push(deepAssign(item, { _dispose: true }));
}
});
this.$emit('updateMapModel', models);
} else {
//
this.$emit('updateMapModel', selected);
}
},
deleteObj() {
this.$refs.dataform.deleteObj();

View File

@ -341,17 +341,24 @@ export default {
edit() {
this.$refs.dataform.edit();
},
updateMapModel(selected) {
const models = [];
this.sectionList.forEach(elem => {
if (elem.trainWindowCode == selected.code) {
const section = deepAssign({}, elem);
section.trainWindowCode = '';
models.push(section);
}
});
models.push(deepAssign(selected, { _dispose: true }));
this.$emit('updateMapModel', models);
updateMapModel(selected, isSpecialTreat) {
//
if (isSpecialTreat) {
//
const models = [];
this.sectionList.forEach(elem => {
if (elem.trainWindowCode == selected.code) {
const section = deepAssign({}, elem);
section.trainWindowCode = '';
models.push(section);
}
});
models.push(deepAssign(selected, { _dispose: true }));
this.$emit('updateMapModel', models);
} else {
//
this.$emit('updateMapModel', selected);
}
},
editTrainWindow() {
this.$refs['addForm'].validate((valid) => {