站台创建关联集中站
This commit is contained in:
parent
ee4078e5c9
commit
9c54da44f3
@ -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) => {
|
||||
|
Loading…
Reference in New Issue
Block a user