From 067fdb3ca6954a09fa4f17791df46dc0ed745753 Mon Sep 17 00:00:00 2001 From: dong <58670809@qq.com> Date: Thu, 5 Jan 2023 18:43:11 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=81=E6=B3=A2=E4=B8=89=E4=BF=A1=E5=8F=B7?= =?UTF-8?q?=E6=9C=BA=E5=AE=9E=E8=AE=AD=E6=8F=90=E7=A4=BA=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../menus/menuDialog/cancleSignalGuide.vue | 11 +- .../menus/menuDialog/routeCommand.vue | 21 ++- .../menus/menuDialog/signalBlock.vue | 21 +-- .../menus/menuDialog/signalCanBlock.vue | 23 ++-- .../menus/menuDialog/signalGuide.vue | 12 +- .../menus/menuDialog/signalModel.vue | 19 ++- .../theme/ningbo_03/menus/menuSignal.vue | 126 +++++++++++++----- src/scripts/cmdPlugin/OperationHandler.js | 4 + 8 files changed, 177 insertions(+), 60 deletions(-) diff --git a/src/jmapNew/theme/ningbo_03/menus/menuDialog/cancleSignalGuide.vue b/src/jmapNew/theme/ningbo_03/menus/menuDialog/cancleSignalGuide.vue index 71867af7f..74b5b8f72 100644 --- a/src/jmapNew/theme/ningbo_03/menus/menuDialog/cancleSignalGuide.vue +++ b/src/jmapNew/theme/ningbo_03/menus/menuDialog/cancleSignalGuide.vue @@ -61,6 +61,7 @@ export default { allChecked: false, dialogShow: false, loading: false, + changeIgnore: false, operate: '', selectSignalCode: '' }; @@ -115,6 +116,7 @@ export default { this.operate = operate; this.dialogShow = true; this.$nextTick(function () { + this.changeIgnore = true; this.selectSignalCode = selected.code; let index = 0; this.$refs.table.setCurrentRow(this.signalList.find((el, i) => { index = i; return el.code == selected.code; })); @@ -127,6 +129,7 @@ export default { doClose() { this.loading = false; this.dialogShow = false; + this.changeIgnore = false; this.$refs.table.setCurrentRow(); this.$store.dispatch('training/emitTipFresh'); }, @@ -170,10 +173,14 @@ export default { }, handleCurrentChange(val) { if (!val) { return; } + if (this.changeIgnore) { + this.changeIgnore = false; + return; + } const step = { // code: `${val.code}`, operation: OperationEvent.Command.common.choose.operation, - val: val.code, + // val: val.code, param: { signalCode: val.code } @@ -182,8 +189,8 @@ export default { this.$store.dispatch('trainingNew/next', step).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$store.dispatch('menuOperation/setSelected', {device: val}); } + this.$store.dispatch('menuOperation/setSelected', {device: val}); }).catch(() => { this.$refs.noticeInfo.doShow(); }); diff --git a/src/jmapNew/theme/ningbo_03/menus/menuDialog/routeCommand.vue b/src/jmapNew/theme/ningbo_03/menus/menuDialog/routeCommand.vue index 944b77dab..bd50a080e 100644 --- a/src/jmapNew/theme/ningbo_03/menus/menuDialog/routeCommand.vue +++ b/src/jmapNew/theme/ningbo_03/menus/menuDialog/routeCommand.vue @@ -31,7 +31,7 @@ 显示复制路径 - + @@ -208,6 +208,7 @@ export default { checked: false, unlockType: 'auto', forbidRoute: false, + changeIgnore: false, route: null }; }, @@ -259,6 +260,9 @@ export default { domIdUnlockType() { return this.dialogShow ? OperationEvent.Command.commandNingBo3.Signal_command_unlockType.domId : ''; }, + domIdRouteTabs() { + return this.dialogShow ? OperationEvent.Command.commandNingBo3.Signal_command_routeTabs.domId : ''; + }, title() { return '进路命令'; } @@ -271,6 +275,15 @@ export default { } }, methods: { + handleClick() { + const step = { + operation: OperationEvent.Command.commandNingBo3.Signal_command_routeTabs.operation, + param: { + activeName: this.activeName + } + }; + this.$store.dispatch('trainingNew/next', step); + }, changeUnlockType() { const step = { operation: OperationEvent.Command.commandNingBo3.Signal_command_unlockType.operation, @@ -291,6 +304,7 @@ export default { this.operate = operate; this.dialogShow = true; this.$nextTick(function () { + this.changeIgnore = true; let index = 0; const signal = this.signalList.find((el, i) => { index = i; return el.code == selected.code; }); this.$refs.table.setCurrentRow(signal); @@ -314,6 +328,7 @@ export default { this.$refs.singleTable4.setCurrentRow(); this.activeName = 'first'; this.unlockType = 'auto'; + this.changeIgnore = false; this.$refs.table.bodyWrapper.scrollTop = 0; }, // 始端信号机点击 @@ -326,6 +341,10 @@ export default { this.tempData.push(item); } }); + if (this.changeIgnore) { + this.changeIgnore = false; + return; + } const step = { operation: OperationEvent.Command.commandNingBo3.Signal_command_startSignal.operation, param: { diff --git a/src/jmapNew/theme/ningbo_03/menus/menuDialog/signalBlock.vue b/src/jmapNew/theme/ningbo_03/menus/menuDialog/signalBlock.vue index b229412e4..049cd8ce4 100644 --- a/src/jmapNew/theme/ningbo_03/menus/menuDialog/signalBlock.vue +++ b/src/jmapNew/theme/ningbo_03/menus/menuDialog/signalBlock.vue @@ -161,7 +161,7 @@ export default { this.currentSelect = this.$store.getters['map/getDeviceByCode'](this.initSelect.code); this.dialogShow = true; this.$nextTick(function () { - this.changeIgnore = sure; + this.changeIgnore = true; this.$refs.table.setCurrentRow(sure ? this.tempList.find(el => el.code == this.initSelect.code) : null); this.$store.dispatch('training/emitTipFresh'); }); @@ -178,7 +178,7 @@ export default { this.currentSelect = this.$store.getters['map/getDeviceByCode'](selected.code); this.dialogShow = true; this.$nextTick(function () { - this.changeIgnore = sure; + this.changeIgnore = true; let index = 0; this.$refs.table.setCurrentRow(this.tempList.find((el, i) => { index = i; return el.code == selected.code; })); setTimeout(()=> { @@ -191,8 +191,9 @@ export default { doClose() { this.loading = false; this.dialogShow = false; - this.sure && (this.currentSelect = null); - this.sure && this.$refs.table.setCurrentRow(); + this.changeIgnore = false; + this.currentSelect = null; + this.$refs.table.setCurrentRow(); this.sure && this.$root.$emit('iniCacheMap', this.cmdType.value, Object.fromEntries(Object.entries(this.getCacheMap()).filter(el => el[1].done == 'done')) ); @@ -233,21 +234,25 @@ export default { handleCurrentChange(val) { if (!val) { return; } this.currentSelect = this.$store.getters['map/getDeviceByCode'](val.code); + this.sure || this.$emit('initSelect', this.currentSelect); this.$emit('updateDone'); - if (this.changeIgnore) { return; } + if (this.changeIgnore) { + this.changeIgnore = false; + return; + } const step = { // code: val.code, operation: OperationEvent.Command.common.choose.operation, - val: val.code + param: { + val: val.code + } }; - this.changeIgnore = false; this.$emit('updateDone'); this.$store.dispatch('trainingNew/next', step).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.sure || this.$emit('initSelect', this.currentSelect); } }).catch(() => { this.$refs.noticeInfo.doShow(); diff --git a/src/jmapNew/theme/ningbo_03/menus/menuDialog/signalCanBlock.vue b/src/jmapNew/theme/ningbo_03/menus/menuDialog/signalCanBlock.vue index 74151bf75..32982a278 100644 --- a/src/jmapNew/theme/ningbo_03/menus/menuDialog/signalCanBlock.vue +++ b/src/jmapNew/theme/ningbo_03/menus/menuDialog/signalCanBlock.vue @@ -151,7 +151,7 @@ export default { this.currentSelect = this.$store.getters['map/getDeviceByCode'](this.initSelect.code); this.dialogShow = true; this.$nextTick(function () { - this.changeIgnore = sure; + this.changeIgnore = true; this.$refs.table.setCurrentRow(sure ? this.tempList.find(el => el.code == this.initSelect.code) : null); this.$store.dispatch('training/emitTipFresh'); }); @@ -163,7 +163,7 @@ export default { this.currentSelect = this.$store.getters['map/getDeviceByCode'](selected.code); this.dialogShow = true; this.$nextTick(function () { - this.changeIgnore = sure; + this.changeIgnore = true; let index = 0; this.$refs.table.setCurrentRow(this.tempList.find((el, i) => { index = i; return el.code == selected.code; })); setTimeout(()=> { @@ -176,8 +176,9 @@ export default { doClose() { this.loading = false; this.dialogShow = false; - this.sure && (this.currentSelect = null); - this.sure && this.$refs.table.setCurrentRow(); + this.currentSelect = null; + this.changeIgnore = false; + this.$refs.table.setCurrentRow(); this.sure && this.$root.$emit('iniCacheMap', this.cmdType.value, Object.fromEntries(Object.entries(this.getCacheMap()).filter(el => el[1].done == 'done')) ); @@ -190,7 +191,7 @@ export default { const isOK = this.command && (!this.sure || this.sure && cacheMap[this.currentSelect.code]); const operate = { cmdType: this.sure && isOK ? this.cmdType : null, - operation: isClose ? OperationEvent.Signal.lock.confirm.operation : OperationEvent.Signal.unlock.confirm.operation, + operation: isClose ? OperationEvent.Command.common.confirm.operation : OperationEvent.Command.common.apply.operation, over: this.sure, param: {signalCode: this.currentSelect.code} }; @@ -218,21 +219,25 @@ export default { handleCurrentChange(val) { if (!val) { return; } this.currentSelect = this.$store.getters['map/getDeviceByCode'](val.code); + this.sure || this.$emit('initSelect', this.currentSelect); this.$emit('updateDone'); - if (this.changeIgnore) { return; } + if (this.changeIgnore) { + this.changeIgnore = false; + return; + } const step = { // code: val.code, operation: OperationEvent.Command.common.choose.operation, - val: val.code + param: { + val: val.code + } }; - this.changeIgnore = false; this.$emit('updateDone'); this.$store.dispatch('trainingNew/next', step).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.sure || this.$emit('initSelect', this.currentSelect); } }).catch(_ => { this.$refs.noticeInfo.doShow(); diff --git a/src/jmapNew/theme/ningbo_03/menus/menuDialog/signalGuide.vue b/src/jmapNew/theme/ningbo_03/menus/menuDialog/signalGuide.vue index 86a964c48..48587c0f4 100644 --- a/src/jmapNew/theme/ningbo_03/menus/menuDialog/signalGuide.vue +++ b/src/jmapNew/theme/ningbo_03/menus/menuDialog/signalGuide.vue @@ -156,7 +156,7 @@ export default { this.currentSelect = this.$store.getters['map/getDeviceByCode'](this.initSelect.code); this.dialogShow = true; this.$nextTick(function () { - this.changeIgnore = sure; + this.changeIgnore = true; this.$refs.table.setCurrentRow(sure ? this.tempList.find(el => el.code == this.initSelect.code) : null); this.$store.dispatch('training/emitTipFresh'); }); @@ -168,7 +168,7 @@ export default { this.currentSelect = this.$store.getters['map/getDeviceByCode'](selected.code); this.dialogShow = true; this.$nextTick(function () { - // this.changeIgnore = sure; + this.changeIgnore = true; let index = 0; this.$refs.table.setCurrentRow(this.tempList.find((el, i) => { index = i; return el.code == selected.code; })); setTimeout(()=> { @@ -223,8 +223,12 @@ export default { handleCurrentChange(val) { if (!val) { return; } this.currentSelect = this.$store.getters['map/getDeviceByCode'](val.code); + this.sure || this.$emit('initSelect', this.currentSelect); this.$emit('updateDone'); - if (this.changeIgnore) { return; } + if (this.changeIgnore) { + this.changeIgnore = false; + return; + } const step = { // code: val.code, @@ -234,12 +238,10 @@ export default { } }; - this.changeIgnore = false; this.$emit('updateDone'); this.$store.dispatch('trainingNew/next', step).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.sure || this.$emit('initSelect', this.currentSelect); } }).catch(_ => { this.$refs.noticeInfo.doShow(); diff --git a/src/jmapNew/theme/ningbo_03/menus/menuDialog/signalModel.vue b/src/jmapNew/theme/ningbo_03/menus/menuDialog/signalModel.vue index 432cce3ce..467b061a9 100644 --- a/src/jmapNew/theme/ningbo_03/menus/menuDialog/signalModel.vue +++ b/src/jmapNew/theme/ningbo_03/menus/menuDialog/signalModel.vue @@ -64,7 +64,8 @@ export default { operate: null, allChecked: false, dialogShow: false, - loading: false + loading: false, + changeIgnore: false }; }, computed: { @@ -121,17 +122,23 @@ export default { methods: { handleCurrentChange(val) { if (!val) { return; } + this.$store.dispatch('menuOperation/setSelected', {device: val}); + if (this.changeIgnore) { + this.changeIgnore = false; + return; + } const step = { // code: val.code, operation: OperationEvent.Command.common.choose.operation, - val: val.code + param: { + val: val.code + } }; this.$store.dispatch('trainingNew/next', step).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$store.dispatch('menuOperation/setSelected', {device: val}); - this.$refs.table.setCurrentRow(this.selected); + // this.$refs.table.setCurrentRow(this.selected); } }).catch(() => { console.log(); @@ -150,19 +157,21 @@ export default { this.operate = operate; this.dialogShow = true; this.$nextTick(function () { + this.changeIgnore = true; let index = 0; const signal = this.filterSignalList.find((el, i) => { index = i; return el.code == selected.code; }); this.$refs.table.setCurrentRow(signal); setTimeout(()=> { this.$refs.table.bodyWrapper.scrollTop = index * 20; }, 200); - this.handleCurrentChange(signal); + // this.handleCurrentChange(signal); this.$store.dispatch('training/emitTipFresh'); }); }, doClose() { this.loading = false; this.dialogShow = false; + this.changeIgnore = false; this.$refs.table.setCurrentRow(); this.$store.dispatch('training/emitTipFresh'); }, diff --git a/src/jmapNew/theme/ningbo_03/menus/menuSignal.vue b/src/jmapNew/theme/ningbo_03/menus/menuSignal.vue index 29408473d..927da566c 100644 --- a/src/jmapNew/theme/ningbo_03/menus/menuSignal.vue +++ b/src/jmapNew/theme/ningbo_03/menus/menuSignal.vue @@ -86,14 +86,17 @@ export default { children: [ { label: '初始化', + operate: OperationEvent.Signal.guide.initMenu, handler: this.handlerInitGuide }, { label: '确定/取消', + operate: OperationEvent.Signal.guide.menu, handler: this.handlerGuide }, { label: '清除', + operate: OperationEvent.Signal.cancelGuide.menu, handler: this.handlerCancelGuide } ] @@ -104,10 +107,12 @@ export default { children: [ { label: '初始化', + operate: OperationEvent.Signal.lock.initMenu, handler: this.handlerInitAllowLock }, { label: '确定/取消', + operate: OperationEvent.Signal.lock.menu, handler: this.handlerAllowLock } ] @@ -117,6 +122,7 @@ export default { children: [ { label: '命令', + operate: OperationEvent.Signal.arrangementRoute.menu, handler: this.handlerRouteCommand }, { @@ -136,6 +142,7 @@ export default { }, { label: '信号指示模式', + operate: OperationEvent.Signal.reopenSignal.menu, handler: this.handlerSignalModel, cmdType: '' }, @@ -144,10 +151,12 @@ export default { children: [ { label: '初始化', + operate: OperationEvent.Command.commandNingBo3.line_signal_block_init, handler: this.handlerInitBlock }, { label: '确认/取消', + operate: OperationEvent.Command.commandNingBo3.line_signal_block_sure, handler: this.handlerBlock } ] @@ -157,16 +166,19 @@ export default { children: [ { label: '初始化', + operate: OperationEvent.Command.commandNingBo3.line_signal_unblock_init, handler: this.handlerInitUnblock }, { label: '确认/取消', + operate: OperationEvent.Command.commandNingBo3.line_signal_unblock_sure, handler: this.handlerUnblock } ] }, { label: '显示', + operate: OperationEvent.Command.commandNingBo3.line_signal_detail, handler: this.handlerDetail } ], @@ -199,12 +211,6 @@ export default { watch: { '$store.state.menuOperation.menuCount': function (val) { if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Signal) && !this.buttonOperation) { - const operate = { - code: `${this.selected.code}`, - userOperationType: 'rightClick', - operation: OperationEvent.Command.commandRight.right.operation - }; - this.$store.dispatch('trainingNew/next', operate); this.doShow(this.$store.state.menuOperation.menuPosition); } else { this.doClose(); @@ -266,41 +272,101 @@ export default { undeveloped() { }, - handlerInitGuide() { - this.$refs.signalGuide.rightClickShow(OperationEvent.Signal.guide.initMenu, false, this.selected); + handlerInitGuide(item) { + const operate = { + code: this.selected.code, + operation: item.operate.operation + }; + this.$store.dispatch('trainingNew/next', operate); + this.$refs.signalGuide.rightClickShow(item.operate, false, this.selected); }, - handlerGuide() { - this.$refs.signalGuide.rightClickShow(OperationEvent.Signal.guide.menu, true, this.selected); + handlerGuide(item) { + const operate = { + code: this.selected.code, + operation: item.operate.operation + }; + this.$store.dispatch('trainingNew/next', operate); + this.$refs.signalGuide.rightClickShow(item.operate, true, this.selected); }, - handlerCancelGuide() { - this.$refs.cancelSignal.rightClickShow(OperationEvent.Signal.cancelGuide.menu, this.selected); + handlerCancelGuide(item) { + const operate = { + code: this.selected.code, + operation: item.operate.operation + }; + this.$store.dispatch('trainingNew/next', operate); + this.$refs.cancelSignal.rightClickShow(item.operate, this.selected); }, - handlerInitAllowLock() { - this.$refs.signalCanBlock.rightClickShow(OperationEvent.Signal.lock.initMenu, false, this.selected); + handlerInitAllowLock(item) { + const operate = { + code: this.selected.code, + operation: item.operate.operation + }; + this.$store.dispatch('trainingNew/next', operate); + this.$refs.signalCanBlock.rightClickShow(item.operate, false, this.selected); }, - handlerAllowLock() { - this.$refs.signalCanBlock.rightClickShow(OperationEvent.Signal.lock.menu, true, this.selected); + handlerAllowLock(item) { + const operate = { + code: this.selected.code, + operation: item.operate.operation + }; + this.$store.dispatch('trainingNew/next', operate); + this.$refs.signalCanBlock.rightClickShow(item.operate, true, this.selected); }, - handlerRouteCommand() { - this.$refs.routeCommand.rightClickShow(OperationEvent.Signal.arrangementRoute.menu, this.selected); + handlerRouteCommand(item) { + const operate = { + code: this.selected.code, + operation: item.operate.operation + }; + this.$store.dispatch('trainingNew/next', operate); + this.$refs.routeCommand.rightClickShow(item.operate, this.selected); }, - handlerSignalModel() { - this.$refs.signalModel.rightClickShow('', this.selected); + handlerSignalModel(item) { + const operate = { + code: this.selected.code, + operation: item.operate.operation + }; + this.$store.dispatch('trainingNew/next', operate); + this.$refs.signalModel.rightClickShow(item.operate, this.selected); }, - handlerInitBlock() { - this.$refs.signalBlock.rightClickShow(OperationEvent.Command.commandNingBo3.line_signal_block_init, false, this.selected); + handlerInitBlock(item) { + const operate = { + code: this.selected.code, + operation: item.operate.operation + }; + this.$store.dispatch('trainingNew/next', operate); + this.$refs.signalBlock.rightClickShow(item.operate, false, this.selected); }, - handlerBlock() { - this.$refs.signalBlock.rightClickShow(OperationEvent.Command.commandNingBo3.line_signal_block_sure, true, this.selected); + handlerBlock(item) { + const operate = { + code: this.selected.code, + operation: item.operate.operation + }; + this.$store.dispatch('trainingNew/next', operate); + this.$refs.signalBlock.rightClickShow(item.operate, true, this.selected); }, - handlerInitUnblock() { - this.$refs.signalBlock.rightClickShow(OperationEvent.Command.commandNingBo3.line_signal_unblock_init, false, this.selected); + handlerInitUnblock(item) { + const operate = { + code: this.selected.code, + operation: item.operate.operation + }; + this.$store.dispatch('trainingNew/next', operate); + this.$refs.signalBlock.rightClickShow(item.operate, false, this.selected); }, - handlerUnblock() { - this.$refs.signalBlock.rightClickShow(OperationEvent.Command.commandNingBo3.line_signal_unblock_sure, true, this.selected); + handlerUnblock(item) { + const operate = { + code: this.selected.code, + operation: item.operate.operation + }; + this.$store.dispatch('trainingNew/next', operate); + this.$refs.signalBlock.rightClickShow(item.operate, true, this.selected); }, - handlerDetail() { - this.$refs.signalDetail.rightClickShow(OperationEvent.Command.commandNingBo3.line_signal_detail, this.selected); + handlerDetail(item) { + const operate = { + code: this.selected.code, + operation: item.operate.operation + }; + this.$store.dispatch('trainingNew/next', operate); + this.$refs.signalDetail.rightClickShow(item.operate, this.selected); } } }; diff --git a/src/scripts/cmdPlugin/OperationHandler.js b/src/scripts/cmdPlugin/OperationHandler.js index 249d5d21d..d95118909 100644 --- a/src/scripts/cmdPlugin/OperationHandler.js +++ b/src/scripts/cmdPlugin/OperationHandler.js @@ -723,6 +723,10 @@ export const OperationEvent = { Signal_command_unlockType: { operation: '00c058', domId: '_Tips-ningBo-Signal_command_unlockType{BOTTOM}' + }, + Signal_command_routeTabs: { + operation: '00c059', + domId: '_Tips-ningBo-Signal_command_routeTabs{BOTTOM}' } }, commandRight: {