diff --git a/src/jmapNew/theme/components/menus/dialog/switchControl.vue b/src/jmapNew/theme/components/menus/dialog/switchControl.vue index baa4bc3f0..ee44aab57 100644 --- a/src/jmapNew/theme/components/menus/dialog/switchControl.vue +++ b/src/jmapNew/theme/components/menus/dialog/switchControl.vue @@ -137,6 +137,13 @@ export default { return ''; } }, + watch:{ + '$store.state.map.keyboardEnterCount': function (val) { + if (this.dialogShow && this.popClass === 'ningbo-01__systerm') { + this.commit(); + } + } + }, mounted() { this.$nextTick(() => { this.$store.dispatch('training/tipReload'); diff --git a/src/jmapNew/theme/components/menus/dialog/switchHookLock.vue b/src/jmapNew/theme/components/menus/dialog/switchHookLock.vue index d2d185c24..bb9a09244 100644 --- a/src/jmapNew/theme/components/menus/dialog/switchHookLock.vue +++ b/src/jmapNew/theme/components/menus/dialog/switchHookLock.vue @@ -50,8 +50,8 @@ export default { name: 'SwitchHookLock', components: { NoticeInfo - }, - props: { + }, + props: { popClass: { type: String, default() { @@ -67,18 +67,25 @@ export default { operation: '', stationName: '', switchName: '', - normal:false, - targetMemberId: '' + normal:false, + targetMemberId: '' }; }, computed: { - ...mapGetters('training', [ + ...mapGetters('training', [ 'memberList' ]), show() { return this.dialogShow && !this.$store.state.menuOperation.break; } }, + watch:{ + '$store.state.map.keyboardEnterCount': function (val) { + if (this.dialogShow && this.popClass === 'ningbo-01__systerm') { + this.commit(); + } + } + }, mounted() { this.$nextTick(() => { this.$store.dispatch('training/tipReload'); @@ -91,10 +98,10 @@ export default { this.switchName = ''; this.stationName = ''; if (selected && selected._type.toUpperCase() === 'Switch'.toUpperCase()) { - this.switchName = selected.name; + this.switchName = selected.name; const station = this.$store.getters['map/getDeviceByCode'](selected.stationCode); if (station) { - this.targetMemberId = this.memberList.find(ele => ele.deviceCode == station.code).id; + this.targetMemberId = this.memberList.find(ele => ele.deviceCode == station.code).id; this.stationName = station.name; } } @@ -116,20 +123,20 @@ export default { }, commit() { this.loading = true; - const group = this.$route.query.group; + const group = this.$route.query.group; const param = { commandType: 'Switch_Hook_Lock', targetMemberId: this.targetMemberId, params: { - switchCode: this.selected.code, - normal: this.normal - } + switchCode: this.selected.code, + normal: this.normal + } }; commitTrainSend(group, param).then(({valid, operate})=>{ - this.doClose(); + this.doClose(); }).catch((error) => { - this.$refs.noticeInfo.doShow(error.message); - this.doClose(); + this.$refs.noticeInfo.doShow(error.message); + this.doClose(); }); } } diff --git a/src/jmapNew/theme/ningbo_01/menus/dialog/switchUnLock.vue b/src/jmapNew/theme/ningbo_01/menus/dialog/switchUnLock.vue index e2342dec2..cab53a35f 100644 --- a/src/jmapNew/theme/ningbo_01/menus/dialog/switchUnLock.vue +++ b/src/jmapNew/theme/ningbo_01/menus/dialog/switchUnLock.vue @@ -28,7 +28,7 @@