From b7ea10b459ee1d4c9bfa22e0dc9887e77a1198a9 Mon Sep 17 00:00:00 2001 From: lVAL Date: Fri, 19 Feb 2021 10:42:58 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AE=81=E6=B3=A23=E5=8F=B7?= =?UTF-8?q?=E7=BA=BF=20=E6=93=8D=E4=BD=9C=E4=B8=AD=E7=9A=84=E9=83=A8?= =?UTF-8?q?=E5=88=86bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../menuDialog/initSectionLimitSpeed.vue | 34 ++++++++------- .../menus/menuDialog/sectionLimitSpeed.vue | 4 +- .../menus/menuDialog/switchCommand.vue | 42 +++++++++++-------- 3 files changed, 46 insertions(+), 34 deletions(-) diff --git a/src/jmapNew/theme/ningbo_03/menus/menuDialog/initSectionLimitSpeed.vue b/src/jmapNew/theme/ningbo_03/menus/menuDialog/initSectionLimitSpeed.vue index 2475d3558..9fce8ae63 100644 --- a/src/jmapNew/theme/ningbo_03/menus/menuDialog/initSectionLimitSpeed.vue +++ b/src/jmapNew/theme/ningbo_03/menus/menuDialog/initSectionLimitSpeed.vue @@ -37,10 +37,10 @@ - 确定(O) + 确定(O) - 应用(A) + 应用(A) 关闭(C) @@ -176,13 +176,15 @@ export default { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/setSelected', {device: val}); - const sectionEle = this.$store.getters['map/getDeviceByCode'](val.code); - this.speedLimitValue = sectionEle.speedUpLimit; - if (this.speedLimitValue > 0) { - this.$refs.table2.setCurrentRow(this.limitList[this.speedLimitValue / 5 - 1]); - } else { - this.$refs.table2.setCurrentRow(); - } + // const sectionEle = this.$store.getters['map/getDeviceByCode'](val.code); + // this.speedLimitValue = sectionEle.speedUpLimit; + // if (this.speedLimitValue > 0) { + // this.$refs.table2.setCurrentRow(this.limitList[this.speedLimitValue / 5 - 1]); + // } else { + // this.$refs.table2.setCurrentRow(); + // } + this.$refs.table2.setCurrentRow() + this.speedLimitValue = 0; } }).catch(() => { this.$refs.noticeInfo.doShow(); @@ -192,15 +194,17 @@ export default { if (!val) { return; } this.initEle = null; this.commandEleCode = null; - const step = { - operation: OperationEvent.Command.common.choose1.operation, - val: val.value, - param: {speedLimitValue: val.value} - }; + + const step = { + operation: OperationEvent.Command.common.choose1.operation, + val: val.value, + param: {speedLimitValue: val.value} + }; + this.$store.dispatch('training/nextNew', step).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.speedLimitValue = val.value; + this.speedLimitValue = val.value; } }).catch(() => { this.$refs.noticeInfo.doShow(); diff --git a/src/jmapNew/theme/ningbo_03/menus/menuDialog/sectionLimitSpeed.vue b/src/jmapNew/theme/ningbo_03/menus/menuDialog/sectionLimitSpeed.vue index d1b1f57d5..41f1ba52e 100644 --- a/src/jmapNew/theme/ningbo_03/menus/menuDialog/sectionLimitSpeed.vue +++ b/src/jmapNew/theme/ningbo_03/menus/menuDialog/sectionLimitSpeed.vue @@ -187,8 +187,8 @@ export default { }, commit(isClose = true) { const operate = { - // cmdType: this.command ? CMD.Section.CMD_SECTION_SET_LIMIT_SPEED : CMD.Section.CMD_SECTION_CANCEL_LIMIT_SPEED, - cmdType: CMD.Section.CMD_SECTION_SET_LIMIT_SPEED, + cmdType: this.speedLimitValue ? CMD.Section.CMD_SECTION_SET_LIMIT_SPEED : CMD.Section.CMD_SECTION_CANCEL_LIMIT_SPEED, + // cmdType: CMD.Section.CMD_SECTION_SET_LIMIT_SPEED, operation: isClose ? OperationEvent.Command.common.confirm1.operation : OperationEvent.Command.common.apply1.operation, over: true, param: {sectionCode: this.selected.code, speedLimitValue:this.speedLimitValue} diff --git a/src/jmapNew/theme/ningbo_03/menus/menuDialog/switchCommand.vue b/src/jmapNew/theme/ningbo_03/menus/menuDialog/switchCommand.vue index 75d9c496e..1e42dcf3b 100644 --- a/src/jmapNew/theme/ningbo_03/menus/menuDialog/switchCommand.vue +++ b/src/jmapNew/theme/ningbo_03/menus/menuDialog/switchCommand.vue @@ -33,14 +33,14 @@
设置位置
- 定位 - 反位 + 定位 + 反位
设置预留
- 自动与预留 - 预留 - 释放 + 自动与预留 + 预留 + 释放
@@ -80,7 +80,7 @@ export default { allChecked: false, dialogShow: false, loading: false, - mode: '', + mode: 'artificial', position: '', reserved: 'reversed' @@ -110,11 +110,23 @@ export default { } }, watch: { + mode(val) { + if (val == 'auto') { + this.position = ''; + this.reserved = ''; + } + }, '$store.state.map.keyboardEnterCount': function (val) { if (this.show) { this.commit(); } - } + }, + 'selected': function(val) { + if (val) { + const section = this.$store.getters['map/getDeviceByCode'](val.code); + this.position = section && section.normalPosition? 'reverse': 'normal'; + } + } }, methods: { doShow(operate) { @@ -132,10 +144,12 @@ export default { this.$store.dispatch('training/emitTipFresh'); }, commit(isClose = false) { - const cmd = { - normal: menuOperate.Switch.locate, - reverse: menuOperate.Switch.reverse - }[this.position]; + const cmd = this.mode == 'auto' + ? menuOperate.Switch.turnout + : { + normal: menuOperate.Switch.locate, + reverse: menuOperate.Switch.reverse + }[this.position]; if (cmd) { commitOperate(cmd, {switchCode: this.selected.code}, 3).then(({valid})=>{ @@ -154,13 +168,7 @@ export default { if (!val) { return; } commitOperate(menuOperate.Switch.turnout, {code:val.code}).then(({valid, operate})=>{ if (valid) { - const switchEle = this.$store.getters['map/getDeviceByCode'](val.code); this.position = ''; - if (switchEle.normalPosition) { - this.position = 'reverse'; - } else if (switchEle.reversePosition) { - this.position = 'normal'; - } this.$store.dispatch('menuOperation/setSelected', {device: val}); } });