From 9f1167b8fec90a3b34f9e08ebc3e3c5f50e1d035 Mon Sep 17 00:00:00 2001 From: joylink_cuiweidong <364937672@qq.com> Date: Tue, 3 Dec 2019 14:56:18 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E8=BD=A6=E7=AB=99=E7=AB=99=E5=8F=B0?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../newMap/newMapdraft/mapoperate/station.vue | 48 ++++++++++++++----- 1 file changed, 35 insertions(+), 13 deletions(-) diff --git a/src/views/newMap/newMapdraft/mapoperate/station.vue b/src/views/newMap/newMapdraft/mapoperate/station.vue index 959d44e57..56241251a 100644 --- a/src/views/newMap/newMapdraft/mapoperate/station.vue +++ b/src/views/newMap/newMapdraft/mapoperate/station.vue @@ -107,7 +107,8 @@ export default { 'stationList', 'sectionList', 'zcList', - 'lineCode' + 'lineCode', + 'stationStandList' ]), form() { return { @@ -198,6 +199,7 @@ export default { this.activeName = 'first'; this.editModel = deepAssign(this.editModel, selected); this.editModel.runPlanName = selected.runPlanName || ''; + // 筛选数据 去掉已经是集中站的数据,去掉自己本身,去掉被别的集中站选中的数据 this.chargeStation = this.stationList.filter(data=>{ return !data.centralized && data.code != this.editModel.code && !(data.controlled && data.concentrateStationCode != this.editModel.code); }); @@ -209,17 +211,20 @@ export default { this.$emit('stationSectionCode', ''); } }, + // 选择管理车站 changeChargeStation(data) { if (data.length > 0) { this.chargeStation.forEach(station=>{ const newModal = Object.assign({}, station); newModal.controlled = false; newModal.concentrateStationCode = ''; + this.setStationStand(station,""); data.forEach(each=>{ switch (each) { case station.code: { newModal.controlled = true; newModal.concentrateStationCode = this.editModel.code; + this.setStationStand(station,this.editModel.code); break; } } @@ -227,27 +232,44 @@ export default { this.$emit('updateMapModel', newModal); }); } else { - this.chargeStation.forEach(station=>{ - const newModal = Object.assign({}, station); - newModal.controlled = false; - newModal.concentrateStationCode = ''; - this.$emit('updateMapModel', newModal); - }); + //没有选中数据,直接将其他车站设置为非控制 + this.modifyChargeStation(); } this.edit(); }, changeCentralized(data) { if (!data) { + // 将当前车站选为非集中站 this.editModel.chargeStationCodeList = []; this.edit(); - this.chargeStation.forEach(station=>{ - const newModal = Object.assign({}, station); - newModal.controlled = false; - newModal.concentrateStationCode = ''; - this.$emit('updateMapModel', newModal); - }); + this.modifyChargeStation(); + this.setStationStand(this.editModel,''); + }else{ + this.setStationStand(this.editModel,this.editModel.code); } }, + modifyChargeStation(){ + this.chargeStation.forEach(station=>{ + const newModal = Object.assign({}, station); + newModal.controlled = false; + newModal.concentrateStationCode = ''; + + // 将原来被控制的车站下的站台,属性{所属设备集中站}设置为空 + this.setStationStand(station,""); + + this.$emit('updateMapModel', newModal); + }); + }, + // 设置属性{所属设备集中站} + setStationStand(station,code){ + this.stationStandList.forEach(elem=>{ + if(elem.stationCode==station.code){ + const stationStand = Object.assign({}, elem); + stationStand.deviceStationCode=code; + this.$emit('updateMapModel', stationStand); + } + }); + }, hover(field) { this.field = field === this.field ? '' : field; this.$emit('stationSectionCode', this.field); From f00a560327f6ca7fe9f912247ae190dcd7c3cceb Mon Sep 17 00:00:00 2001 From: fan <18706759286@163.com> Date: Tue, 3 Dec 2019 15:20:23 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E8=B0=83=E6=95=B4=E7=BB=98=E5=9B=BE?= =?UTF-8?q?=E7=9B=B8=E5=85=B3=E8=B0=83=E6=95=B4=5F(=E6=8E=A7=E5=88=B6?= =?UTF-8?q?=E6=A8=A1=E5=BC=8F=E5=A4=9A=E4=B8=AA=E5=88=9B=E5=BB=BA)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../newMapdraft/mapoperate/stationcontrol.vue | 48 ++++++++++--------- 1 file changed, 26 insertions(+), 22 deletions(-) diff --git a/src/views/newMap/newMapdraft/mapoperate/stationcontrol.vue b/src/views/newMap/newMapdraft/mapoperate/stationcontrol.vue index 65d39aad2..1c1cdc449 100644 --- a/src/views/newMap/newMapdraft/mapoperate/stationcontrol.vue +++ b/src/views/newMap/newMapdraft/mapoperate/stationcontrol.vue @@ -18,7 +18,7 @@ - + { if (valid) { - if (this.addModel.stationCode) { - const uid = getUID('StationControl'); - const model = { - _type: 'StationControl', - code: uid - // zokContent: '中控', - // zbjkContent: '总报警', - // zakContent: '站控', - // jjzkContent: '紧急站控', - // zzkContent: '站中控按钮', - // lskContent: '连锁控' - }; - this.stationList.forEach(elem => { - if (elem.code === this.addModel.stationCode) { - model.name = 'StationControl_' + elem.name.replace('Station_', ''); - model.position = { x: elem.position.x, y: elem.position.y }; - model.stationCode = elem.code; - } + if (this.addModel.stationCode.length) { + const models = []; + this.addModel.stationCode.forEach(item => { + const uid = getUID('StationControl'); + const model = { + _type: 'StationControl', + code: uid + // zokContent: '中控', + // zbjkContent: '总报警', + // zakContent: '站控', + // jjzkContent: '紧急站控', + // zzkContent: '站中控按钮', + // lskContent: '连锁控' + }; + this.stationList.forEach(elem => { + if (elem.code === item) { + model.name = 'StationControl_' + elem.name.replace('Station_', ''); + model.position = { x: elem.position.x, y: elem.position.y + 30 }; + model.stationCode = elem.code; + } + }); + console.log(model); + models.push(model); }); - - this.$emit('updateMapModel', model); + this.$emit('updateMapModel', models); } else { this.$messageBox(this.$t('tip.selectedStationEmpty')); } From 2b01902c967820d6183f6d306f438ffcacc67563 Mon Sep 17 00:00:00 2001 From: fan <18706759286@163.com> Date: Tue, 3 Dec 2019 15:21:29 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E8=B0=83=E6=95=B4=E7=BB=98=E5=9B=BE?= =?UTF-8?q?=E7=9B=B8=E5=85=B3=E8=B0=83=E6=95=B4=5F(=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E6=89=93=E5=8D=B0)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/newMap/newMapdraft/mapoperate/stationcontrol.vue | 1 - 1 file changed, 1 deletion(-) diff --git a/src/views/newMap/newMapdraft/mapoperate/stationcontrol.vue b/src/views/newMap/newMapdraft/mapoperate/stationcontrol.vue index 1c1cdc449..c14321a6f 100644 --- a/src/views/newMap/newMapdraft/mapoperate/stationcontrol.vue +++ b/src/views/newMap/newMapdraft/mapoperate/stationcontrol.vue @@ -211,7 +211,6 @@ export default { model.stationCode = elem.code; } }); - console.log(model); models.push(model); }); this.$emit('updateMapModel', models);