From d52fe1828118a817e332571e4ead770fd634860c Mon Sep 17 00:00:00 2001 From: sunzhenyu Date: Mon, 7 Dec 2020 09:46:00 +0800 Subject: [PATCH 1/8] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=89=E7=BB=B4?= =?UTF-8?q?=E5=AE=A2=E6=B5=81=E4=B8=8A=E4=B8=8B=E8=BD=A6=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/jlmap3d/edit/connect/getmodels.js | 179 ------------------ src/jlmap3d/edit/connect/testconnect.js | 10 - src/jlmap3d/edit/jl3dEditorLoader.js | 1 - .../jl3ddrive/moveupdate/DrivingConnectNew.js | 1 + .../model/traintrunk/passertrunkhuman.js | 4 +- 5 files changed, 4 insertions(+), 191 deletions(-) delete mode 100644 src/jlmap3d/edit/connect/getmodels.js delete mode 100644 src/jlmap3d/edit/connect/testconnect.js diff --git a/src/jlmap3d/edit/connect/getmodels.js b/src/jlmap3d/edit/connect/getmodels.js deleted file mode 100644 index 2a56c5714..000000000 --- a/src/jlmap3d/edit/connect/getmodels.js +++ /dev/null @@ -1,179 +0,0 @@ -//import request from '@/utils/request'; - -export function getmodels(data) { - let postmap = { - id:data.mapdata.id, - mapId:data.mapdata.mapId, - assets:"null", - sections:"null", - signals:"null", - trains:"null", - stands:"null", - switchs:"null" - }; - - if(data.mapdata.sectionlist.sections== undefined){ - return postmap; - } - - - if(data == undefined){ - - return postmap; - }else{ - //资源 - let assets = []; - for(let i=0;i Date: Mon, 7 Dec 2020 15:09:53 +0800 Subject: [PATCH 2/8] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=BB=A5=E5=8C=BA?= =?UTF-8?q?=E6=AE=B5=E4=B8=BA=E7=9B=AE=E6=A0=87=E5=88=A0=E9=99=A4=E5=B7=A6?= =?UTF-8?q?=E5=8F=B3=E6=89=80=E6=9C=89=E5=85=83=E7=B4=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../newMapdraft/mapoperate/ImageControl.vue | 4 + .../newMap/newMapdraft/mapoperate/arrow.vue | 4 + .../mapoperate/components/operateProperty.vue | 1 + .../newMapdraft/mapoperate/controlLamp.vue | 4 + .../newMap/newMapdraft/mapoperate/counter.vue | 4 + .../newMapdraft/mapoperate/delayunlock.vue | 4 + .../newMapdraft/mapoperate/directionRod.vue | 8 +- .../newMapdraft/mapoperate/espDraft.vue | 8 +- .../newMapdraft/mapoperate/floodGate.vue | 4 + .../newMap/newMapdraft/mapoperate/index.vue | 10 +- .../newMapdraft/mapoperate/lcControl.vue | 4 + .../newMap/newMapdraft/mapoperate/line.vue | 4 + .../mapoperate/outFrameControl.vue | 4 + .../newMap/newMapdraft/mapoperate/power.vue | 5 +- .../newMapdraft/mapoperate/psdDraft.vue | 8 +- .../mapoperate/section/batchSettings.vue | 126 ++++++++++++++++-- .../newMapdraft/mapoperate/section/index.vue | 3 + .../newMapdraft/mapoperate/signal/index.vue | 8 +- .../newMapdraft/mapoperate/splitStation.vue | 8 +- .../newMap/newMapdraft/mapoperate/station.vue | 5 +- .../newMapdraft/mapoperate/stationstand.vue | 12 +- .../newMapdraft/mapoperate/switch/index.vue | 2 +- .../mapoperate/switch/switchModle.vue | 6 +- .../newMap/newMapdraft/mapoperate/text.vue | 4 + .../newMapdraft/mapoperate/trainwindow.vue | 12 +- .../newMapdraft/mapoperate/zcControl.vue | 1 + 26 files changed, 223 insertions(+), 40 deletions(-) diff --git a/src/views/newMap/newMapdraft/mapoperate/ImageControl.vue b/src/views/newMap/newMapdraft/mapoperate/ImageControl.vue index 6844d1f80..276435a5c 100644 --- a/src/views/newMap/newMapdraft/mapoperate/ImageControl.vue +++ b/src/views/newMap/newMapdraft/mapoperate/ImageControl.vue @@ -8,6 +8,7 @@ :rules="rules" type="Resource" @updateMapModel="updateMapModel" + @clearDeviceSelect="clearDeviceSelect" /> @@ -162,6 +163,9 @@ export default { this.$emit('setCenter', code); this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code)); }, + clearDeviceSelect() { + this.$emit('deviceSelect', ''); + }, deviceSelect(selected) { this.$refs.form && this.$refs.form.resetFields(); this.$refs.make && this.$refs.make.resetFields(); diff --git a/src/views/newMap/newMapdraft/mapoperate/arrow.vue b/src/views/newMap/newMapdraft/mapoperate/arrow.vue index 7a3187c5a..a6c202e5a 100644 --- a/src/views/newMap/newMapdraft/mapoperate/arrow.vue +++ b/src/views/newMap/newMapdraft/mapoperate/arrow.vue @@ -8,6 +8,7 @@ :rules="rules" type="Arrow" @updateMapModel="updateMapModel" + @clearDeviceSelect="clearDeviceSelect" /> @@ -139,6 +140,9 @@ export default { clear() { this.addModel = getModel('Arrow'); }, + clearDeviceSelect() { + this.$emit('deviceSelect', ''); + }, create() { const model = deepAssign(this.addModel, {code:getUID('Arrow', this.arrowList)}); this.$emit('updateMapModel', model); diff --git a/src/views/newMap/newMapdraft/mapoperate/components/operateProperty.vue b/src/views/newMap/newMapdraft/mapoperate/components/operateProperty.vue index dd6dd7755..c9fad141e 100644 --- a/src/views/newMap/newMapdraft/mapoperate/components/operateProperty.vue +++ b/src/views/newMap/newMapdraft/mapoperate/components/operateProperty.vue @@ -51,6 +51,7 @@ export default { data.content = `${this.editModel.prepend}::${this.editModel.content}`; } this.$emit('updateMapModel', data); + this.$emit('clearDeviceSelect'); } else { this.$message('还有属性未填写,修改未生效!'); } diff --git a/src/views/newMap/newMapdraft/mapoperate/controlLamp.vue b/src/views/newMap/newMapdraft/mapoperate/controlLamp.vue index bb061bc4d..40c9aef82 100644 --- a/src/views/newMap/newMapdraft/mapoperate/controlLamp.vue +++ b/src/views/newMap/newMapdraft/mapoperate/controlLamp.vue @@ -8,6 +8,7 @@ :rules="rules" :type="editModel.type" @updateMapModel="updateMapModel" + @clearDeviceSelect="clearDeviceSelect" /> @@ -228,6 +229,9 @@ export default { this.$emit('deviceSelect', ''); } }, + clearDeviceSelect() { + this.$emit('deviceSelect', ''); + }, handleIndicatorLightList(indicatorLightList) { this.atsControlList = []; this.centerCommunicationList = []; diff --git a/src/views/newMap/newMapdraft/mapoperate/counter.vue b/src/views/newMap/newMapdraft/mapoperate/counter.vue index a14e2af63..628c30a78 100644 --- a/src/views/newMap/newMapdraft/mapoperate/counter.vue +++ b/src/views/newMap/newMapdraft/mapoperate/counter.vue @@ -8,6 +8,7 @@ :rules="rules" type="Counter" @updateMapModel="updateMapModel" + @clearDeviceSelect="clearDeviceSelect" /> @@ -162,6 +163,9 @@ export default { this.addModel.stationCode = selected.code; } }, + clearDeviceSelect() { + this.$emit('deviceSelect', ''); + }, create() { const uid = getUID('Counter', this.counterList); const model = { diff --git a/src/views/newMap/newMapdraft/mapoperate/delayunlock.vue b/src/views/newMap/newMapdraft/mapoperate/delayunlock.vue index 742e0aad4..1c3294446 100644 --- a/src/views/newMap/newMapdraft/mapoperate/delayunlock.vue +++ b/src/views/newMap/newMapdraft/mapoperate/delayunlock.vue @@ -8,6 +8,7 @@ :rules="rules" type="DelayUnlock" @updateMapModel="updateMapModel" + @clearDeviceSelect="clearDeviceSelect" /> @@ -148,6 +149,9 @@ export default { deviceChange(code) { this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code)); }, + clearDeviceSelect() { + this.$emit('deviceSelect', ''); + }, deviceSelect(selected) { this.$nextTick(() => { this.$refs.form && this.$refs.form.resetFields(); diff --git a/src/views/newMap/newMapdraft/mapoperate/directionRod.vue b/src/views/newMap/newMapdraft/mapoperate/directionRod.vue index dfcf6c757..e6ed7e030 100644 --- a/src/views/newMap/newMapdraft/mapoperate/directionRod.vue +++ b/src/views/newMap/newMapdraft/mapoperate/directionRod.vue @@ -8,6 +8,7 @@ :rules="rules" type="Resource" @updateMapModel="updateMapModel" + @clearDeviceSelect="clearDeviceSelect" /> @@ -200,6 +201,9 @@ export default { this.$emit('deviceSelect', ''); } }, + clearDeviceSelect() { + this.$emit('deviceSelect', ''); + }, hover(field) { this.field = field === this.field ? '' : field; if (this.field) { @@ -229,8 +233,8 @@ export default { }, updateMapModel(data) { data.uniqueCode = `${data.startStationCode}-${data.endStationCode}-${data.right}`; - this.$emit('updateMapModel', data); - this.field = ''; + this.$emit('updateMapModel', data); + this.field = ''; }, deleteObj() { this.$refs.dataform.deleteObj(); diff --git a/src/views/newMap/newMapdraft/mapoperate/espDraft.vue b/src/views/newMap/newMapdraft/mapoperate/espDraft.vue index cd48a662c..23408cc91 100644 --- a/src/views/newMap/newMapdraft/mapoperate/espDraft.vue +++ b/src/views/newMap/newMapdraft/mapoperate/espDraft.vue @@ -8,6 +8,7 @@ :rules="rules" type="Esp" @updateMapModel="updateMapModel" + @clearDeviceSelect="clearDeviceSelect" /> @@ -109,6 +110,9 @@ export default { this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code)); // this.edit(); }, + clearDeviceSelect() { + this.$emit('deviceSelect', ''); + }, hover(field) { this.field = field === this.field ? '' : field; if (this.field) { @@ -163,8 +167,8 @@ export default { } }, updateMapModel(data) { - this.$emit('updateMapModel', data); - this.field = ''; + this.$emit('updateMapModel', data); + this.field = ''; }, deleteObj() { this.$refs.dataform.deleteObj(); diff --git a/src/views/newMap/newMapdraft/mapoperate/floodGate.vue b/src/views/newMap/newMapdraft/mapoperate/floodGate.vue index 57225ba0a..63b4a7c36 100644 --- a/src/views/newMap/newMapdraft/mapoperate/floodGate.vue +++ b/src/views/newMap/newMapdraft/mapoperate/floodGate.vue @@ -8,6 +8,7 @@ :rules="rules" type="Resource" @updateMapModel="updateMapModel" + @clearDeviceSelect="clearDeviceSelect" /> @@ -143,6 +144,9 @@ export default { this.$emit('setCenter', code); this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code)); }, + clearDeviceSelect() { + this.$emit('deviceSelect', ''); + }, deviceSelect(selected) { this.$refs.form && this.$refs.form.resetFields(); this.$refs.make && this.$refs.make.resetFields(); diff --git a/src/views/newMap/newMapdraft/mapoperate/index.vue b/src/views/newMap/newMapdraft/mapoperate/index.vue index cb94b7bf5..9396129e3 100644 --- a/src/views/newMap/newMapdraft/mapoperate/index.vue +++ b/src/views/newMap/newMapdraft/mapoperate/index.vue @@ -3,10 +3,12 @@
- - {{ $t('map.mapName') }} - {{ mapInfo.name }} - +
+ {{ $t('map.mapName') }} + + {{ mapInfo.name }} + +
{{ $t('map.save') }} 数据操作 diff --git a/src/views/newMap/newMapdraft/mapoperate/lcControl.vue b/src/views/newMap/newMapdraft/mapoperate/lcControl.vue index 25a00dd7c..e5d7f7ff5 100644 --- a/src/views/newMap/newMapdraft/mapoperate/lcControl.vue +++ b/src/views/newMap/newMapdraft/mapoperate/lcControl.vue @@ -8,6 +8,7 @@ :rules="rules" type="LcControl" @updateMapModel="updateMapModel" + @clearDeviceSelect="clearDeviceSelect" /> @@ -142,6 +143,9 @@ export default { this.$emit('setCenter', code); this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code)); }, + clearDeviceSelect() { + this.$emit('deviceSelect', ''); + }, deviceSelect(selected) { this.$refs.form && this.$refs.form.resetFields(); this.$refs.make && this.$refs.make.resetFields(); diff --git a/src/views/newMap/newMapdraft/mapoperate/line.vue b/src/views/newMap/newMapdraft/mapoperate/line.vue index 9cc7d7fbf..afc02f4ae 100644 --- a/src/views/newMap/newMapdraft/mapoperate/line.vue +++ b/src/views/newMap/newMapdraft/mapoperate/line.vue @@ -8,6 +8,7 @@ :rules="rules" type="Line" @updateMapModel="updateMapModel" + @clearDeviceSelect="clearDeviceSelect" /> @@ -149,6 +150,9 @@ export default { }); }, methods: { + clearDeviceSelect() { + this.$emit('deviceSelect', ''); + }, deviceChange(code) { this.$emit('setCenter', code); this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code)); diff --git a/src/views/newMap/newMapdraft/mapoperate/outFrameControl.vue b/src/views/newMap/newMapdraft/mapoperate/outFrameControl.vue index 364442e4c..fd0f6739c 100644 --- a/src/views/newMap/newMapdraft/mapoperate/outFrameControl.vue +++ b/src/views/newMap/newMapdraft/mapoperate/outFrameControl.vue @@ -8,6 +8,7 @@ :rules="rules" type="OutFrame" @updateMapModel="updateMapModel" + @clearDeviceSelect="clearDeviceSelect" /> @@ -156,6 +157,9 @@ export default { this.editModel = deepAssign(this.editModel, selected); } }, + clearDeviceSelect() { + this.$emit('deviceSelect', ''); + }, addPoint(index) { const data = { x: 0, y: 0 }; this.editModel.points.splice(index + 1, 0, data); diff --git a/src/views/newMap/newMapdraft/mapoperate/power.vue b/src/views/newMap/newMapdraft/mapoperate/power.vue index 5e768a019..2a6dee6f2 100644 --- a/src/views/newMap/newMapdraft/mapoperate/power.vue +++ b/src/views/newMap/newMapdraft/mapoperate/power.vue @@ -8,6 +8,7 @@ :rules="rules" type="Power" @updateMapModel="updateMapModel" + @clearDeviceSelect="tabClick" /> @@ -324,8 +325,8 @@ export default { } else { delete data.sectionUnitList; } - this.$emit('updateMapModel', data); - this.field = ''; + this.$emit('updateMapModel', data); + this.field = ''; } }, deleteObj() { diff --git a/src/views/newMap/newMapdraft/mapoperate/psdDraft.vue b/src/views/newMap/newMapdraft/mapoperate/psdDraft.vue index 8c1abd1c5..8659367a7 100644 --- a/src/views/newMap/newMapdraft/mapoperate/psdDraft.vue +++ b/src/views/newMap/newMapdraft/mapoperate/psdDraft.vue @@ -8,6 +8,7 @@ :rules="rules" type="Psd" @updateMapModel="updateMapModel" + @clearDeviceSelect="clearDeviceSelect" /> @@ -200,6 +201,9 @@ export default { this.$emit('deviceSelect', ''); } }, + clearDeviceSelect() { + this.$emit('deviceSelect', ''); + }, deviceSelect(selected) { if (selected && selected._type.toUpperCase() === 'Psd'.toUpperCase()) { this.$refs.dataform && this.$refs.dataform.resetFields(); @@ -235,8 +239,8 @@ export default { this.$refs.createForm.resetForm(); }, updateMapModel(data) { - this.$emit('updateMapModel', data); - this.field = ''; + this.$emit('updateMapModel', data); + this.field = ''; }, // 批量设置 batchSettings() { diff --git a/src/views/newMap/newMapdraft/mapoperate/section/batchSettings.vue b/src/views/newMap/newMapdraft/mapoperate/section/batchSettings.vue index e3f9a04e7..e6f8716f5 100644 --- a/src/views/newMap/newMapdraft/mapoperate/section/batchSettings.vue +++ b/src/views/newMap/newMapdraft/mapoperate/section/batchSettings.vue @@ -3,12 +3,6 @@ - {{ $t('global.set') }} @@ -103,6 +97,34 @@ 设置 + + + + + + + {{ $t('map.activate') }} + + + 右边删除 + 左边删除 + + + + 删除 + + + +
@@ -124,10 +146,6 @@ export default { data() { return { activeName: '', - // form: { - // leftDistance: 0, - // rightDistance: 0 - // }, formModel: { modelList: [], trainPosType: '' @@ -136,6 +154,10 @@ export default { roadType: null, sectionCode: '' }, + fromModel: { + sectionCode: '', + right: false + }, positionTypes: [ { name: '上方', type: '01' }, { name: '下方', type: '02' } @@ -332,6 +354,90 @@ export default { }); this.$emit('updateMapModel', models); this.$message.success('道岔区段设置成功!'); + }, + handleAllDelete() { + const section = this.$store.getters['map/getDeviceByCode'](this.fromModel.sectionCode); + const index = this.fromModel.right ? section.points.length - 1 : 0; + const pointX = section.points[index].x; + const map = this.$store.state.map.map; + const models = []; + console.log(this.$store.state.map.map); + map.sectionList.forEach(item => { + if (item.type == '04') { + const flag = this.fromModel.right ? item.namePosition.x >= pointX : item.namePosition.x < pointX; + if (flag) { + models.push(deepAssign(item, { _dispose: true })); + } + } else { + const flag = this.fromModel.right ? item.points[0].x >= pointX : item.points[0].x < pointX; + if (flag) { + if (item.type == '03') { + const switchModel = this.$store.getters['map/getDeviceByCode'](item.relSwitchCode); + models.push(deepAssign(switchModel, { _dispose: true })); + } + models.push(deepAssign(item, { _dispose: true })); + } + } + }); + map.lineList.forEach(item => { + const flag = this.fromModel.right ? item.points[0].x >= pointX : item.points[0].x < pointX; + if (flag) { + models.push(deepAssign(item, { _dispose: true })); + } + }); + map.trainWindowList.forEach(item => { + const flag = this.fromModel.right ? item.point.x > pointX : item.point.x < pointX; + if (flag) { + models.push(deepAssign(item, { _dispose: true })); + } + }); + map.powerLineList.forEach(item => { + const flag = this.fromModel.right ? item.points[0].x >= pointX : item.points[0].x < pointX; + if (flag) { + models.push(deepAssign(item, { _dispose: true })); + } + }); + map.signalList.forEach(item => { + const flag = this.fromModel.right ? item.position.x > pointX : item.position.x < pointX; + if (flag) { + models.push(deepAssign(item, { _dispose: true })); + } + }); + map.stationList.forEach(item => { + const flag = this.fromModel.right ? item.position.x > pointX : item.position.x < pointX; + if (flag) { + models.push(deepAssign(item, { _dispose: true })); + } + }); + map.stationStandList.forEach(item => { + const flag = this.fromModel.right ? item.position.x > pointX : item.position.x < pointX; + if (flag) { + models.push(deepAssign(item, { _dispose: true })); + const esp = map.espList.find(ele => ele.standCode == item.code); + models.push(deepAssign(esp, { _dispose: true })); + } + }); + map.psdList.forEach(item => { + const flag = this.fromModel.right ? item.position.x > pointX : item.position.x < pointX; + if (flag) { + models.push(deepAssign(item, { _dispose: true })); + } + }); + map.textList.forEach(item => { + const flag = this.fromModel.right ? item.position.x > pointX : item.position.x < pointX; + if (flag) { + models.push(deepAssign(item, { _dispose: true })); + } + }); + if (this.fromModel.right && section.rightSectionCode) { + section.rightSectionCode = ''; + } + if (!this.fromModel.right && section.leftSectionCode) { + section.leftSectionCode = ''; + } + models.push(deepAssign(section, { _type: 'Section' })); + this.$emit('updateMapModel', models); + console.log(models, '批量删除'); } } }; diff --git a/src/views/newMap/newMapdraft/mapoperate/section/index.vue b/src/views/newMap/newMapdraft/mapoperate/section/index.vue index f328fd171..78ae6f1c2 100644 --- a/src/views/newMap/newMapdraft/mapoperate/section/index.vue +++ b/src/views/newMap/newMapdraft/mapoperate/section/index.vue @@ -465,6 +465,9 @@ export default { } else if (this.field.toUpperCase() === 'sectionRoadCode'.toUpperCase()) { this.$refs.batchSettings.roadModel.sectionCode = selected.code; this.activeName = 'five'; + } else if (this.field.toUpperCase() === 'sectiondeleteCode'.toUpperCase()) { + this.$refs.batchSettings.fromModel.sectionCode = selected.code; + this.activeName = 'five'; } } }, diff --git a/src/views/newMap/newMapdraft/mapoperate/signal/index.vue b/src/views/newMap/newMapdraft/mapoperate/signal/index.vue index 903aaa198..4ed37c12d 100644 --- a/src/views/newMap/newMapdraft/mapoperate/signal/index.vue +++ b/src/views/newMap/newMapdraft/mapoperate/signal/index.vue @@ -8,6 +8,7 @@ :rules="rules" type="Signal" @updateMapModel="updateMapModel" + @clearDeviceSelect="clearDeviceSelect" /> @@ -424,6 +425,9 @@ export default { this.field = field == this.field ? '' : field; this.signalSectionCode(this.field); }, + clearDeviceSelect() { + this.$emit('deviceSelect', ''); + }, deviceChange(code) { this.$emit('setCenter', code); this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code)); @@ -472,8 +476,8 @@ export default { } }, updateMapModel(data) { - this.$emit('updateMapModel', data); - this.field = ''; + this.$emit('updateMapModel', data); + this.field = ''; }, signalSectionCode(field) { this.field = field; diff --git a/src/views/newMap/newMapdraft/mapoperate/splitStation.vue b/src/views/newMap/newMapdraft/mapoperate/splitStation.vue index 44ad8380e..661fd2bc7 100644 --- a/src/views/newMap/newMapdraft/mapoperate/splitStation.vue +++ b/src/views/newMap/newMapdraft/mapoperate/splitStation.vue @@ -8,6 +8,7 @@ :rules="createRules" :type="editModel.type" @updateMapModel="updateMapModel" + @clearDeviceSelect="clearDeviceSelect" /> @@ -142,6 +143,9 @@ export default { this.editModel.type = selected._type; } }, + clearDeviceSelect() { + this.$emit('deviceSelect', ''); + }, // 创建对象 create() { const uid = getUID(this.addModel.type, this.splitStationList); // 根据类型写 uid 前缀命名 @@ -162,8 +166,8 @@ export default { this.$refs.createForm.resetForm(); }, updateMapModel(data) { - this.$emit('updateMapModel', data); - this.field = ''; + this.$emit('updateMapModel', data); + this.field = ''; }, deleteObj() { this.$refs.dataform.deleteObj(); diff --git a/src/views/newMap/newMapdraft/mapoperate/station.vue b/src/views/newMap/newMapdraft/mapoperate/station.vue index ef3d2fc61..27b30f1e7 100644 --- a/src/views/newMap/newMapdraft/mapoperate/station.vue +++ b/src/views/newMap/newMapdraft/mapoperate/station.vue @@ -419,8 +419,9 @@ export default { const list = this.changeChargeStation(this.editModel.chargeStationCodeList); const centralizedList = this.changeCentralized(this.editModel.centralized); const models = [this.editModel, ...list, ...centralizedList]; - this.$emit('updateMapModel', models); - this.field = ''; + this.$emit('updateMapModel', models); + this.field = ''; + this.$emit('deviceSelect', ''); } }); }, diff --git a/src/views/newMap/newMapdraft/mapoperate/stationstand.vue b/src/views/newMap/newMapdraft/mapoperate/stationstand.vue index c5cbd997f..9635891f3 100644 --- a/src/views/newMap/newMapdraft/mapoperate/stationstand.vue +++ b/src/views/newMap/newMapdraft/mapoperate/stationstand.vue @@ -8,6 +8,7 @@ :rules="rules" type="StationStand" @updateMapModel="updateMapModel" + @clearDeviceSelect="clearDeviceSelect" /> @@ -289,6 +290,9 @@ export default { this.$emit('deviceSelect', ''); } }, + clearDeviceSelect() { + this.$emit('deviceSelect', ''); + }, changeStation(station) { this.editModel.deviceStationCode = this.getDeviceStationCode(station); }, @@ -416,12 +420,12 @@ export default { models.push(deepAssign(item, { _dispose: true })); } }); - this.$emit('updateMapModel', models); - this.field = ''; + this.$emit('updateMapModel', models); + this.field = ''; } else { // 用于更新 - this.$emit('updateMapModel', selected); - this.field = ''; + this.$emit('updateMapModel', selected); + this.field = ''; } }, deleteObj() { diff --git a/src/views/newMap/newMapdraft/mapoperate/switch/index.vue b/src/views/newMap/newMapdraft/mapoperate/switch/index.vue index b9c67254a..43b90820f 100644 --- a/src/views/newMap/newMapdraft/mapoperate/switch/index.vue +++ b/src/views/newMap/newMapdraft/mapoperate/switch/index.vue @@ -1,7 +1,7 @@