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