diff --git a/src/scripts/cmdPlugin/Handler.js b/src/scripts/cmdPlugin/Handler.js index 1c8ef3055..f1258e3b3 100644 --- a/src/scripts/cmdPlugin/Handler.js +++ b/src/scripts/cmdPlugin/Handler.js @@ -29,7 +29,6 @@ class Handler { if (operation.start === true) { this.clear(); } - this.operations.push(operation); } diff --git a/src/store/modules/socket.js b/src/store/modules/socket.js index 8d8cd3095..aa7bc4258 100644 --- a/src/store/modules/socket.js +++ b/src/store/modules/socket.js @@ -244,10 +244,10 @@ function handle(state, data) { case 'SIMULATION_RAIL_TICKET': state.ticketInfo = msg; break; - // 实训提示消息 - case 'Simulation_Training_Step_Tip': - state.trainingStepTip = msg; - break; + // // 实训提示消息 + // case 'Simulation_Training_Step_Tip': + // state.trainingStepTip = msg; + // break; case 'Simulation_Training_Finish': state.trainingOverCount++; break; diff --git a/src/store/modules/trainingNew.js b/src/store/modules/trainingNew.js index 06d72fe6a..ee2a21736 100644 --- a/src/store/modules/trainingNew.js +++ b/src/store/modules/trainingNew.js @@ -1,4 +1,5 @@ import { setLocalStorage } from '@/utils/auth'; +import { addTrainingNew } from '../../api/jmap/training'; const training = { namespaced: true, state: { @@ -10,7 +11,7 @@ const training = { sceneOperate: null, stepOrder: 0, operateOrder: 0, - stepOverCount: 0, + // stepOverCount: 0, trainingScore: '' }, getters: { @@ -29,9 +30,9 @@ const training = { stepOrder: (state) => { return state.stepOrder; }, - stepOverCount: (state) => { - return state.stepOverCount; - }, + // stepOverCount: (state) => { + // return state.stepOverCount; + // }, trainingScore: (state) => { return state.trainingScore; }, @@ -72,9 +73,9 @@ const training = { state.operateOrder = 0; setLocalStorage('operateOrder', JSON.stringify(state.operateOrder)); }, - stepOverCountChange: (state) => { - state.stepOverCount++; - }, + // stepOverCountChange: (state) => { + // state.stepOverCount++; + // }, clearStepOverCount: (state) => { state.clearStepOverCount = 0; }, @@ -132,7 +133,10 @@ const training = { const index = state.stepOrder > 0 ? state.stepOrder - 1 : 0; const step = stepList[index]; if (valid && step.operations.length === (state.operateOrder + 1 )) { - commit('stepOverCountChange'); + // commit('stepOverCountChange'); + // commit('stepOrderIncrease'); + // debugger; + state.operateOrder = 0; } else if (valid) { commit('operateOrderIncrease'); } else { diff --git a/src/utils/subscribeCallback.js b/src/utils/subscribeCallback.js index 08d73442a..61ebad72b 100644 --- a/src/utils/subscribeCallback.js +++ b/src/utils/subscribeCallback.js @@ -174,10 +174,10 @@ function handle(data) { case 'SIMULATION_RAIL_TICKET': store.dispatch('socket/setTicketInfo', msg); break; - // 实训提示消息 - case 'Simulation_Training_Step_Tip': - store.dispatch('socket/setTrainingStepTip', msg); - break; + // // 实训提示消息 + // case 'Simulation_Training_Step_Tip': + // store.dispatch('socket/setTrainingStepTip', msg); + // break; case 'Simulation_Training_Finish': store.dispatch('socket/trainingOverCountIncrease'); break; diff --git a/src/views/designPlatform/trainingPreview.vue b/src/views/designPlatform/trainingPreview.vue index 87b2d2ed4..3e34bcc6c 100644 --- a/src/views/designPlatform/trainingPreview.vue +++ b/src/views/designPlatform/trainingPreview.vue @@ -135,11 +135,11 @@ export default { }, nextStep() { const stepList = JSON.parse(this.$store.state.trainingNew.trainingDetail.stepJson); - const step = stepList[this.$store.state.trainingNew.stepOrder - 1]; - endTrainingStep(this.group, step.id).then(resp => { - }).catch(() => { - this.$message.error('进入下一步实训失败!'); - }); + // const step = stepList[this.$store.state.trainingNew.stepOrder - 1]; + // endTrainingStep(this.group, step.id).then(resp => { + // }).catch(() => { + // this.$message.error('进入下一步实训失败!'); + // }); }, handlerEnd() { endTraining(this.group).then((resp) => { diff --git a/src/views/newMap/display/trainingList/trainingMenu.vue b/src/views/newMap/display/trainingList/trainingMenu.vue index 07c6f9114..31dcb5d73 100644 --- a/src/views/newMap/display/trainingList/trainingMenu.vue +++ b/src/views/newMap/display/trainingList/trainingMenu.vue @@ -102,7 +102,20 @@ export default { return this.$store.state.trainingNew.teachMode; } }, - watch: {}, + watch: { + '$store.state.trainingNew.stepOrder': function(val) { + debugger; + const stepList = JSON.parse(this.$store.state.trainingNew.trainingDetail.stepJson); + if (val < stepList.length) { + const msg = {content:stepList[val - 1].description, memberId:stepList[val - 1].memberId}; + this.$store.dispatch('socket/setTrainingStepTip', msg); + } else { + this.$store.dispatch('socket/setTrainingStepTip', null); + this.$store.dispatch('trainingNew/clearStepOrder'); + } + // operateOrder; + } + }, mounted() { this.loadInitData(); }, @@ -139,6 +152,9 @@ export default { startTraining(this.group, {mode: this.demoMode}).then(() => { this.$store.dispatch('trainingNew/trainingStart'); this.$store.dispatch('trainingNew/setTrainingScore', ''); + const stepList = JSON.parse(this.$store.state.trainingNew.trainingDetail.stepJson); + const msg = {content:stepList[0].description, memberId:stepList[0].memberId}; + this.$store.dispatch('socket/setTrainingStepTip', msg); }).catch(() => { this.$message.error('开始实训失败!'); }); diff --git a/src/views/newMap/display/trainingList/trainingPositionTip.vue b/src/views/newMap/display/trainingList/trainingPositionTip.vue index 0edb941ca..9e5105996 100644 --- a/src/views/newMap/display/trainingList/trainingPositionTip.vue +++ b/src/views/newMap/display/trainingList/trainingPositionTip.vue @@ -61,6 +61,12 @@ export default { this.popShow = false; this.tipShow = false; this.position = { x: 0, y: 0 }; + }, + '$store.state.training.tipEvent': function (val) { + setTimeout(() => { this.tipInit(); }, 300); + this.$nextTick(function() { + this.tipInit(); + }); } }, methods: { diff --git a/src/views/trainingPlatform/simulation.vue b/src/views/trainingPlatform/simulation.vue index e7a98fedf..10aeae6b1 100644 --- a/src/views/trainingPlatform/simulation.vue +++ b/src/views/trainingPlatform/simulation.vue @@ -1,7 +1,7 @@