From c82edc851632e235035783f5fd98526a2e414c12 Mon Sep 17 00:00:00 2001 From: joylink_cuiweidong <364937672@qq.com> Date: Tue, 11 Aug 2020 14:17:00 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9C=B0=E5=9B=BE=E7=BB=98=E5=9B=BE=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapoperate/components/operateProperty.vue | 2 +- .../newMapdraft/mapoperate/stationstand.vue | 36 +++++++++++-------- .../newMapdraft/mapoperate/trainwindow.vue | 29 +++++++++------ 3 files changed, 41 insertions(+), 26 deletions(-) diff --git a/src/views/newMap/newMapdraft/mapoperate/components/operateProperty.vue b/src/views/newMap/newMapdraft/mapoperate/components/operateProperty.vue index 9767a6877..dd6dd7755 100644 --- a/src/views/newMap/newMapdraft/mapoperate/components/operateProperty.vue +++ b/src/views/newMap/newMapdraft/mapoperate/components/operateProperty.vue @@ -72,7 +72,7 @@ export default { break; } case 'StationStand': case 'TrainWindow': { - this.$emit('updateMapModel', selected); + this.$emit('updateMapModel', selected, true); break; } default : { diff --git a/src/views/newMap/newMapdraft/mapoperate/stationstand.vue b/src/views/newMap/newMapdraft/mapoperate/stationstand.vue index b2818991d..256b7b1c6 100644 --- a/src/views/newMap/newMapdraft/mapoperate/stationstand.vue +++ b/src/views/newMap/newMapdraft/mapoperate/stationstand.vue @@ -400,20 +400,28 @@ export default { }); return beCentralizedStation[stationCode] || ''; }, - updateMapModel(selected) { - const models = []; - models.push(deepAssign(selected, { _dispose: true })); - this.espList.forEach(item => { - if (item.standCode == selected.code) { - models.push(deepAssign(item, { _dispose: true })); - } - }); - this.psdList.forEach(item => { - if (item.standCode == selected.code) { - models.push(deepAssign(item, { _dispose: true })); - } - }); - this.$emit('updateMapModel', models); + updateMapModel(selected, isSpecialTreat) { + // 是否特殊处理 + if (isSpecialTreat) { + // 用于删除 + const models = []; + models.push(deepAssign(selected, { _dispose: true })); + this.espList.forEach(item => { + if (item.standCode == selected.code) { + models.push(deepAssign(item, { _dispose: true })); + } + }); + this.psdList.forEach(item => { + if (item.standCode == selected.code) { + models.push(deepAssign(item, { _dispose: true })); + } + }); + this.$emit('updateMapModel', models); + } else { + // 用于更新 + this.$emit('updateMapModel', selected); + } + }, deleteObj() { this.$refs.dataform.deleteObj(); diff --git a/src/views/newMap/newMapdraft/mapoperate/trainwindow.vue b/src/views/newMap/newMapdraft/mapoperate/trainwindow.vue index 2a7c9a4ca..e3d68cb15 100644 --- a/src/views/newMap/newMapdraft/mapoperate/trainwindow.vue +++ b/src/views/newMap/newMapdraft/mapoperate/trainwindow.vue @@ -341,17 +341,24 @@ export default { edit() { this.$refs.dataform.edit(); }, - updateMapModel(selected) { - const models = []; - this.sectionList.forEach(elem => { - if (elem.trainWindowCode == selected.code) { - const section = deepAssign({}, elem); - section.trainWindowCode = ''; - models.push(section); - } - }); - models.push(deepAssign(selected, { _dispose: true })); - this.$emit('updateMapModel', models); + updateMapModel(selected, isSpecialTreat) { + // 是否特殊处理 + if (isSpecialTreat) { + // 用于删除 + const models = []; + this.sectionList.forEach(elem => { + if (elem.trainWindowCode == selected.code) { + const section = deepAssign({}, elem); + section.trainWindowCode = ''; + models.push(section); + } + }); + models.push(deepAssign(selected, { _dispose: true })); + this.$emit('updateMapModel', models); + } else { + // 用于更新 + this.$emit('updateMapModel', selected); + } }, editTrainWindow() { this.$refs['addForm'].validate((valid) => {