From 8fb99c668d75add89b4db96e787b7e9278d2e1a7 Mon Sep 17 00:00:00 2001 From: dong <58670809@qq.com> Date: Tue, 20 Sep 2022 17:25:21 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AA=97=E5=8F=A3=E9=97=B4=E9=80=9A=E4=BF=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.vue | 10 ++++++ .../theme/components/utils/menuOperate.js | 6 ++++ .../theme/datie_02/menus/menuButtonCtc.vue | 33 +++++++++++++++---- src/scripts/cmdPlugin/OperationHandler.js | 10 ++++++ src/store/modules/trainingNew.js | 2 ++ .../bigTrainRunplanManage/stationTrack.vue | 22 +++++++++---- 6 files changed, 69 insertions(+), 14 deletions(-) diff --git a/src/App.vue b/src/App.vue index 358854bc8..a540ee62f 100644 --- a/src/App.vue +++ b/src/App.vue @@ -88,6 +88,16 @@ export default { await this.$store.dispatch('preLogout'); } }); + window.addEventListener('storage', e => { + if (e.key == 'setTrainingOperate') { + const operate = JSON.parse(e.newValue); + this.$store.dispatch('trainingNew/setTrainingOperate', operate); + } + if (e.key == 'setSceneOperate') { + const operate = JSON.parse(e.newValue); + this.$store.dispatch('trainingNew/setSceneOperate', operate); + } + }); this.$nextTick(() => { openIndexedDB(); }); diff --git a/src/jmapNew/theme/components/utils/menuOperate.js b/src/jmapNew/theme/components/utils/menuOperate.js index 13e9bb704..74342d199 100644 --- a/src/jmapNew/theme/components/utils/menuOperate.js +++ b/src/jmapNew/theme/components/utils/menuOperate.js @@ -811,6 +811,11 @@ export const menuOperate = { operation: OperationEvent.CTCCommand.modifyStationTrack.menu.operation, cmdType: CMD.CTC.CTC_STATION_DETAIL_EDIT }, + // 编辑股道信息 + editStationTrack:{ + operation: OperationEvent.CTCCommand.modifyStationTrack.edit.operation, + cmdType: CMD.CTC.CTC_STATION_DETAIL_EDIT + }, // 股道发布生效区 releaseStationTrack:{ operation: OperationEvent.CTCCommand.releaseStationTrack.menu.operation, @@ -917,6 +922,7 @@ export const menuOperate = { export function commitOperate(operate, paramList, over, fillStep = {}) { const step = { start: true, + userOperationType: operate.userOperationType || 'leftClick', operation: operate.operation, param:{} }; diff --git a/src/jmapNew/theme/datie_02/menus/menuButtonCtc.vue b/src/jmapNew/theme/datie_02/menus/menuButtonCtc.vue index 2062c62a4..9cfae3884 100644 --- a/src/jmapNew/theme/datie_02/menus/menuButtonCtc.vue +++ b/src/jmapNew/theme/datie_02/menus/menuButtonCtc.vue @@ -265,6 +265,11 @@ export default { }, '$store.state.menuOperation.menuCount': function (val) { if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Cancel)) { + const operate = { + userOperationType: 'rightClick', + operation: this.Command.commandRight.right.operation + }; + this.$store.dispatch('training/nextNew', operate); this.$refs && this.$refs.popMenu && this.$refs.popMenu.resetShowPosition(this.$store.state.menuOperation.menuPosition); } else { this.$refs && this.$refs.popMenu && this.$refs.popMenu.close(); @@ -322,12 +327,14 @@ export default { if (data.nextCmdType) { operate = { over: true, + userOperationType: 'leftClick', operation: data.operation, cmdType: data.nextCmdType, param: data.param }; } else { operate = { + userOperationType: 'leftClick', operationPre: data.operation, operation: data.operateNext }; @@ -368,6 +375,7 @@ export default { // S引导总锁按钮点击 guideLockLeftButtonDown() { const operate = { + userOperationType: 'leftClick', operation: this.Switch.guideLock.leftButton.operation }; this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { @@ -384,6 +392,7 @@ export default { // X引导总锁按钮点击 guideLockRightButtonDown() { const operate = { + userOperationType: 'leftClick', operation: this.Switch.guideLock.rightButton.operation }; this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { @@ -403,6 +412,7 @@ export default { this.clearOperate(); if (operation != this.Command.cancel.clearMbm.operation) { const operate = { + userOperationType: 'leftClick', operation: operation }; // 以下 会弹出密码框 (总人解,区故解) 铅封按钮 684 @@ -430,6 +440,7 @@ export default { // 清除按钮 const operate = { start: true, + userOperationType: 'leftClick', operation: operation }; this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { @@ -467,6 +478,7 @@ export default { handelReopenSignal(device) { const operate = { operation: this.Signal.reopenSignal.button.operation, + userOperationType: 'leftClick', code: device.code, param: { signalCode: device.code } }; @@ -475,7 +487,7 @@ export default { }, // 排列进路 arrangementRouteOperation(deviceList) { - const operate = { operation: this.Signal.arrangementRoute.button.operation }; + const operate = { userOperationType: 'leftClick', operation: this.Signal.arrangementRoute.button.operation }; if (!this.routeDataMap) { this.handleRouteDataMap(); } if (!this.checkHaveRoute(deviceList)) { // 无效的进路按钮选择 清除deviceList // this.$message.error('无效的进路按钮'); @@ -543,6 +555,7 @@ export default { const operate = { code: model.code, operation: this.$store.state.menuOperation.buttonOperation, + userOperationType: 'leftClick', param: { signalCode: model._type === 'Signal' ? model.code : model.signalCode } @@ -557,6 +570,7 @@ export default { const operate = { code: model.code, operation: this.Signal.guide.button.operation, + userOperationType: 'leftClick', param: {signalCode: model.signalCode} }; this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => { @@ -570,6 +584,7 @@ export default { const operate = { code: model.code, operation: this.$store.state.menuOperation.buttonOperation, + userOperationType: 'leftClick', val: model.code, param: { signalCode: model.code } }; @@ -582,6 +597,7 @@ export default { const operate = { code: model.code, operation: this.$store.state.menuOperation.buttonOperation, + userOperationType: 'leftClick', param: { switchCode: model.code} }; this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => { @@ -641,6 +657,7 @@ export default { const operate = { code: model.code, operation: this.Signal.guide.button.operation, + userOperationType: 'leftClick', param: {signalCode: model.signalCode} }; this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => { @@ -747,7 +764,7 @@ export default { this.$store.dispatch('menuOperation/setButtonOperation', this.operation); }, routeCommit(trainCode, duration) { - const operate = {over: true, cmdType: CMD.CTC.CTC_SET_ROUTE, param:{ tripNumber: trainCode || '', duration: duration >= 0 ? duration : null, force: false }}; + const operate = {userOperationType: 'leftClick', over: true, cmdType: CMD.CTC.CTC_SET_ROUTE, param:{ tripNumber: trainCode || '', duration: duration >= 0 ? duration : null, force: false }}; this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => { this.clearOperate(); }).catch((e) => { @@ -766,7 +783,7 @@ export default { this.routeCommit(); } } else if (this.operation === OperationEvent.MixinCommand.totalCancel.button.operation) { - const operate = {over: true, cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_ROUTE}; + const operate = {userOperationType: 'leftClick', over: true, cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_ROUTE}; this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => { this.clearOperate(); }).catch((e) => { @@ -774,7 +791,7 @@ export default { this.clearOperate(); }); } else if (this.operation === OperationEvent.Signal.reopenSignal.button.operation) { - const operate = {over: true, cmdType: CMD.Signal.CMD_SIGNAL_REOPEN_SIGNAL}; + const operate = {userOperationType: 'leftClick', over: true, cmdType: CMD.Signal.CMD_SIGNAL_REOPEN_SIGNAL}; this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => { this.clearOperate(); }).catch(() => { @@ -782,7 +799,7 @@ export default { this.clearOperate(); }); } else if (this.operation === OperationEvent.Signal.guide.button.operation) { - const operate = {over: true, cmdType: CMD.Signal.CMD_SIGNAL_ROUTE_GUIDE}; + const operate = {userOperationType: 'leftClick', over: true, cmdType: CMD.Signal.CMD_SIGNAL_ROUTE_GUIDE}; this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => { this.$store.dispatch('training/updateMapState', [{code: this.selected.code, _type: this.selected._type, hasSelected: 0}]); this.clearOperate(); @@ -792,13 +809,13 @@ export default { this.clearOperate(); }); } else if (this.operation === OperationEvent.Signal.humanTrainRoute.button.operation) { - const operate = {over: true, cmdType: CMD.Signal.CMD_SIGNAL_HUMAN_RELEASE_ROUTE}; + const operate = {userOperationType: 'leftClick', over: true, cmdType: CMD.Signal.CMD_SIGNAL_HUMAN_RELEASE_ROUTE}; this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => { }).catch((e) => { this.$refs.noticeInfo.doShow(); }).finally(() => { this.clearOperate(); }); } else if (this.switchOperation.includes(this.operation)) { - const operate = {over:true, cmdType: this.cmdType}; + const operate = {userOperationType: 'leftClick', over:true, cmdType: this.cmdType}; this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => { }).catch(() => { this.$refs.noticeInfo.doShow(); @@ -885,6 +902,7 @@ export default { const operate = { over:true, operation: noPasswordModelTypeMap[model.type].operation, + userOperationType: 'leftClick', code: model.code, param: noPasswordModelTypeMap[model.type].param, cmdType : noPasswordModelTypeMap[model.type].nextCmdType @@ -903,6 +921,7 @@ export default { } else { const operate = { operation: modelTypeMap[model.type].operation, + userOperationType: 'leftClick', code: model.code, param: modelTypeMap[model.type].param }; diff --git a/src/scripts/cmdPlugin/OperationHandler.js b/src/scripts/cmdPlugin/OperationHandler.js index 7ab5f6d75..ceef53932 100644 --- a/src/scripts/cmdPlugin/OperationHandler.js +++ b/src/scripts/cmdPlugin/OperationHandler.js @@ -668,6 +668,12 @@ export const OperationEvent = { operation: '00c03s', domId: '_Tips-ningBo-line_remoteResetFunc-sure{TOP}' } + }, + commandRight: { + right: { + operation: '00b', + domId: '' + } } }, // 站台概要表 @@ -3996,6 +4002,10 @@ export const OperationEvent = { menu: { operation: '1154', domId: '_Tips-CTC-modifyStationTrack-Menu{TOP}' + }, + edit: { + operation: '11541', + domId: '_Tips-CTC-modifyStationTrack-edit{TOP}' } }, // 出入口发布生效区 diff --git a/src/store/modules/trainingNew.js b/src/store/modules/trainingNew.js index cd430bc47..9204406bd 100644 --- a/src/store/modules/trainingNew.js +++ b/src/store/modules/trainingNew.js @@ -94,6 +94,7 @@ const training = { }, setTrainingOperate: ({commit, state}, trainingOperate) => { commit('setTrainingOperate', trainingOperate); + window.localStorage.setItem('setTrainingOperate', JSON.stringify(trainingOperate)); }, stepOrderIncrease: ({commit}) => { commit('stepOrderIncrease'); @@ -118,6 +119,7 @@ const training = { }, setSceneOperate: ({commit}, sceneOperate) => { commit('setSceneOperate', sceneOperate); + window.localStorage.setItem('setSceneOperate', JSON.stringify(sceneOperate)); }, handleCheckNewTrainingResult:({commit, state}, valid) => { const stepList = JSON.parse(state.trainingDetail.stepJson); diff --git a/src/views/bigTrainRunplanManage/stationTrack.vue b/src/views/bigTrainRunplanManage/stationTrack.vue index eb22a3467..d0c5bc2cd 100644 --- a/src/views/bigTrainRunplanManage/stationTrack.vue +++ b/src/views/bigTrainRunplanManage/stationTrack.vue @@ -8,12 +8,12 @@
- 修改 + 修改
版本号 备份 - 更新至生效区 + 更新至生效区 导入 比较
@@ -153,6 +153,7 @@ import { mapGetters } from 'vuex'; import TerminalStationList from './terminalStationList'; import TrackInformation from './trackInformation'; import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate'; +import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; export default { name:'StationTrack', components: { @@ -213,7 +214,10 @@ export default { computed:{ ...mapGetters('map', [ 'sectionList' - ]) + ]), + OperationEvent() { + return OperationEvent; + } }, methods:{ loadStation() { @@ -252,10 +256,14 @@ export default { }, modifySection() { if (this.currentRow) { - this.$refs.trackInformation.doShow({ - row:this.currentRow, - filterSectionMap:this.filterSectionMap, - stationCode:this.currentStationCode + commitOperate(menuOperate.CTC.editStationTrack, {}, 0).then(({valid})=>{ + if (valid) { + this.$refs.trackInformation.doShow({ + row:this.currentRow, + filterSectionMap:this.filterSectionMap, + stationCode:this.currentStationCode + }); + } }); } },