From 75f400a1c70628c5a2e946766230227aafb3a86d Mon Sep 17 00:00:00 2001 From: fan <18706759286@163.com> Date: Thu, 5 Dec 2019 18:53:06 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=98=E5=9B=BE=E7=9B=B8=E5=85=B3=E8=B0=83?= =?UTF-8?q?=E6=95=B4=5F(=E6=B7=BB=E5=8A=A0=E5=BF=AB=E6=8D=B7=E5=88=A0?= =?UTF-8?q?=E9=99=A4)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/jmapNew/keyboardController.js | 3 +-- src/store/modules/map.js | 10 +++++++++- src/views/newMap/jlmapNew/index.vue | 2 ++ src/views/newMap/newMapdraft/mapoperate/section.vue | 3 +++ .../newMap/newMapdraft/mapoperate/signal/index.vue | 3 +++ src/views/newMap/newMapdraft/mapoperate/station.vue | 3 +++ .../newMap/newMapdraft/mapoperate/stationstand.vue | 3 +++ src/views/newMap/newMapdraft/mapoperate/switch.vue | 3 +++ 8 files changed, 27 insertions(+), 3 deletions(-) diff --git a/src/jmapNew/keyboardController.js b/src/jmapNew/keyboardController.js index 0a0c6c880..78915d191 100644 --- a/src/jmapNew/keyboardController.js +++ b/src/jmapNew/keyboardController.js @@ -38,7 +38,7 @@ class KeyboardController extends Eventful { this._keyboards = [ { key: 'Control', keyCode: 17, active: false }, { key: 'Shift', keyCode: 16, active: false }, - { key: 'Alt', keyCode: 18, active: false } + { key: 'Alt', keyCode: 18, active: false }, ]; } @@ -47,7 +47,6 @@ class KeyboardController extends Eventful { var index = this._keyboards.findIndex( elem=> { return elem.keyCode == e.keyCode; } ); - if (index >= 0) { this._keyboards[index].active = true; } else { diff --git a/src/store/modules/map.js b/src/store/modules/map.js index 56ba2968b..8d831271a 100644 --- a/src/store/modules/map.js +++ b/src/store/modules/map.js @@ -250,7 +250,8 @@ const map = { mapIdList: {}, // 地图数据列表(以id为标识) mapViewLoadedCount: 0, // 地图视图加载完成标识 mapDataLoadedCount: 0, // 地图数据加载完成标识 - trainDetails: null // 地图'列车详情'显示 + trainDetails: null, // 地图'列车详情'显示 + deleteCount: 0 // 绘图快捷删除标识 }, getters: { @@ -577,6 +578,9 @@ const map = { state.map[type].push(item); } }); + }, + setDeleteCount: (state) => { + state.deleteCount++; } }, @@ -685,6 +689,10 @@ const map = { updateMapStandData: ({ commit }, { models, type }) => { commit('updateMapStandData', { models, type }); + }, + + setDeleteCount: ({ commit }) => { + commit('setDeleteCount'); } } diff --git a/src/views/newMap/jlmapNew/index.vue b/src/views/newMap/jlmapNew/index.vue index eca3c470a..1f3781352 100644 --- a/src/views/newMap/jlmapNew/index.vue +++ b/src/views/newMap/jlmapNew/index.vue @@ -222,6 +222,8 @@ export default { break; case 'Control_Y': this.$store.dispatch('map/setRecover'); break; + case 'DELETE': this.$store.dispatch('map/setDeleteCount'); + break; } }, // 视图缩放事件 diff --git a/src/views/newMap/newMapdraft/mapoperate/section.vue b/src/views/newMap/newMapdraft/mapoperate/section.vue index 98706249c..95c377522 100644 --- a/src/views/newMap/newMapdraft/mapoperate/section.vue +++ b/src/views/newMap/newMapdraft/mapoperate/section.vue @@ -634,6 +634,9 @@ export default { watch: { '$store.state.menuOperation.mapDrawSelectCount': function(val) { this.deviceSelect(this.selected); + }, + '$store.state.map.deleteCount': function (val) { + this.deleteObj(); } }, mounted() { diff --git a/src/views/newMap/newMapdraft/mapoperate/signal/index.vue b/src/views/newMap/newMapdraft/mapoperate/signal/index.vue index a1974e1c1..7036e25ee 100644 --- a/src/views/newMap/newMapdraft/mapoperate/signal/index.vue +++ b/src/views/newMap/newMapdraft/mapoperate/signal/index.vue @@ -196,6 +196,9 @@ export default { watch: { selected(val, oldVal) { this.deviceSelect(val); + }, + '$store.state.map.deleteCount': function (val) { + this.deleteObj(); } }, mounted() { diff --git a/src/views/newMap/newMapdraft/mapoperate/station.vue b/src/views/newMap/newMapdraft/mapoperate/station.vue index 0c872add9..bc911fdeb 100644 --- a/src/views/newMap/newMapdraft/mapoperate/station.vue +++ b/src/views/newMap/newMapdraft/mapoperate/station.vue @@ -210,6 +210,9 @@ export default { watch: { selected: function (val) { this.deviceSelect(val); + }, + '$store.state.map.deleteCount': function (val) { + this.deleteObj(); } }, methods: { diff --git a/src/views/newMap/newMapdraft/mapoperate/stationstand.vue b/src/views/newMap/newMapdraft/mapoperate/stationstand.vue index 1c22b54ee..1ac39affa 100644 --- a/src/views/newMap/newMapdraft/mapoperate/stationstand.vue +++ b/src/views/newMap/newMapdraft/mapoperate/stationstand.vue @@ -205,6 +205,9 @@ export default { watch: { selected: function (val, oldVal) { this.deviceSelect(val); + }, + '$store.state.map.deleteCount': function (val) { + this.deleteObj(); } }, mounted() { diff --git a/src/views/newMap/newMapdraft/mapoperate/switch.vue b/src/views/newMap/newMapdraft/mapoperate/switch.vue index f47bf9377..173919bd6 100644 --- a/src/views/newMap/newMapdraft/mapoperate/switch.vue +++ b/src/views/newMap/newMapdraft/mapoperate/switch.vue @@ -180,6 +180,9 @@ export default { watch: { selected: function (val, oldVal) { this.deviceSelect(val); + }, + '$store.state.map.deleteCount': function (val) { + this.deleteObj(); } }, methods: {