From 50da21af0c746e255b560c786eab848e7f60f359 Mon Sep 17 00:00:00 2001 From: dong <58670809@qq.com> Date: Thu, 1 Dec 2022 15:01:06 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/store/modules/trainingNew.js | 9 +- .../display/trainingDesign/designPane.vue | 10 + .../display/trainingDesign/editOperate.vue | 3 + .../newMap/display/voiceChatBox/index.vue | 367 ++++++++++-------- 4 files changed, 218 insertions(+), 171 deletions(-) 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 @@