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) => {