站台创建关联集中站

This commit is contained in:
joylink_cuiweidong 2019-12-18 10:01:58 +08:00
parent ee4078e5c9
commit 9c54da44f3

View File

@ -287,15 +287,13 @@ export default {
const models = [];
const space = 8;
const Standuid = getUID('PF', this.stationStandList);
//
//
const model = {
_type: 'StationStand',
code: Standuid,
name: `PF${this.stationStandList.length + 1}`,
width: this.addModel.width,
height: this.addModel.height,
deviceStationCode: this.addModel.deviceStationCode,
deviceStationCode: this.getDeviceStationCode(),
visible: true,
position: {
x: 0,
@ -336,6 +334,23 @@ export default {
}
});
},
getDeviceStationCode() {
//
//
let beCentralizedStation = {};
this.stationList.forEach(data=>{
if (data.centralized) {
if (data.code == this.addModel.stationCode) {
beCentralizedStation = {};
return data.code;
}
data.chargeStationCodeList.forEach(charge=>{
beCentralizedStation[charge] = data.code;
});
}
});
return beCentralizedStation[this.addModel.stationCode] || '';
},
//
edit() {
this.$refs.dataform.validate((valid) => {