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 models = [];
const space = 8; const space = 8;
const Standuid = getUID('PF', this.stationStandList); const Standuid = getUID('PF', this.stationStandList);
//
//
const model = { const model = {
_type: 'StationStand', _type: 'StationStand',
code: Standuid, code: Standuid,
name: `PF${this.stationStandList.length + 1}`, name: `PF${this.stationStandList.length + 1}`,
width: this.addModel.width, width: this.addModel.width,
height: this.addModel.height, height: this.addModel.height,
deviceStationCode: this.addModel.deviceStationCode, deviceStationCode: this.getDeviceStationCode(),
visible: true, visible: true,
position: { position: {
x: 0, 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() { edit() {
this.$refs.dataform.validate((valid) => { this.$refs.dataform.validate((valid) => {