diff --git a/src/store/modules/trainingNew.js b/src/store/modules/trainingNew.js index b86bf4ca9..2d521b15c 100644 --- a/src/store/modules/trainingNew.js +++ b/src/store/modules/trainingNew.js @@ -14,7 +14,8 @@ const training = { scoringRules: [], // 当前实训评分规则 operateOrder: 0, // 操作order operateErrMsg: '', - scoreList: [] // 实训得分 + scoreList: [], // 实训得分 + draftStepList: null // 显示的步骤列表 }, getters: { teachMode: (state) => { @@ -85,6 +86,9 @@ const training = { }, pushScoreList: (state, scoring) => { state.scoreList.push(scoring); + }, + editDraftStepList: (state, draftStepList) => { + state.draftStepList = draftStepList; } }, actions: { @@ -145,6 +149,9 @@ const training = { }, pushScoreList: ({ commit }, scoring) => { commit('pushScoreList', scoring); + }, + editDraftStepList: ({ commit }, draftStepList) => { + commit('editDraftStepList', draftStepList); } } }; diff --git a/src/views/newMap/display/trainingDesign/designPane.vue b/src/views/newMap/display/trainingDesign/designPane.vue index 6f4f98420..b059b3e5b 100644 --- a/src/views/newMap/display/trainingDesign/designPane.vue +++ b/src/views/newMap/display/trainingDesign/designPane.vue @@ -256,6 +256,7 @@ export default { }, backDesignPane(data) { this.showMode = 'designPane'; + this.$store.dispatch('trainingNew/editDraftStepList', null); }, handleDelete(index, row) { console.log('删除', index, row); @@ -277,6 +278,15 @@ export default { return; } this.$store.dispatch('trainingNew/setTrainingDetail', null); + const list = []; + this.tableData.forEach((item, ind) => { + const obj = { + ...item, + isActive: ind === index + }; + list.push(obj); + }); + this.$store.dispatch('trainingNew/editDraftStepList', list); const member = this.$store.state.training.memberData[row.memberId]; if (!member.userId) { assignUsersPlayRoles([{ userId: this.$store.state.user.id, memberId: member.id}], this.$route.query.group).then(resp => { diff --git a/src/views/newMap/display/trainingDesign/editOperate.vue b/src/views/newMap/display/trainingDesign/editOperate.vue index 769d4ecb4..34082c9f9 100644 --- a/src/views/newMap/display/trainingDesign/editOperate.vue +++ b/src/views/newMap/display/trainingDesign/editOperate.vue @@ -75,6 +75,9 @@ export default { } } }, + beforeDestroy() { + this.$store.dispatch('trainingNew/editDraftStepList', null); + }, methods: { initData(data) { this.editMode = true; diff --git a/src/views/newMap/display/voiceChatBox/index.vue b/src/views/newMap/display/voiceChatBox/index.vue index 9e213ee24..20ebd49ff 100644 --- a/src/views/newMap/display/voiceChatBox/index.vue +++ b/src/views/newMap/display/voiceChatBox/index.vue @@ -3,7 +3,7 @@