From 9c54da44f3d8bd591a7bed8a0b4779a898bca548 Mon Sep 17 00:00:00 2001 From: joylink_cuiweidong <364937672@qq.com> Date: Wed, 18 Dec 2019 10:01:58 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AB=99=E5=8F=B0=E5=88=9B=E5=BB=BA=E5=85=B3?= =?UTF-8?q?=E8=81=94=E9=9B=86=E4=B8=AD=E7=AB=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../newMapdraft/mapoperate/stationstand.vue | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/src/views/newMap/newMapdraft/mapoperate/stationstand.vue b/src/views/newMap/newMapdraft/mapoperate/stationstand.vue index 51a3c3750..fb3e30db8 100644 --- a/src/views/newMap/newMapdraft/mapoperate/stationstand.vue +++ b/src/views/newMap/newMapdraft/mapoperate/stationstand.vue @@ -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) => {