From 5adc99158b9e350740356a2d3ee90eb9d1612e44 Mon Sep 17 00:00:00 2001 From: fan Date: Wed, 31 Aug 2022 10:34:18 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../theme/datie_02/menus/menuButton.vue | 42 +++++++++---------- src/store/modules/training.js | 2 +- src/views/designPlatform/trainingDesign.vue | 5 +++ src/views/designPlatform/trainingPreview.vue | 6 ++- src/views/trainingManage/editDetails.vue | 10 ++--- src/views/trainingManage/editOperate.vue | 13 ++++-- 6 files changed, 45 insertions(+), 33 deletions(-) diff --git a/src/jmapNew/theme/datie_02/menus/menuButton.vue b/src/jmapNew/theme/datie_02/menus/menuButton.vue index dc73ff80b..0e2a1e75f 100644 --- a/src/jmapNew/theme/datie_02/menus/menuButton.vue +++ b/src/jmapNew/theme/datie_02/menus/menuButton.vue @@ -384,7 +384,7 @@ export default { guideLockLeftButtonDown() { const operate = { operation: this.Station.stationMasterLock.leftButton.operation, - userOperationType: 'rightClick' + userOperationType: 'leftClick' }; this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { if (valid) { @@ -401,7 +401,7 @@ export default { guideLockRightButtonDown() { const operate = { operation: this.Station.stationMasterLock.rightButton.operation, - userOperationType: 'rightClick' + userOperationType: 'leftClick' }; this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { if (valid) { @@ -482,7 +482,7 @@ export default { arrangementRouteOperation(deviceList) { const operate = { operation: this.Signal.arrangementRoute.button.operation, - userOperationType: 'rightClick' + userOperationType: 'leftClick' }; if (!this.routeDataMap) { this.handleRouteDataMap(); } @@ -540,7 +540,7 @@ export default { over: true, code: model.code, operation: this.$store.state.menuOperation.buttonOperation, - userOperationType: 'rightClick', + userOperationType: 'leftClick', cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_ROUTE, param: { signalCode: model._type === 'Signal' ? model.code : model.signalCode @@ -560,7 +560,7 @@ export default { over: true, code: model.code, operation: this.Signal.guide.button.operation, - userOperationType: 'rightClick', + userOperationType: 'leftClick', cmdType: CMD.Signal.CMD_SIGNAL_ROUTE_GUIDE, param: {signalCode: model.signalCode} }; @@ -580,7 +580,7 @@ export default { over: true, code: model.code, operation: this.$store.state.menuOperation.buttonOperation, - userOperationType: 'rightClick', + userOperationType: 'leftClick', val: model.code, cmdType: CMD.Signal.CMD_SIGNAL_HUMAN_RELEASE_ROUTE }; @@ -598,7 +598,7 @@ export default { over: true, code: model.code, operation: this.$store.state.menuOperation.buttonOperation, - userOperationType: 'rightClick', + userOperationType: 'leftClick', cmdType: this.cmdType, param: { switchCode: model.code} }; @@ -630,7 +630,7 @@ export default { over: true, code: model.code, operation: buttonOperation, - userOperationType: 'rightClick', + userOperationType: 'leftClick', cmdType: '', param: {} }; @@ -660,7 +660,7 @@ export default { over: true, code: model.code, operation: this.guideLockRightFlag ? this.Switch.guideLock.rightButton : this.Switch.guideLock.leftButton, - userOperationType: 'rightClick', + userOperationType: 'leftClick', nextCmdType: CMD.Switch.CMD_SWITCH_MASTER_LOCK, param: {signalCode: model.signalCode} }; @@ -679,7 +679,7 @@ export default { over: true, code: model.code, operation: this.$store.state.menuOperation.buttonOperation, - userOperationType: 'rightClick', + userOperationType: 'leftClick', cmdType: CMD.Section.CMD_SECTION_FAULT_UNLOCK, param: {sectionCode: model.code} }; @@ -691,7 +691,7 @@ export default { over: true, code: model.code, operation: this.$store.state.menuOperation.buttonOperation, - userOperationType: 'rightClick', + userOperationType: 'leftClick', cmdType: CMD.Signal.CMD_SIGNAL_TURN_ON, param: {signalCode: model.code} }; @@ -703,7 +703,7 @@ export default { over: true, code: model.code, operation: this.$store.state.menuOperation.buttonOperation, - userOperationType: 'rightClick', + userOperationType: 'leftClick', cmdType: CMD.Signal.CMD_SIGNAL_TURN_OFF, param: {signalCode: model.signalCode} }; @@ -784,7 +784,7 @@ export default { name:'总辅助', operation:this.CTCCommand.assistPressMainAssist.menu.operation, nextCmdType:CMD.CTC.CTC_ASSIST_PRESS_MAIN_ASSIST, - userOperationType: 'rightClick', + userOperationType: 'leftClick', param:{ labelEnum:model.labelEnum, stationCode:model.stationCode, @@ -796,7 +796,7 @@ export default { name:'改方', operation:this.CTCCommand.assistPressDownTurnDirection.menu.operation, nextCmdType:CMD.CTC.CTC_ASSIST_PRESS_DOWN_TURN_DIRECTION, - operationType: 'rightClick', + operationType: 'leftClick', param:{ labelEnum:model.labelEnum, stationCode:model.stationCode, @@ -809,7 +809,7 @@ export default { // this.CTCCommand.assistPressDownTurnDirection.menu.operation operation:this.CTCCommand.assistPressReceiveAssist.menu.operation, nextCmdType:CMD.CTC.CTC_ASSIST_PRESS_RECEIVE_ASSIST, - userOperationType: 'rightClick', + userOperationType: 'leftClick', param:{ labelEnum:model.labelEnum, stationCode:model.stationCode @@ -820,7 +820,7 @@ export default { name:'发辅助', operation:this.CTCCommand.assistPressDeliverAssist.menu.operation, nextCmdType:CMD.CTC.CTC_ASSIST_PRESS_DELIVER_ASSIST, - userOperationType: 'rightClick', + userOperationType: 'leftClick', param:{ labelEnum:model.labelEnum, stationCode:model.stationCode @@ -831,7 +831,7 @@ export default { name:'事故', operation:this.CTCCommand.assistPressAccident.menu.operation, nextCmdType:CMD.CTC.CTC_ASSIST_PRESS_ACCIDENT, - userOperationType: 'rightClick', + userOperationType: 'leftClick', param:{ labelEnum:model.labelEnum, stationCode:model.stationCode @@ -844,7 +844,7 @@ export default { 'OCCLUSION':{ operation:this.CTCCommand.assistPressBlock.menu.operation, nextCmdType:CMD.CTC.CTC_ASSIST_PRESS_BLOCK, - userOperationType: 'rightClick', + userOperationType: 'leftClick', param:{ labelEnum:model.labelEnum, stationCode:model.stationCode @@ -854,7 +854,7 @@ export default { 'RECOVERY':{ operation:this.CTCCommand.assistPressRestore.menu.operation, nextCmdType:CMD.CTC.CTC_ASSIST_PRESS_RESTORE, - userOperationType: 'rightClick', + userOperationType: 'leftClick', param:{ labelEnum:model.labelEnum, stationCode:model.stationCode @@ -868,7 +868,7 @@ export default { code: model.code, param: noPasswordModelTypeMap[model.type].param, cmdType : noPasswordModelTypeMap[model.type].nextCmdType, - userOperationType: 'rightClick' + userOperationType: 'leftClick' }; this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { if (valid) { @@ -886,7 +886,7 @@ export default { operation: modelTypeMap[model.type].operation, code: model.code, param: modelTypeMap[model.type].param, - userOperationType: 'rightClick' + userOperationType: 'leftClick' }; this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { if (valid) { diff --git a/src/store/modules/training.js b/src/store/modules/training.js index dd1de86d9..a88f80426 100644 --- a/src/store/modules/training.js +++ b/src/store/modules/training.js @@ -467,7 +467,7 @@ const training = { rtn && rtn.valid && commit('next'); } } - store.dispatch('trainingNew/setTrainingOperate'); + store.dispatch('trainingNew/setTrainingOperate', operate); resolve(rtn); } }).catch(error => { diff --git a/src/views/designPlatform/trainingDesign.vue b/src/views/designPlatform/trainingDesign.vue index 98416a282..8d8974151 100644 --- a/src/views/designPlatform/trainingDesign.vue +++ b/src/views/designPlatform/trainingDesign.vue @@ -60,6 +60,11 @@ export default { beforeDestroy() { this.$store.dispatch('socket/clearTrainingOverCount'); this.$store.dispatch('trainingNew/clearStepOverCount'); + this.$store.dispatch('trainingNew/setTrainingDetail', null); + this.$store.dispatch('trainingNew/trainingEnd'); + this.$store.dispatch('trainingNew/clearStepOrder'); + this.$store.dispatch('trainingNew/clearOperateOrder'); + this.$store.dispatch('trainingNew/changeTeachMode', ''); }, mounted() { }, diff --git a/src/views/designPlatform/trainingPreview.vue b/src/views/designPlatform/trainingPreview.vue index 9fe52ba61..b3041475e 100644 --- a/src/views/designPlatform/trainingPreview.vue +++ b/src/views/designPlatform/trainingPreview.vue @@ -71,6 +71,11 @@ export default { async beforeDestroy() { this.$store.dispatch('socket/clearTrainingOverCount'); this.$store.dispatch('trainingNew/clearStepOverCount'); + this.$store.dispatch('trainingNew/setTrainingDetail', null); + this.$store.dispatch('trainingNew/trainingEnd'); + this.$store.dispatch('trainingNew/clearStepOrder'); + this.$store.dispatch('trainingNew/clearOperateOrder'); + this.$store.dispatch('trainingNew/changeTeachMode', ''); }, mounted() { }, @@ -108,7 +113,6 @@ export default { this.$store.dispatch('trainingNew/trainingEnd'); this.$store.dispatch('socket/clearTrainingStepTip'); this.$store.dispatch('trainingNew/clearStepOrder'); - // this.$store.dispatch('trainingNew/setTrainingDetail', null); }).catch(() => { this.$message.error('结束实训失败!'); }); diff --git a/src/views/trainingManage/editDetails.vue b/src/views/trainingManage/editDetails.vue index 007551304..301bef63b 100644 --- a/src/views/trainingManage/editDetails.vue +++ b/src/views/trainingManage/editDetails.vue @@ -189,11 +189,9 @@ export default { this.tableData.push(obj); }, setOperations(data) { - this.tableData.forEach(item => { - if (item.id === data.id) { - item.operations = data.operations; - } - }); + if (data) { + this.tableData[data.index].operations = data.stepDetail.operations; + } }, handleDelete(index, row) { console.log('删除', index, row); @@ -217,7 +215,7 @@ export default { }).catch(() => { this.$message.error('调整角色失败!'); }); } // assignUsersPlayRoles - this.$emit('openEditOperate', row); + this.$emit('openEditOperate', { index: index, data: row }); this.doClose(); }, minisize() { diff --git a/src/views/trainingManage/editOperate.vue b/src/views/trainingManage/editOperate.vue index 70972637a..2065d864a 100644 --- a/src/views/trainingManage/editOperate.vue +++ b/src/views/trainingManage/editOperate.vue @@ -40,6 +40,7 @@ export default { title: '编辑操作', dialogVisible: false, dialogWidth: 500, + dataIndex: 0, stepDetail: { id: '', description: '', @@ -65,9 +66,12 @@ export default { methods: { doShow(data) { if (data) { - this.stepDetail.id = data.id; - this.stepDetail.description = data.description; - this.stepDetail.operations = data.operations || []; + // this.stepDetail = data; + // console.log(this.stepDetail, 'stepDetail'); + this.stepDetail.id = data.data.id; + this.stepDetail.description = data.data.description; + this.stepDetail.operations = data.data.operations || []; + this.dataIndex = data.index; this.dialogVisible = true; } }, @@ -78,13 +82,14 @@ export default { this.stepDetail.operations.splice(index, 1); }, backStepList() { - this.$emit('backStepList', this.stepDetail); + this.$emit('backStepList', { index: this.dataIndex, stepDetail: this.stepDetail }); this.dialogVisible = false; this.stepDetail = { id: '', description: '', operations: [] }; + this.dataIndex = 0; }, covertString(data) { // const datate = { From f72527f1777d1b2cc846f9d794c3e4b875e7559c Mon Sep 17 00:00:00 2001 From: dong <58670809@qq.com> Date: Wed, 31 Aug 2022 10:35:34 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E7=95=8C=E9=9D=A2=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/store/modules/trainingNew.js | 7 +++ src/views/designPlatform/trainingDesign.vue | 66 +++++++++++++++++++-- 2 files changed, 68 insertions(+), 5 deletions(-) diff --git a/src/store/modules/trainingNew.js b/src/store/modules/trainingNew.js index 0513234fc..99e7d75dd 100644 --- a/src/store/modules/trainingNew.js +++ b/src/store/modules/trainingNew.js @@ -5,6 +5,7 @@ const training = { trainingDetail: null, // 实训详情 trainingSwitch: false, // 实训开始结束标志 trainingOperate: null, + simulationPause: false, // 实训 暂停判断 stepOrder: 1, operateOrder: 0, stepOverCount: 0 @@ -51,6 +52,9 @@ const training = { operateOrderIncrease: (state) => { state.operateOrder++; }, + setSimulationPause: (state, value) => { + state.simulationPause = value; + }, clearOperateOrder: (state) => { state.operateOrder = 0; }, @@ -86,6 +90,9 @@ const training = { operateOrderIncrease: ({commit}) => { commit('operateOrderIncrease'); }, + setSimulationPause: ({commit}, simulationPause) => { + commit('setSimulationPause', simulationPause); + }, clearOperateOrder: ({commit}) => { commit('clearOperateOrder'); }, diff --git a/src/views/designPlatform/trainingDesign.vue b/src/views/designPlatform/trainingDesign.vue index afda1cc3a..ee68605fc 100644 --- a/src/views/designPlatform/trainingDesign.vue +++ b/src/views/designPlatform/trainingDesign.vue @@ -3,21 +3,26 @@ + {{ faultMode?'切换到普通模式':'切换到故障模式' }}
- 开始 - 结束 - 返回 + 初始化 + 暂停 + 恢复 + 开始 + 结束 + 返回