From 740757896bfeb089b471dc1f333db3086ac1db53 Mon Sep 17 00:00:00 2001 From: joylink_cuiweidong <364937672@qq.com> Date: Tue, 11 Aug 2020 10:57:20 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E5=9C=B0=E5=9B=BE=E7=BB=98=E5=88=B6?= =?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/jlmapNew/index.vue | 1 + .../newMapdraft/mapoperate/ImageControl.vue | 4 ++ .../newMap/newMapdraft/mapoperate/arrow.vue | 5 -- .../mapoperate/components/operateProperty.vue | 25 ++++++- .../newMapdraft/mapoperate/controlLamp.vue | 4 ++ .../newMap/newMapdraft/mapoperate/counter.vue | 4 ++ .../newMapdraft/mapoperate/delayunlock.vue | 4 ++ .../newMapdraft/mapoperate/espDraft.vue | 55 ++++++--------- .../newMapdraft/mapoperate/lcControl.vue | 4 ++ .../newMap/newMapdraft/mapoperate/line.vue | 4 ++ .../mapoperate/outFrameControl.vue | 4 ++ .../newMap/newMapdraft/mapoperate/power.vue | 4 ++ .../newMapdraft/mapoperate/psdDraft.vue | 4 ++ .../newMapdraft/mapoperate/signal/index.vue | 4 ++ .../newMapdraft/mapoperate/splitStation.vue | 4 ++ .../newMapdraft/mapoperate/stationstand.vue | 70 +++++++------------ .../mapoperate/switch/switchModle.vue | 4 ++ 17 files changed, 120 insertions(+), 84 deletions(-) diff --git a/src/views/newMap/jlmapNew/index.vue b/src/views/newMap/jlmapNew/index.vue index 5e1ace4dd..830b7cfb3 100644 --- a/src/views/newMap/jlmapNew/index.vue +++ b/src/views/newMap/jlmapNew/index.vue @@ -338,6 +338,7 @@ export default { case 'Delete': this.$store.dispatch('map/setDeleteCount'); break; case 'Update': + debugger; this.$refs.offsetX.focus(); this.$store.dispatch('map/setUpdateCount'); break; diff --git a/src/views/newMap/newMapdraft/mapoperate/ImageControl.vue b/src/views/newMap/newMapdraft/mapoperate/ImageControl.vue index 52628ea4d..6844d1f80 100644 --- a/src/views/newMap/newMapdraft/mapoperate/ImageControl.vue +++ b/src/views/newMap/newMapdraft/mapoperate/ImageControl.vue @@ -194,6 +194,10 @@ export default { }, deleteObj() { this.$refs.dataform.deleteObj(); + }, + // 修改对象 + edit() { + this.$refs.dataform.edit(); } } }; diff --git a/src/views/newMap/newMapdraft/mapoperate/arrow.vue b/src/views/newMap/newMapdraft/mapoperate/arrow.vue index d6fcac61b..d9f534ef3 100644 --- a/src/views/newMap/newMapdraft/mapoperate/arrow.vue +++ b/src/views/newMap/newMapdraft/mapoperate/arrow.vue @@ -127,11 +127,6 @@ export default { return form; } }, - watch: { - '$store.state.map.deleteCount': function (val) { - this.deleteObj(); - } - }, methods: { deviceChange(code) { this.$emit('setCenter', code); diff --git a/src/views/newMap/newMapdraft/mapoperate/components/operateProperty.vue b/src/views/newMap/newMapdraft/mapoperate/components/operateProperty.vue index a5fa59a43..1a1a64a8b 100644 --- a/src/views/newMap/newMapdraft/mapoperate/components/operateProperty.vue +++ b/src/views/newMap/newMapdraft/mapoperate/components/operateProperty.vue @@ -36,6 +36,11 @@ export default { required:true } }, + data() { + return { + isDeleteHide:true + }; + }, methods:{ // 修改对象 edit() { @@ -51,16 +56,32 @@ export default { // 删除对象 deleteObj() { const selected = this.$store.getters['map/getDeviceByCode'](this.editModel.code); - if (selected) { + if (selected && this.isDeleteHide) { + this.isDeleteHide = false; this.$confirm(this.$t('tip.confirmDeletion'), this.$t('tip.hint'), { confirmButtonText: this.$t('tip.confirm'), cancelButtonText: this.$t('tip.cancel'), type: 'warning' }).then(() => { - this.$emit('updateMapModel', {...selected, _dispose: true}); + switch (this.type) { + case 'Esp': { + this.$store.dispatch('map/delMapStandData', {models: [selected], type: 'espList'}); + break; + } + case 'StationStand': { + this.$emit('updateMapModel', selected); + break; + } + default : { + this.$emit('updateMapModel', {...selected, _dispose: true}); + break; + } + } this.$refs.dataform && this.$refs.dataform.resetFields(); + this.isDeleteHide = true; }).catch(() => { this.$message.info(this.$t('tip.cancelledDelete')); + this.isDeleteHide = true; }); } }, diff --git a/src/views/newMap/newMapdraft/mapoperate/controlLamp.vue b/src/views/newMap/newMapdraft/mapoperate/controlLamp.vue index bc246f793..65bdca927 100644 --- a/src/views/newMap/newMapdraft/mapoperate/controlLamp.vue +++ b/src/views/newMap/newMapdraft/mapoperate/controlLamp.vue @@ -471,6 +471,10 @@ export default { }, deleteObj() { this.$refs.dataform.deleteObj(); + }, + // 修改对象 + edit() { + this.$refs.dataform.edit(); } } }; diff --git a/src/views/newMap/newMapdraft/mapoperate/counter.vue b/src/views/newMap/newMapdraft/mapoperate/counter.vue index c9ad95e0b..694178c8b 100644 --- a/src/views/newMap/newMapdraft/mapoperate/counter.vue +++ b/src/views/newMap/newMapdraft/mapoperate/counter.vue @@ -191,6 +191,10 @@ export default { }, deleteObj() { this.$refs.dataform.deleteObj(); + }, + // 修改对象 + edit() { + this.$refs.dataform.edit(); } } }; diff --git a/src/views/newMap/newMapdraft/mapoperate/delayunlock.vue b/src/views/newMap/newMapdraft/mapoperate/delayunlock.vue index ac94a72d7..a0aeca576 100644 --- a/src/views/newMap/newMapdraft/mapoperate/delayunlock.vue +++ b/src/views/newMap/newMapdraft/mapoperate/delayunlock.vue @@ -186,6 +186,10 @@ export default { }, deleteObj() { this.$refs.dataform.deleteObj(); + }, + // 修改对象 + edit() { + this.$refs.dataform.edit(); } } }; diff --git a/src/views/newMap/newMapdraft/mapoperate/espDraft.vue b/src/views/newMap/newMapdraft/mapoperate/espDraft.vue index ce4d931a5..2072c3485 100644 --- a/src/views/newMap/newMapdraft/mapoperate/espDraft.vue +++ b/src/views/newMap/newMapdraft/mapoperate/espDraft.vue @@ -1,7 +1,7 @@