This commit is contained in:
zyy 2019-12-18 10:13:10 +08:00
commit d82c9eaf70

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) => {