From a43ff34ad566e267331782aa6664c1812b6dc65f Mon Sep 17 00:00:00 2001 From: fan Date: Mon, 29 Aug 2022 11:06:11 +0800 Subject: [PATCH] =?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 --- src/api/jmap/training.js | 7 + src/api/trainingManage.js | 5 +- src/jmapNew/options.js | 1 - .../theme/datie_02/menus/menuButton.vue | 34 ++- src/store/modules/socket.js | 12 +- src/store/modules/training.js | 2 + src/store/modules/trainingNew.js | 42 +++- src/utils/baseUrl.js | 4 +- src/views/designPlatform/trainingPreview.vue | 208 +++++++++++++++++- src/views/designPlatform/trainingTip.vue | 3 + src/views/trainingManage/demonMenu.vue | 15 +- src/views/trainingManage/editDetails.vue | 23 +- src/views/trainingManage/editOperate.vue | 145 ++++++++++++ src/views/trainingManage/trainingList.vue | 11 +- 14 files changed, 482 insertions(+), 30 deletions(-) create mode 100644 src/views/trainingManage/editOperate.vue diff --git a/src/api/jmap/training.js b/src/api/jmap/training.js index 144fa9c0d..32aecacc1 100644 --- a/src/api/jmap/training.js +++ b/src/api/jmap/training.js @@ -247,3 +247,10 @@ export function endTrainingStep(group, stepId) { method: 'put' }); } +/** 编制剧本的时候加载背景 */ +export function loadTrainingBg(group, trainingId) { + return request({ + url: `/api/training2Simulation/${group}/draw/${trainingId}`, + method: 'post' + }); +} diff --git a/src/api/trainingManage.js b/src/api/trainingManage.js index 9af992810..15d780fa0 100644 --- a/src/api/trainingManage.js +++ b/src/api/trainingManage.js @@ -40,9 +40,10 @@ export function getTrainingStepList(trainingId) { }); } /** 修改实训所有步骤 */ -export function updateTrainingStep(id, data) { +export function updateTrainingStep(group, trainingId, data) { + console.log(group, trainingId, '*******'); return request({ - url: `/api/v2/draft/training/${id}/step/update`, + url: `/api/v2/draft/training/${group}/${trainingId}/step/update`, method: 'put', data: data }); diff --git a/src/jmapNew/options.js b/src/jmapNew/options.js index 42354088a..1e4fb43a2 100644 --- a/src/jmapNew/options.js +++ b/src/jmapNew/options.js @@ -43,7 +43,6 @@ class Options { } update(payload) { - console.log(payload, '*****---------'); if (Number.isFinite(payload.dx)) { this.offsetX -= payload.dx; } diff --git a/src/jmapNew/theme/datie_02/menus/menuButton.vue b/src/jmapNew/theme/datie_02/menus/menuButton.vue index 599a2d68d..125e0b429 100644 --- a/src/jmapNew/theme/datie_02/menus/menuButton.vue +++ b/src/jmapNew/theme/datie_02/menus/menuButton.vue @@ -383,7 +383,8 @@ export default { // S引导总锁按钮点击 guideLockLeftButtonDown() { const operate = { - operation: this.Station.stationMasterLock.leftButton.operation + operation: this.Station.stationMasterLock.leftButton.operation, + userOperationType: 'rightClick' }; this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { if (valid) { @@ -399,7 +400,8 @@ export default { // X引导总锁按钮点击 guideLockRightButtonDown() { const operate = { - operation: this.Station.stationMasterLock.rightButton.operation + operation: this.Station.stationMasterLock.rightButton.operation, + userOperationType: 'rightClick' }; this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { if (valid) { @@ -416,7 +418,8 @@ export default { this.clearOperate(); if (operation != this.Command.cancel.clearMbm.operation) { const operate = { - operation: operation + operation: operation, + userOperationType: 'leftClick' }; // 以下 会弹出密码框 (总人解,区故解) 铅封按钮 const operationList = [this.Signal.humanTrainRoute.button.operation, this.Section.fault.button.operation, this.Section.defectiveShunting.button.operation, @@ -478,7 +481,8 @@ export default { // 排列进路 OR 信号重开操作 arrangementRouteOperation(deviceList) { const operate = { - operation: this.Signal.arrangementRoute.button.operation + operation: this.Signal.arrangementRoute.button.operation, + userOperationType: 'rightClick' }; if (!this.routeDataMap) { this.handleRouteDataMap(); } @@ -536,6 +540,7 @@ export default { over: true, code: model.code, operation: this.$store.state.menuOperation.buttonOperation, + userOperationType: 'rightClick', cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_ROUTE, param: { signalCode: model._type === 'Signal' ? model.code : model.signalCode @@ -555,6 +560,7 @@ export default { over: true, code: model.code, operation: this.Signal.guide.button.operation, + userOperationType: 'rightClick', cmdType: CMD.Signal.CMD_SIGNAL_ROUTE_GUIDE, param: {signalCode: model.signalCode} }; @@ -574,6 +580,7 @@ export default { over: true, code: model.code, operation: this.$store.state.menuOperation.buttonOperation, + userOperationType: 'rightClick', val: model.code, cmdType: CMD.Signal.CMD_SIGNAL_HUMAN_RELEASE_ROUTE }; @@ -591,6 +598,7 @@ export default { over: true, code: model.code, operation: this.$store.state.menuOperation.buttonOperation, + userOperationType: 'rightClick', cmdType: this.cmdType, param: { switchCode: model.code} }; @@ -622,6 +630,7 @@ export default { over: true, code: model.code, operation: buttonOperation, + userOperationType: 'rightClick', cmdType: '', param: {} }; @@ -651,6 +660,7 @@ export default { over: true, code: model.code, operation: this.guideLockRightFlag ? this.Switch.guideLock.rightButton : this.Switch.guideLock.leftButton, + userOperationType: 'rightClick', nextCmdType: CMD.Switch.CMD_SWITCH_MASTER_LOCK, param: {signalCode: model.signalCode} }; @@ -669,6 +679,7 @@ export default { over: true, code: model.code, operation: this.$store.state.menuOperation.buttonOperation, + userOperationType: 'rightClick', cmdType: CMD.Section.CMD_SECTION_FAULT_UNLOCK, param: {sectionCode: model.code} }; @@ -680,6 +691,7 @@ export default { over: true, code: model.code, operation: this.$store.state.menuOperation.buttonOperation, + userOperationType: 'rightClick', cmdType: CMD.Signal.CMD_SIGNAL_TURN_ON, param: {signalCode: model.code} }; @@ -691,6 +703,7 @@ export default { over: true, code: model.code, operation: this.$store.state.menuOperation.buttonOperation, + userOperationType: 'rightClick', cmdType: CMD.Signal.CMD_SIGNAL_TURN_OFF, param: {signalCode: model.signalCode} }; @@ -771,6 +784,7 @@ export default { name:'总辅助', operation:this.CTCCommand.assistPressMainAssist.menu.operation, nextCmdType:CMD.CTC.CTC_ASSIST_PRESS_MAIN_ASSIST, + userOperationType: 'rightClick', param:{ labelEnum:model.labelEnum, stationCode:model.stationCode, @@ -782,6 +796,7 @@ export default { name:'改方', operation:this.CTCCommand.assistPressDownTurnDirection.menu.operation, nextCmdType:CMD.CTC.CTC_ASSIST_PRESS_DOWN_TURN_DIRECTION, + operationType: 'rightClick', param:{ labelEnum:model.labelEnum, stationCode:model.stationCode, @@ -794,6 +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', param:{ labelEnum:model.labelEnum, stationCode:model.stationCode @@ -804,6 +820,7 @@ export default { name:'发辅助', operation:this.CTCCommand.assistPressDeliverAssist.menu.operation, nextCmdType:CMD.CTC.CTC_ASSIST_PRESS_DELIVER_ASSIST, + userOperationType: 'rightClick', param:{ labelEnum:model.labelEnum, stationCode:model.stationCode @@ -814,6 +831,7 @@ export default { name:'事故', operation:this.CTCCommand.assistPressAccident.menu.operation, nextCmdType:CMD.CTC.CTC_ASSIST_PRESS_ACCIDENT, + userOperationType: 'rightClick', param:{ labelEnum:model.labelEnum, stationCode:model.stationCode @@ -826,6 +844,7 @@ export default { 'OCCLUSION':{ operation:this.CTCCommand.assistPressBlock.menu.operation, nextCmdType:CMD.CTC.CTC_ASSIST_PRESS_BLOCK, + userOperationType: 'rightClick', param:{ labelEnum:model.labelEnum, stationCode:model.stationCode @@ -835,6 +854,7 @@ export default { 'RECOVERY':{ operation:this.CTCCommand.assistPressRestore.menu.operation, nextCmdType:CMD.CTC.CTC_ASSIST_PRESS_RESTORE, + userOperationType: 'rightClick', param:{ labelEnum:model.labelEnum, stationCode:model.stationCode @@ -847,7 +867,8 @@ export default { operation: noPasswordModelTypeMap[model.type].operation, code: model.code, param: noPasswordModelTypeMap[model.type].param, - cmdType : noPasswordModelTypeMap[model.type].nextCmdType + cmdType : noPasswordModelTypeMap[model.type].nextCmdType, + userOperationType: 'rightClick' }; this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { if (valid) { @@ -864,7 +885,8 @@ export default { const operate = { operation: modelTypeMap[model.type].operation, code: model.code, - param: modelTypeMap[model.type].param + param: modelTypeMap[model.type].param, + userOperationType: 'rightClick' }; this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { if (valid) { diff --git a/src/store/modules/socket.js b/src/store/modules/socket.js index cdde0e7b1..70ac64297 100644 --- a/src/store/modules/socket.js +++ b/src/store/modules/socket.js @@ -290,6 +290,9 @@ function handle(state, data) { case 'Simulation_Training_Step_Tip': state.trainingStepTip = msg; break; + case 'Simulation_Training_Finish': + state.trainingOverCount++; + break; // // // 大铁项目 调度台 运行图信息 初始化消息 // case 'SIMULATION_RAILWAY_RUN_PLAN_INIT': @@ -477,7 +480,8 @@ const socket = { railwaySimulationRunplanSendChange:0, // 大铁项目 调度台 发布 行车计划变化 voiceBroadcastMsgs: [], // 语音播报信息 voiceBroadcastChange: 0, // 语音播报信息变化 - trainingStepTip: '' // 新实训推送消息 + trainingStepTip: '', // 新实训推送消息 + trainingOverCount: 0 // 新实训结束计数器 // railwaySimulationRpMsg:{}, // 大铁项目 调度台 调度台 // railwaySimulationRpChange:0 // 大铁项目 调度台 运行图信息变化 }, @@ -588,6 +592,9 @@ const socket = { }, clearTrainingStepTip: (state) => { state.trainingStepTip = ''; + }, + clearTrainingOverCount: (state) => { + state.trainingOverCount = 0; } }, @@ -694,6 +701,9 @@ const socket = { }, clearTrainingStepTip: ({ commit }) => { commit('clearTrainingStepTip'); + }, + clearTrainingOverCount: ({ commit }) => { + commit('clearTrainingOverCount'); } } }; diff --git a/src/store/modules/training.js b/src/store/modules/training.js index dbe085976..1d2d546d6 100644 --- a/src/store/modules/training.js +++ b/src/store/modules/training.js @@ -4,6 +4,7 @@ import deviceType from '../../jmapNew/constant/deviceType'; import LangStorage from '@/utils/lang'; import Handler from '@/scripts/cmdPlugin/Handler'; import { deepAssign } from '@/utils/index'; +import store from '@/store/index'; /** * 实训状态数据 @@ -454,6 +455,7 @@ const training = { rtn && rtn.valid && commit('next'); } } + store.dispatch('trainingNew/setTrainingOperate', operate); resolve(rtn); }).catch(error => { // console.error(error); diff --git a/src/store/modules/trainingNew.js b/src/store/modules/trainingNew.js index 4f2bc0d05..11fdc7db6 100644 --- a/src/store/modules/trainingNew.js +++ b/src/store/modules/trainingNew.js @@ -3,7 +3,10 @@ const training = { state: { teachMode: '', // 实训模式 trainingDetail: null, // 实训详情 - trainingSwitch: false // 实训开始结束标志 + trainingSwitch: false, // 实训开始结束标志 + trainingOperate: null, + stepOrder: 1, + operateOrder: 0 }, getters: { teachMode: (state) => { @@ -14,6 +17,12 @@ const training = { }, trainingSwitch: (state) => { return state.trainingSwitch; + }, + trainingOperate: (state) => { + return state.trainingOperate; + }, + stepOrder: (state) => { + return state.stepOrder; } }, mutations: { @@ -25,6 +34,21 @@ const training = { }, setTrainingSwitch: (state, flag) => { state.trainingSwitch = flag; + }, + setTrainingOperate: (state, trainingOperate) => { + state.trainingOperate = trainingOperate; + }, + stepOrderIncrease: (state) => { + state.stepOrder++; + }, + clearStepOrder: (state) => { + state.stepOrder = 1; + }, + operateOrderIncrease: (state) => { + state.operateOrder++; + }, + clearOperateOrder: (state) => { + state.operateOrder = 0; } }, actions: { @@ -39,7 +63,23 @@ const training = { }, trainingEnd: ({commit}) => { commit('setTrainingSwitch', false); + }, + setTrainingOperate: ({commit, state}, trainingOperate) => { + commit('setTrainingOperate', trainingOperate); + }, + stepOrderIncrease: ({commit}) => { + commit('stepOrderIncrease'); + }, + clearStepOrder: ({commit}) => { + commit('clearStepOrder'); + }, + operateOrderIncrease: ({commit}) => { + commit('operateOrderIncrease'); + }, + clearOperateOrder: ({commit}) => { + commit('clearOperateOrder'); } } }; export default training; + diff --git a/src/utils/baseUrl.js b/src/utils/baseUrl.js index b56c5ab9d..a1a9e525a 100644 --- a/src/utils/baseUrl.js +++ b/src/utils/baseUrl.js @@ -24,14 +24,14 @@ export function handlerUrl(data) { if (process.env.NODE_ENV === 'development') { // const data = null; // BASE_API = 'https://joylink.club/jlcloud'; - BASE_API = 'https://test.joylink.club/jlcloud'; + // BASE_API = 'https://test.joylink.club/jlcloud'; // BASE_API = 'http://192.168.3.233/rtss-server'; // BASE_API = 'http://114.116.51.125/jlcloud'; // BASE_API = 'http://192.168.8.152:9000'; // 袁琪 // BASE_API = 'http://192.168.3.94:9000'; // 旭强 // BASE_API = 'http://192.168.3.15:9000'; // 张赛 // BASE_API = 'http://192.168.3.5:9000'; // 夏增彬 - // BASE_API = 'http://192.168.3.37:9000'; // 卫志宏 + BASE_API = 'http://192.168.3.37:9000'; // 卫志宏 // BASE_API = 'http://b29z135112.zicp.vip'; // BASE_API = 'http://2925963m2a.zicp.vip'; // 杜康 // BASE_API = 'http://2i38984j47.qicp.vip'; // 张赛 diff --git a/src/views/designPlatform/trainingPreview.vue b/src/views/designPlatform/trainingPreview.vue index 551579c76..9d8345bb0 100644 --- a/src/views/designPlatform/trainingPreview.vue +++ b/src/views/designPlatform/trainingPreview.vue @@ -1,14 +1,15 @@ + + diff --git a/src/views/trainingManage/trainingList.vue b/src/views/trainingManage/trainingList.vue index a477513b9..56c425c1b 100644 --- a/src/views/trainingManage/trainingList.vue +++ b/src/views/trainingManage/trainingList.vue @@ -13,7 +13,8 @@