From 88d4ccf8d98fa727af3ef149805d570b17b68001 Mon Sep 17 00:00:00 2001 From: joylink_cuiweidong <364937672@qq.com> Date: Wed, 8 Jan 2020 17:42:28 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8C=97=E4=BA=AC=E4=B8=80=E5=8F=B7=E7=BA=BF?= =?UTF-8?q?=E6=96=B0=E7=89=88=20=E5=8C=BA=E6=AE=B5=E9=81=93=E5=B2=94?= =?UTF-8?q?=E6=8C=87=E4=BB=A4=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../menus/dialog/routeHandControl.vue | 497 +++++++++--------- .../theme/beijing_01/menus/menuSection.vue | 131 ++--- .../theme/beijing_01/menus/menuSwitch.vue | 139 ++--- 3 files changed, 399 insertions(+), 368 deletions(-) diff --git a/src/jmapNew/theme/beijing_01/menus/dialog/routeHandControl.vue b/src/jmapNew/theme/beijing_01/menus/dialog/routeHandControl.vue index fbbaaae52..1f4b8e3de 100644 --- a/src/jmapNew/theme/beijing_01/menus/dialog/routeHandControl.vue +++ b/src/jmapNew/theme/beijing_01/menus/dialog/routeHandControl.vue @@ -80,263 +80,270 @@ import { MapDeviceType, OperationEvent, getDomIdByOperation } from '@/scripts/Co import ConfirmControl from './childDialog/confirmControl'; import { mouseCancelState } from '../utils/menuItemStatus'; import NoticeInfo from './childDialog/childDialog/noticeInfo'; +import CMD from '@/scripts/cmdPlugin/CommandEnum'; export default { - name: 'RouteHandControl', - components: { - ConfirmControl, - NoticeInfo - }, - data() { - return { - dialogShow: false, - loading: false, - selected: null, - tempData: [], - operation: null, - selection: [], - stationName: '', - signalName: '', - allSelect: false - }; - }, - computed: { - ...mapGetters('map', [ - 'signalList' - ]), - show() { - return this.dialogShow && !this.$store.state.menuOperation.break; - }, - domIdCancel() { - return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : ''; - }, - domIdChoose() { - if (this.dialogShow) { - if (this.operation == OperationEvent.Signal.humanControl.menu.operation) { - return OperationEvent.Signal.humanControl.choose.domId; - } else if (this.operation == OperationEvent.Signal.atsAutoControl.menu.operation) { - return OperationEvent.Signal.atsAutoControl.choose.domId; - } - } - }, - domIdConfirm() { - return this.dialogShow ? getDomIdByOperation(this.operation) : ''; - }, - title() { - if (this.operation == OperationEvent.Signal.humanControl.menu.operation) { - return '进路交人工控'; - } else if (this.operation == OperationEvent.Signal.atsAutoControl.menu.operation) { - return '进路交自动控'; - } - }, - commitDisabled() { - let disabled = true; - if (this.selection && this.selection.length) { - disabled = false; - } + name: 'RouteHandControl', + components: { + ConfirmControl, + NoticeInfo + }, + data() { + return { + dialogShow: false, + loading: false, + selected: null, + tempData: [], + operation: null, + selection: [], + stationName: '', + signalName: '', + allSelect: false + }; + }, + computed: { + ...mapGetters('map', [ + 'signalList' + ]), + show() { + return this.dialogShow && !this.$store.state.menuOperation.break; + }, + domIdCancel() { + return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : ''; + }, + domIdChoose() { + if (this.dialogShow) { + if (this.operation == OperationEvent.Signal.humanControl.menu.operation) { + return OperationEvent.Signal.humanControl.choose.domId; + } else if (this.operation == OperationEvent.Signal.atsAutoControl.menu.operation) { + return OperationEvent.Signal.atsAutoControl.choose.domId; + } else { + return ''; + } + } + }, + domIdConfirm() { + return this.dialogShow ? getDomIdByOperation(this.operation) : ''; + }, + title() { + if (this.operation == OperationEvent.Signal.humanControl.menu.operation) { + return '进路交人工控'; + } else if (this.operation == OperationEvent.Signal.atsAutoControl.menu.operation) { + return '进路交自动控'; + } else { + return ''; + } + }, + commitDisabled() { + let disabled = true; + if (this.selection && this.selection.length) { + disabled = false; + } - return disabled; - } - }, - watch: { - // 深度数据状态 - tempData: { - handler(val, oldVal) { - this.checkTableDataSelction(val); - }, - deep: true - } - }, - mounted() { - this.$nextTick(() => { - this.$store.dispatch('training/tipReload'); - }); - }, - methods: { - doShow(operate, selected, tempData) { - this.selected = selected; - // 如果不是断点激活,而是第一次显示则初始化 - if (!this.dialogShow) { - this.signalName = ''; - this.stationName = ''; - if (selected && selected._type.toUpperCase() === 'Signal'.toUpperCase()) { - this.signalName = selected.name; - const station = this.$store.getters['map/getDeviceByCode'](selected.stationCode); - if (station) { - this.stationName = station.name; - } - } + return disabled; + } + }, + watch: { + // 深度数据状态 + tempData: { + handler(val, oldVal) { + this.checkTableDataSelction(val); + }, + deep: true + } + }, + mounted() { + this.$nextTick(() => { + this.$store.dispatch('training/tipReload'); + }); + }, + methods: { + doShow(operate, selected, tempData) { + this.selected = selected; + // 如果不是断点激活,而是第一次显示则初始化 + if (!this.dialogShow) { + this.signalName = ''; + this.stationName = ''; + if (selected && selected._type.toUpperCase() === 'Signal'.toUpperCase()) { + this.signalName = selected.name; + const station = this.$store.getters['map/getDeviceByCode'](selected.stationCode); + if (station) { + this.stationName = station.name; + } + } - if (tempData && tempData.length > 0) { - tempData.forEach(elem => { - elem.check = false; - elem.disabled = false; - // 设置禁用状态 - if (operate.operation === OperationEvent.Signal.humanControl.menu.operation && + if (tempData && tempData.length > 0) { + tempData.forEach(elem => { + elem.check = false; + elem.disabled = false; + // 设置禁用状态 + if (operate.operation === OperationEvent.Signal.humanControl.menu.operation && elem.controlType != '01') { - elem.disabled = true; - } if (operate.operation === OperationEvent.Signal.atsAutoControl.menu.operation && + elem.disabled = true; + } if (operate.operation === OperationEvent.Signal.atsAutoControl.menu.operation && elem.controlType == '01') { - elem.disabled = true; - } - }); - } + elem.disabled = true; + } + }); + } - this.tempData = tempData || []; - this.operation = operate.operation; - } - this.dialogShow = true; - this.$nextTick(function () { - this.$store.dispatch('training/emitTipFresh'); - }); - }, - doClose() { - this.loading = false; - this.dialogShow = false; - this.$refs.tempTable.setCurrentRow(); - this.$store.dispatch('training/emitTipFresh'); - mouseCancelState(this.selected); - }, - checkTableDataSelction(data) { - const selection = []; - if (data && data.length > 0) { - data.forEach(row => { - if (row.check && !row.disabled) { - selection.push(row); - } - }); - } + this.tempData = tempData || []; + this.operation = operate.operation; + } + this.dialogShow = true; + this.$nextTick(function () { + this.$store.dispatch('training/emitTipFresh'); + }); + }, + doClose() { + this.loading = false; + this.dialogShow = false; + this.$refs.tempTable.setCurrentRow(); + this.$store.dispatch('training/emitTipFresh'); + mouseCancelState(this.selected); + }, + checkTableDataSelction(data) { + const selection = []; + if (data && data.length > 0) { + data.forEach(row => { + if (row.check && !row.disabled) { + selection.push(row); + } + }); + } - if (JSON.stringify(selection) !== JSON.stringify(this.selection)) { - this.handleChooseChange(selection); - this.selection = selection; - } - let num = 0; - this.allSelect = false; - this.tempData.forEach(item => { - if (item.check) { - num++; - if (num == this.tempData.length) { - this.allSelect = true; - } - } - }); - }, - allSelectChange() { - if (this.allSelect) { - this.tempData.forEach(item => { - if (!item.disabled) { - item.check = true; - } - }); - } else { - this.tempData.forEach(item => { - if (!item.disabled) { - item.check = false; - } - }); - } - }, - serializeCodeListWithSeparator(sep) { - const codeList = []; - if (this.selection && this.selection.length) { - this.selection.forEach(elem => { - codeList.push(elem.code); - }); - } - return codeList.join(sep); - }, - handleChooseChange(selection) { - this.selection = selection; - if (selection && selection.length) { - const operate = { - repeat: true, - type: MapDeviceType.Signal.type, - operation: '', - val: this.serializeCodeListWithSeparator('::'), - selection: selection - }; + if (JSON.stringify(selection) !== JSON.stringify(this.selection)) { + this.handleChooseChange(selection); + this.selection = selection; + } + let num = 0; + this.allSelect = false; + this.tempData.forEach(item => { + if (item.check) { + num++; + if (num == this.tempData.length) { + this.allSelect = true; + } + } + }); + }, + allSelectChange() { + if (this.allSelect) { + this.tempData.forEach(item => { + if (!item.disabled) { + item.check = true; + } + }); + } else { + this.tempData.forEach(item => { + if (!item.disabled) { + item.check = false; + } + }); + } + }, + serializeCodeListWithSeparator(sep) { + const codeList = []; + if (this.selection && this.selection.length) { + this.selection.forEach(elem => { + codeList.push(elem.code); + }); + } + return codeList.join(sep); + }, + handleChooseChange(selection) { + this.selection = selection; + if (selection && selection.length) { + const operate = { + repeat: true, + type: MapDeviceType.Signal.type, + operation: '', + val: this.serializeCodeListWithSeparator('::'), + selection: selection + }; - if (this.operation == OperationEvent.Signal.humanControl.menu.operation) { - /** 进路交人工控*/ - operate.operation = OperationEvent.Signal.humanControl.choose.operation; - } else if (this.operation == OperationEvent.Signal.atsAutoControl.menu.operation) { - /** 进路交自动控*/ - operate.operation = OperationEvent.Signal.atsAutoControl.choose.operation; - } + if (this.operation == OperationEvent.Signal.humanControl.menu.operation) { + /** 进路交人工控*/ + operate.operation = OperationEvent.Signal.humanControl.choose.operation; + } else if (this.operation == OperationEvent.Signal.atsAutoControl.menu.operation) { + /** 进路交自动控*/ + operate.operation = OperationEvent.Signal.atsAutoControl.choose.operation; + } - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - } - }); - } else if (!selection) { - this.$messageBox(`请选择一条数据`); - } - }, - commit() { - if (this.operation == OperationEvent.Signal.humanControl.menu.operation) { - /** 进路交人工控*/ - this.humanControl(); - } else if (this.operation == OperationEvent.Signal.atsAutoControl.menu.operation) { - /** 进路交自动控*/ - this.atsAutoControl(); - } - }, - // 进路交人工控 - humanControl() { - const operate = { - send: true, - type: MapDeviceType.Signal.type, - operation: OperationEvent.Signal.humanControl.menu.operation - }; + this.$store.dispatch('training/next', operate).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + } + }); + } else if (!selection) { + this.$messageBox(`请选择一条数据`); + } + }, + commit() { + if (this.operation == OperationEvent.Signal.humanControl.menu.operation) { + /** 进路交人工控*/ + this.humanControl(); + } else if (this.operation == OperationEvent.Signal.atsAutoControl.menu.operation) { + /** 进路交自动控*/ + this.atsAutoControl(); + } + }, + // 进路交人工控 + humanControl() { + const operate = { + over: true, + // type: MapDeviceType.Signal.type, + operation: OperationEvent.Signal.humanControl.menu.operation, + cmdType: CMD.Signal.CMD_SIGNAL_CLOSE_AUTO_SETTING + }; - this.loading = true; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - this.loading = false; - if (valid) { - this.doClose(); - } - }).catch(error => { - this.loading = false; - this.doClose(); - this.$refs.noticeInfo.doShow(operate); - }); - }, - // 进路交自动控 - atsAutoControl() { - const operate = { - send: true, - type: MapDeviceType.Signal.type, - operation: OperationEvent.Signal.atsAutoControl.menu.operation - }; + this.loading = true; + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { + this.loading = false; + if (valid) { + this.doClose(); + } + }).catch(() => { + this.loading = false; + this.doClose(); + this.$refs.noticeInfo.doShow(operate); + }); + }, + // 进路交自动控 + atsAutoControl() { + const operate = { + over: true, + // type: MapDeviceType.Signal.type, + operation: OperationEvent.Signal.atsAutoControl.menu.operation, + cmdType: CMD.Signal.CMD_SIGNAL_OPEN_AUTO_SETTING + }; - this.loading = true; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - this.loading = false; - if (valid) { - this.doClose(); - } - }).catch(error => { - this.loading = false; - this.doClose(); - this.$refs.noticeInfo.doShow(operate); - }); - }, - cancel() { - const operate = { - type: MapDeviceType.Signal.type, - operation: OperationEvent.Command.cancel.menu.operation - }; + this.loading = true; + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { + this.loading = false; + if (valid) { + this.doClose(); + } + }).catch(() => { + this.loading = false; + this.doClose(); + this.$refs.noticeInfo.doShow(operate); + }); + }, + cancel() { + const operate = { + type: MapDeviceType.Signal.type, + operation: OperationEvent.Command.cancel.menu.operation + }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.doClose(); - } - }).catch(error => { - this.doClose(); - }); - } - } + this.$store.dispatch('training/next', operate).then(({ valid }) => { + if (valid) { + this.doClose(); + } + }).catch(() => { + this.doClose(); + }); + } + } }; diff --git a/src/jmapNew/theme/beijing_01/menus/menuSection.vue b/src/jmapNew/theme/beijing_01/menus/menuSection.vue index d6fe45e17..fb19cf898 100644 --- a/src/jmapNew/theme/beijing_01/menus/menuSection.vue +++ b/src/jmapNew/theme/beijing_01/menus/menuSection.vue @@ -145,11 +145,11 @@ export default { } ], menuForce: [ - { - label: '设置计轴失效', - handler: this.alxeFailure - // disabledCallback: MenuDisabledState.Section.alxeFailure - } + // { + // label: '设置计轴失效', + // handler: this.alxeFailure + // // disabledCallback: MenuDisabledState.Section.alxeFailure + // } ] }; }, @@ -199,39 +199,40 @@ export default { this.$refs.popMenu.close(); } }, - // 设置计轴失效 - alxeFailure() { - const operate = { - start: true, - send: true, - code: this.selected.code, - type: MapDeviceType.Section.type, - label: MapDeviceType.Section.label, - operation: OperationEvent.Section.alxeFailure.menu.operation - }; + // // 设置计轴失效 + // alxeFailure() { + // const operate = { + // start: true, + // code: this.selected.code, + // operation: OperationEvent.Section.alxeFailure.menu.operation, + // param: { + // Section_Code: `${this.selected.code}` + // } + // }; - mouseCancelState(this.selected); - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - } else { - this.$refs.noticeInfo.doShow(operate); - } - }).catch(() => { - this.$refs.noticeInfo.doShow(operate); - }); - }, + // mouseCancelState(this.selected); + // this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { + // if (valid) { + // this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + // } else { + // this.$refs.noticeInfo.doShow(operate); + // } + // }).catch(() => { + // this.$refs.noticeInfo.doShow(operate); + // }); + // }, // 故障解锁 fault() { const operate = { start: true, code: this.selected.code, - type: MapDeviceType.Section.type, - label: MapDeviceType.Section.label, - operation: OperationEvent.Section.fault.menu.operation + operation: OperationEvent.Section.fault.menu.operation, + param: { + Section_Code: `${this.selected.code}` + } }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$refs.sectionCmdControl.doShow(operate, this.selected); @@ -251,11 +252,12 @@ export default { const operate = { start: true, code: this.selected.code, - type: MapDeviceType.Section.type, - label: MapDeviceType.Section.label, - operation: OperationEvent.Section.split.menu.operation + operation: OperationEvent.Section.split.menu.operation, + param: { + Section_Code: `${this.selected.code}` + } }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$refs.sectionControl.doShow(operate, this.selected); @@ -266,11 +268,12 @@ export default { const operate = { start: true, code: this.selected.code, - type: MapDeviceType.Section.type, - label: MapDeviceType.Section.label, - operation: OperationEvent.Section.alxeEffective.menu.operation + operation: OperationEvent.Section.alxeEffective.menu.operation, + param: { + Section_Code: `${this.selected.code}` + } }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$refs.alxeEffective.doShow(operate, this.selected); @@ -282,11 +285,12 @@ export default { const operate = { start: true, code: this.selected.code, - type: MapDeviceType.Section.type, - label: MapDeviceType.Section.label, - operation: OperationEvent.Section.active.menu.operation + operation: OperationEvent.Section.active.menu.operation, + param: { + Section_Code: `${this.selected.code}` + } }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$refs.sectionControl.doShow(operate, this.selected); @@ -298,11 +302,12 @@ export default { const operate = { start: true, code: this.selected.code, - type: MapDeviceType.Section.type, - label: MapDeviceType.Section.label, - operation: OperationEvent.Section.axlePreReset.menu.operation + operation: OperationEvent.Section.axlePreReset.menu.operation, + param: { + Section_Code: `${this.selected.code}` + } }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$refs.sectionCmdControl.doShow(operate, this.selected); @@ -314,9 +319,10 @@ export default { const operate = { start: true, code: this.selected.code, - type: MapDeviceType.Section.type, - label: MapDeviceType.Section.label, - operation: OperationEvent.Section.lock.menu.operation + operation: OperationEvent.Section.lock.menu.operation, + param: { + Section_Code: `${this.selected.code}` + } }; this.$store.dispatch('training/next', operate).then(({ valid }) => { if (valid) { @@ -330,11 +336,12 @@ export default { const operate = { start: true, code: this.selected.code, - type: MapDeviceType.Section.type, - label: MapDeviceType.Section.label, - operation: OperationEvent.Section.unlock.menu.operation + operation: OperationEvent.Section.unlock.menu.operation, + param: { + Section_Code: `${this.selected.code}` + } }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$refs.sectionCmdControl.doShow(operate, this.selected); @@ -359,11 +366,12 @@ export default { const operate = { start: true, code: this.selected.code, - type: MapDeviceType.Section.type, - label: MapDeviceType.Section.label, - operation: OperationEvent.Section.setSpeed.menu.operation + operation: OperationEvent.Section.setSpeed.menu.operation, + param: { + Section_Code: `${this.selected.code}` + } }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$refs.speedLimitControl.doShow(operate, this.selected); @@ -393,11 +401,12 @@ export default { const operate = { start: true, code: this.selected.code, - type: MapDeviceType.Section.type, - label: MapDeviceType.Section.label, - operation: OperationEvent.Section.newtrain.menu.operation + operation: OperationEvent.Section.newtrain.menu.operation, + param: { + Section_Code: `${this.selected.code}` + } }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$refs.trainCreate.doShow(operate, this.selected); diff --git a/src/jmapNew/theme/beijing_01/menus/menuSwitch.vue b/src/jmapNew/theme/beijing_01/menus/menuSwitch.vue index 39b658b45..90818db2e 100644 --- a/src/jmapNew/theme/beijing_01/menus/menuSwitch.vue +++ b/src/jmapNew/theme/beijing_01/menus/menuSwitch.vue @@ -174,15 +174,16 @@ export default { setStoppage() { const operate = { start: true, - send: true, code: this.selected.code, - type: MapDeviceType.Switch.type, - label: MapDeviceType.Switch.label, - operation: OperationEvent.Switch.stoppage.menu.operation + operation: OperationEvent.Switch.stoppage.menu.operation, + cmdType: CMD.Switch.CMD_SWITCH_ADD_FAULT, + param: { + Switch_Code: `${this.selected.code}` + } }; mouseCancelState(this.selected); - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); } else { @@ -196,15 +197,16 @@ export default { cancelStoppage() { const operate = { start: true, - send: true, code: this.selected.code, - type: MapDeviceType.Switch.type, - label: MapDeviceType.Switch.label, - operation: OperationEvent.Switch.cancelStoppage.menu.operation + operation: OperationEvent.Switch.cancelStoppage.menu.operation, + cmdType: CMD.Switch.CMD_SWITCH_REMOVE_FAULT, + param: { + Switch_Code: `${this.selected.code}` + } }; mouseCancelState(this.selected); - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); } else { @@ -219,11 +221,12 @@ export default { const operate = { start: true, code: this.selected.code, - type: MapDeviceType.Switch.type, - label: MapDeviceType.Switch.label, - operation: OperationEvent.Switch.lock.menu.operation + operation: OperationEvent.Switch.lock.menu.operation, + param: { + Switch_Code: `${this.selected.code}` + } }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$refs.switchControl.doShow(operate, this.selected); @@ -235,11 +238,12 @@ export default { const operate = { start: true, code: this.selected.code, - type: MapDeviceType.Switch.type, - label: MapDeviceType.Switch.label, - operation: OperationEvent.Switch.unlock.menu.operation + operation: OperationEvent.Switch.unlock.menu.operation, + param: { + Switch_Code: `${this.selected.code}` + } }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$refs.switchCmdControl.doShow(operate, this.selected); @@ -251,11 +255,12 @@ export default { const operate = { start: true, code: this.selected.code, - type: MapDeviceType.Switch.type, - label: MapDeviceType.Switch.label, - operation: OperationEvent.Switch.block.menu.operation + operation: OperationEvent.Switch.block.menu.operation, + param: { + Switch_Code: `${this.selected.code}` + } }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$refs.switchControl.doShow(operate, this.selected); @@ -267,11 +272,12 @@ export default { const operate = { start: true, code: this.selected.code, - type: MapDeviceType.Switch.type, - label: MapDeviceType.Switch.label, - operation: OperationEvent.Switch.unblock.menu.operation + operation: OperationEvent.Switch.unblock.menu.operation, + param: { + Switch_Code: `${this.selected.code}` + } }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$refs.switchCmdControl.doShow(operate, this.selected); @@ -283,11 +289,12 @@ export default { const operate = { start: true, code: this.selected.code, - type: MapDeviceType.Switch.type, - label: MapDeviceType.Switch.label, - operation: OperationEvent.Switch.turnoutForce.menu.operation + operation: OperationEvent.Switch.turnoutForce.menu.operation, + param: { + Switch_Code: `${this.selected.code}` + } }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$refs.switchControl.doShow(operate, this.selected); @@ -299,13 +306,14 @@ export default { const operate = { start: true, code: this.selected.code, - type: MapDeviceType.Switch.type, - label: MapDeviceType.Switch.label, - operation: OperationEvent.Switch.turnout.menu.operation + operation: OperationEvent.Switch.turnout.menu.operation, + param: { + Switch_Code: `${this.selected.code}` + } }; if (operate.operation) { - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$refs.switchControl.doShow(operate, this.selected); @@ -318,11 +326,12 @@ export default { const operate = { start: true, code: this.selected.code, - type: MapDeviceType.Switch.type, - label: MapDeviceType.Switch.label, - operation: OperationEvent.Switch.fault.menu.operation + operation: OperationEvent.Switch.fault.menu.operation, + param: { + Switch_Code: `${this.selected.code}` + } }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$refs.switchCmdControl.doShow(operate, this.selected); @@ -335,11 +344,12 @@ export default { start: true, send: true, code: this.selected.code, - type: MapDeviceType.Switch.type, - label: MapDeviceType.Switch.label, - operation: OperationEvent.Switch.cancelSpeed.menu.operation + operation: OperationEvent.Switch.cancelSpeed.menu.operation, + param: { + Switch_Code: `${this.selected.code}` + } }; - this.$store.dispatch('training/next', operate).then(({ valid, response }) => { + this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => { if (valid) { const tempData = response.data; this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); @@ -353,11 +363,12 @@ export default { const operate = { start: true, code: this.selected.code, - type: MapDeviceType.Switch.type, - label: MapDeviceType.Switch.label, - operation: OperationEvent.Switch.split.menu.operation + operation: OperationEvent.Switch.split.menu.operation, + param: { + Switch_Code: `${this.selected.code}` + } }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$refs.switchControl.doShow(operate, this.selected); @@ -369,11 +380,12 @@ export default { const operate = { start: true, code: this.selected.code, - type: MapDeviceType.Switch.type, - label: MapDeviceType.Switch.label, - operation: OperationEvent.Switch.active.menu.operation + operation: OperationEvent.Switch.active.menu.operation, + param: { + Switch_Code: `${this.selected.code}` + } }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$refs.switchControl.doShow(operate, this.selected); @@ -385,11 +397,12 @@ export default { const operate = { start: true, code: this.selected.code, - type: MapDeviceType.Switch.type, - label: MapDeviceType.Switch.label, - operation: OperationEvent.Switch.axlePreReset.menu.operation + operation: OperationEvent.Switch.axlePreReset.menu.operation, + param: { + Switch_Code: `${this.selected.code}` + } }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$refs.switchCmdControl.doShow(operate, this.selected); @@ -401,11 +414,12 @@ export default { const operate = { start: true, code: this.selected.code, - type: MapDeviceType.Switch.type, - label: MapDeviceType.Switch.label, - operation: OperationEvent.Switch.setSpeed.menu.operation + operation: OperationEvent.Switch.setSpeed.menu.operation, + param: { + Switch_Code: `${this.selected.code}` + } }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$refs.speedLimitControl.doShow(operate, this.selected); @@ -417,11 +431,12 @@ export default { const operate = { start: true, code: this.selected.code, - type: MapDeviceType.Switch.type, - label: MapDeviceType.Switch.label, - operation: OperationEvent.Switch.alxeEffective.menu.operation + operation: OperationEvent.Switch.alxeEffective.menu.operation, + param: { + Switch_Code: `${this.selected.code}` + } }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$refs.alxeEffective.doShow(operate, this.selected);