From 967d7ddaad9a788f2d5583ea43ae67d3a2ee0f2c Mon Sep 17 00:00:00 2001 From: joylink_cuiweidong <364937672@qq.com> Date: Tue, 3 Dec 2019 15:22:16 +0800 Subject: [PATCH 1/4] =?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 | 22 +++++++++---------- .../newMapdraft/mapoperate/stationstand.vue | 19 ++++++++++------ 2 files changed, 23 insertions(+), 18 deletions(-) diff --git a/src/views/newMap/newMapdraft/mapoperate/station.vue b/src/views/newMap/newMapdraft/mapoperate/station.vue index 56241251a..585a0b837 100644 --- a/src/views/newMap/newMapdraft/mapoperate/station.vue +++ b/src/views/newMap/newMapdraft/mapoperate/station.vue @@ -218,7 +218,7 @@ export default { const newModal = Object.assign({}, station); newModal.controlled = false; newModal.concentrateStationCode = ''; - this.setStationStand(station,""); + this.setStationStand(station,''); data.forEach(each=>{ switch (each) { case station.code: { @@ -232,7 +232,7 @@ export default { this.$emit('updateMapModel', newModal); }); } else { - //没有选中数据,直接将其他车站设置为非控制 + // 没有选中数据,直接将其他车站设置为非控制 this.modifyChargeStation(); } this.edit(); @@ -243,29 +243,29 @@ export default { this.editModel.chargeStationCodeList = []; this.edit(); this.modifyChargeStation(); - this.setStationStand(this.editModel,''); - }else{ - this.setStationStand(this.editModel,this.editModel.code); + this.setStationStand(this.editModel, ''); + }else { + this.setStationStand(this.editModel, this.editModel.code); } }, - modifyChargeStation(){ + modifyChargeStation() { this.chargeStation.forEach(station=>{ const newModal = Object.assign({}, station); newModal.controlled = false; newModal.concentrateStationCode = ''; // 将原来被控制的车站下的站台,属性{所属设备集中站}设置为空 - this.setStationStand(station,""); - + this.setStationStand(station, ''); + this.$emit('updateMapModel', newModal); }); }, // 设置属性{所属设备集中站} - setStationStand(station,code){ + setStationStand(station, code) { this.stationStandList.forEach(elem=>{ - if(elem.stationCode==station.code){ + if (elem.stationCode == station.code) { const stationStand = Object.assign({}, elem); - stationStand.deviceStationCode=code; + stationStand.deviceStationCode = code; this.$emit('updateMapModel', stationStand); } }); diff --git a/src/views/newMap/newMapdraft/mapoperate/stationstand.vue b/src/views/newMap/newMapdraft/mapoperate/stationstand.vue index 51d31b65d..990dfea1e 100644 --- a/src/views/newMap/newMapdraft/mapoperate/stationstand.vue +++ b/src/views/newMap/newMapdraft/mapoperate/stationstand.vue @@ -18,7 +18,7 @@ - + {return elem.code==data}); + if(station){ + if(station.centralized){ + this.addModel.deviceStationCode=station.code; + } + else{ + this.addModel.deviceStationCode=station.concentrateStationCode; + } + } + }, deviceSelect(selected) { this.$refs.dataform.resetFields(); this.$refs.make.resetFields(); From 6426a70bd6a462a9c45c6a3c252c88089cb7564c Mon Sep 17 00:00:00 2001 From: joylink_cuiweidong <364937672@qq.com> Date: Tue, 3 Dec 2019 15:30:41 +0800 Subject: [PATCH 2/4] =?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 --- src/views/newMap/newMapdraft/mapoperate/stationcontrol.vue | 2 +- src/views/newMap/newMapdraft/mapoperate/stationstand.vue | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/views/newMap/newMapdraft/mapoperate/stationcontrol.vue b/src/views/newMap/newMapdraft/mapoperate/stationcontrol.vue index c14321a6f..d4c83d46c 100644 --- a/src/views/newMap/newMapdraft/mapoperate/stationcontrol.vue +++ b/src/views/newMap/newMapdraft/mapoperate/stationcontrol.vue @@ -8,7 +8,7 @@
- + {{ $t('map.updateObj') }} {{ $t('map.deleteObj') }}
diff --git a/src/views/newMap/newMapdraft/mapoperate/stationstand.vue b/src/views/newMap/newMapdraft/mapoperate/stationstand.vue index 990dfea1e..0db497753 100644 --- a/src/views/newMap/newMapdraft/mapoperate/stationstand.vue +++ b/src/views/newMap/newMapdraft/mapoperate/stationstand.vue @@ -8,7 +8,7 @@
- + {{ $t('map.updateObj') }} {{ $t('map.deleteObj') }}
From 635cc24b8f38866b0c78841016160ee985528ca6 Mon Sep 17 00:00:00 2001 From: fan <18706759286@163.com> Date: Tue, 3 Dec 2019 17:34:32 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E7=BB=98=E5=9B=BE=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E8=B0=83=E6=95=B4=5F(=E5=8C=BA=E6=AE=B5=E6=8B=86=E5=88=86?= =?UTF-8?q?=E5=90=88=E5=B9=B6=E9=97=AE=E9=A2=98=E8=B0=83=E6=95=B4)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../newMap/newMapdraft/mapoperate/section.vue | 35 ++++++++++--------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/src/views/newMap/newMapdraft/mapoperate/section.vue b/src/views/newMap/newMapdraft/mapoperate/section.vue index d77841258..84c3c7e1e 100644 --- a/src/views/newMap/newMapdraft/mapoperate/section.vue +++ b/src/views/newMap/newMapdraft/mapoperate/section.vue @@ -457,21 +457,17 @@ export default { }, rules() { var validateLeftSection = (rule, value, callback) => { - const leftSection = this.$store.getters['map/getDeviceByCode'](value); + const leftSection = value ? this.$store.getters['map/getDeviceByCode'](value) : ''; if (leftSection && (leftSection.points[1].x !== this.selected.points[0].x || leftSection.points[1].y !== this.selected.points[0].y )) { callback(new Error(this.$t('rules.theLeftEndOfTheSelectedAssociatedSectionIsNotAdjacent'))); - // } else if (this.editModel.type === '03' && !this.editModel.rightSection && !value) { - // callback(new Error('道岔区段需有一侧关联区段')); } else { callback(); } }; var validateRightSection = (rule, value, callback) => { - const rightSection = this.$store.getters['map/getDeviceByCode'](value); + const rightSection = value ? this.$store.getters['map/getDeviceByCode'](value) : ''; if (rightSection && (rightSection.points[0].x !== this.selected.points[1].x || rightSection.points[0].y !== this.selected.points[1].y )) { callback(new Error(this.$t('rules.theRightEndOfTheSelectedAssociatedSectionIsNotAdjacent'))); - // } else if (this.editModel.type === '03' && !this.editModel.leftSection && !value) { - // callback(new Error('道岔区段需有一侧关联区段')); } else { callback(); } @@ -665,7 +661,6 @@ export default { this.$refs.dataform.resetFields(); if (selected && selected._type.toUpperCase() === 'Section'.toUpperCase()) { this.editModel.points = []; - console.log(selected); this.activeName = 'first'; this.editModel = deepAssign(this.editModel, selected); this.editModel.logicSectionNum = selected.type === '01' ? selected.logicSectionNum : [0]; @@ -705,6 +700,11 @@ export default { this.field = ''; } } + } else { + this.editModel.relStandCode = selected.code; + this.selected = this.$store.getters['map/getDeviceByCode'](this.editModel.code); + this.fieldS = ''; + this.$emit('fieldSelect', ''); } }, handleClick(tab, event) { @@ -716,6 +716,7 @@ export default { hover(field) { if (field == 'relStandCode') { this.fieldS = field == this.fieldS ? '' : field; + this.$emit('fieldSelect', this.fieldS); } else { this.field = field == this.field ? '' : field; this.$emit('fieldSelect', this.field); @@ -1014,8 +1015,8 @@ export default { }; models.push(model); } - const leftAssociatedSection = deepAssign({}, this.$store.getters['map/getDeviceByCode'](selected.leftSectionCode) || {}); - const rightAssociatedSection = deepAssign({}, this.$store.getters['map/getDeviceByCode'](selected.rightSectionCode) || {}); + const leftAssociatedSection = selected.leftSectionCode ? deepAssign({}, this.$store.getters['map/getDeviceByCode'](selected.leftSectionCode) || {}) : ''; + const rightAssociatedSection = selected.rightSectionCode ? deepAssign({}, this.$store.getters['map/getDeviceByCode'](selected.rightSectionCode) || {}) : ''; models.forEach((elem, index) => { if (index === 0) { elem.leftSectionCode = selected.leftSectionCode; @@ -1035,8 +1036,8 @@ export default { } }); models.push(deepAssign(selected, { _dispose: true })); - leftAssociatedSection && models.push(leftAssociatedSection); - rightAssociatedSection && models.push(rightAssociatedSection); + leftAssociatedSection && JSON.stringify(leftAssociatedSection) !== '{}' && models.push(leftAssociatedSection); + rightAssociatedSection && JSON.stringify(rightAssociatedSection) !== '{}' && models.push(rightAssociatedSection); this.$emit('updateMapModel', models); // 添加新增拆分区段 } } @@ -1114,13 +1115,13 @@ export default { model.leftSectionCode = lsection.leftSectionCode; model.rightSectionCode = rsection.rightSectionCode; models.push(model); - const leftAssociatedSection = deepAssign({}, this.$store.getters['map/getDeviceByCode'](model.leftSectionCode) || {}); - const rightAssociatedSection = deepAssign({}, this.$store.getters['map/getDeviceByCode'](model.rightSectionCode) || {}); - if (leftAssociatedSection) { + const leftAssociatedSection = model.leftSectionCode ? deepAssign({}, this.$store.getters['map/getDeviceByCode'](model.leftSectionCode) || {}) : ''; + const rightAssociatedSection = model.rightSectionCode ? deepAssign({}, this.$store.getters['map/getDeviceByCode'](model.rightSectionCode) || {}) : ''; + if (leftAssociatedSection && JSON.stringify(leftAssociatedSection) !== '{}') { leftAssociatedSection.rightSectionCode = model.code; models.push(leftAssociatedSection); } - if (rightAssociatedSection) { + if (rightAssociatedSection && JSON.stringify(rightAssociatedSection) !== '{}') { rightAssociatedSection.leftSectionCode = model.code; models.push(rightAssociatedSection); } @@ -1146,8 +1147,8 @@ export default { model.leftSectionCode = rsection.leftSectionCode; model.rightSectionCode = lsection.rightSectionCode; models.push(model); - const leftAssociatedSection = deepAssign({}, this.$store.getters['map/getDeviceByCode'](model.leftSectionCode)); - const rightAssociatedSection = deepAssign({}, this.$store.getters['map/getDeviceByCode'](model.rightSectionCode)); + const leftAssociatedSection = model.leftSectionCode ? deepAssign({}, this.$store.getters['map/getDeviceByCode'](model.leftSectionCode) || {}) : ''; + const rightAssociatedSection = model.rightSectionCode ? deepAssign({}, this.$store.getters['map/getDeviceByCode'](model.rightSectionCode) || {}) : ''; if (leftAssociatedSection) { leftAssociatedSection.rightSectionCode = model.code; models.push(leftAssociatedSection); From bb10c4c23424bb13150018cdae642df557647495 Mon Sep 17 00:00:00 2001 From: fan <18706759286@163.com> Date: Tue, 3 Dec 2019 17:45:38 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E7=BB=98=E5=9B=BE=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E8=B0=83=E6=95=B4=5F(=E5=9B=BD=E9=99=85=E5=8C=96=E8=B0=83?= =?UTF-8?q?=E6=95=B4)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/i18n/langs/en/map.js | 8 +++++--- src/i18n/langs/zh/map.js | 8 +++++--- src/views/newMap/newMapdraft/mapoperate/section.vue | 4 ++-- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/i18n/langs/en/map.js b/src/i18n/langs/en/map.js index ddbaf6437..5af4e5438 100644 --- a/src/i18n/langs/en/map.js +++ b/src/i18n/langs/en/map.js @@ -553,7 +553,9 @@ export default { belongsSection: 'Belongs section:', coordinateMode: 'Coordinate mode', sectionAssociationMode: 'Section association mode', - leftAssociatedSection: 'Left associated section', - rightAssociatedSection: 'Right associated section', - chargeStationList:'Managed station list' + leftAssociatedSection: 'Left associated section:', + rightAssociatedSection: 'Right associated section:', + chargeStationList:'Managed station list', + createModel: 'Create model:', + startingPoint: 'Starting point:', }; diff --git a/src/i18n/langs/zh/map.js b/src/i18n/langs/zh/map.js index 306c68368..2596bb20a 100644 --- a/src/i18n/langs/zh/map.js +++ b/src/i18n/langs/zh/map.js @@ -547,7 +547,9 @@ export default { belongsSection: '所属区段:', coordinateMode: '坐标方式', sectionAssociationMode: '区段关联方式', - leftAssociatedSection: '左关联区段', - rightAssociatedSection: '右关联区段', - chargeStationList:'管理车站列表' + leftAssociatedSection: '左关联区段:', + rightAssociatedSection: '右关联区段:', + chargeStationList:'管理车站列表', + createModel: '创建方式:', + startingPoint: '起点:' }; diff --git a/src/views/newMap/newMapdraft/mapoperate/section.vue b/src/views/newMap/newMapdraft/mapoperate/section.vue index 84c3c7e1e..209222f83 100644 --- a/src/views/newMap/newMapdraft/mapoperate/section.vue +++ b/src/views/newMap/newMapdraft/mapoperate/section.vue @@ -13,11 +13,11 @@ - +
- +