From d789a30333de5f3d1b358a6f81cb7e95ceb6c2a9 Mon Sep 17 00:00:00 2001
From: joylink_cuiweidong <364937672@qq.com>
Date: Mon, 22 Jun 2020 18:37:09 +0800
Subject: [PATCH] =?UTF-8?q?=E5=89=A7=E6=9C=AC=E7=BC=96=E5=88=B6=E4=BB=A3?=
=?UTF-8?q?=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/scriptRecord.js | 14 ++++++++++++-
.../newMap/displayNew/chatView/chatBox.vue | 20 ++++++++++---------
.../chatView/chatCoversitionList.vue | 3 +++
.../displayNew/chatView/chatMemberList.vue | 3 +++
src/views/newMap/displayNew/menuScript.vue | 2 +-
.../display/tipScriptRecordNew.vue | 6 ++++++
.../scriptRecord/getActionNew.vue | 2 +-
7 files changed, 38 insertions(+), 12 deletions(-)
diff --git a/src/store/modules/scriptRecord.js b/src/store/modules/scriptRecord.js
index eb4f46783..b67204a37 100644
--- a/src/store/modules/scriptRecord.js
+++ b/src/store/modules/scriptRecord.js
@@ -9,7 +9,9 @@ const scriptRecord = {
scriptId: '',
bgSet: false,
isScriptCommand:false, // 当前是否为添加剧本动作指令状态
- scriptCommand:{} // 剧本动作添加的指令
+ scriptCommand:{}, // 剧本动作添加的指令
+ updateRoleStatus:0, // 剧本更新角色标志
+ userRole:null // 剧本更新的角色
},
getters: {
mapLocation: (state)=>{
@@ -29,6 +31,9 @@ const scriptRecord = {
},
scriptCommand:(state)=>{
return state.scriptCommand;
+ },
+ updateRoleStatus:(state)=>{
+ return state.updateRoleStatus;
}
},
mutations: {
@@ -49,6 +54,10 @@ const scriptRecord = {
},
setScriptCommand:(state, scriptCommand) => {
state.scriptCommand = scriptCommand;
+ },
+ updateRole:(state, userRole) => {
+ state.updateRoleStatus += 1;
+ state.userRole = userRole;
}
},
actions: {
@@ -72,6 +81,9 @@ const scriptRecord = {
},
updateScriptCommand:({ commit }, scriptCommand) => {
commit('setScriptCommand', scriptCommand);
+ },
+ updateRole:({ commit }, userRole) => {
+ commit('updateRole', userRole);
}
}
};
diff --git a/src/views/newMap/displayNew/chatView/chatBox.vue b/src/views/newMap/displayNew/chatView/chatBox.vue
index 866a914d6..5955f57bc 100644
--- a/src/views/newMap/displayNew/chatView/chatBox.vue
+++ b/src/views/newMap/displayNew/chatView/chatBox.vue
@@ -11,7 +11,7 @@
-
+
@@ -83,7 +83,6 @@ export default {
minimize:true,
bottom:15,
recordSending:false,
- currentCoversition:{},
memberListCoversition:{},
seconds:0,
inter:null,
@@ -132,6 +131,9 @@ export default {
const objectBottom = parseInt(object.style.bottom) || 0;
this.bottom = this.bottom + object.offsetHeight + objectBottom;
}
+ },
+ 'userRole':function(val) {
+ this.isHasCoversition = false;
}
},
@@ -159,7 +161,7 @@ export default {
},
setCurrentCoversition(coversition) {
if (coversition && coversition.id) {
- this.currentCoversition = coversition;
+ // this.currentCoversition = coversition;
this.headerTitle = coversition.name;
} else {
this.headerTitle = '';
@@ -175,9 +177,9 @@ export default {
},
quitCoversition() {
this.quitLoading = true;
- quitCoversition(this.group, this.currentCoversition.id).then(res=>{
+ quitCoversition(this.group, this.memberListCoversition.id).then(res=>{
this.quitLoading = false;
- this.currentCoversition = {all:undefined, id:null};
+ this.memberListCoversition = {all:undefined, id:null};
this.$refs.chatCoversitionList.initPage(true);
this.isHasCoversition = false;
}).catch(error=>{
@@ -191,7 +193,7 @@ export default {
addCoversition({data, headerTitle}) {
this.$refs.chatCoversitionList.addCoversition(data, headerTitle);
this.isHasCoversition = true;
- this.currentCoversition = {id:data.id, all:data.all};
+ // this.currentCoversition = {id:data.id, all:data.all};
this.memberListCoversition = {id:data.id, all:data.all};
this.headerTitle = headerTitle;
},
@@ -290,7 +292,7 @@ export default {
const blob = that.recorders.getBlob();
const fd = new FormData();
fd.append('file', blob);
- uploadAudioFileNew(that.group, that.form.language, that.form.sex, that.currentCoversition.id, fd)
+ uploadAudioFileNew(that.group, that.form.language, that.form.sex, that.memberListCoversition.id, fd)
.then((data) => {
})
.catch(error => {
diff --git a/src/views/newMap/displayNew/chatView/chatCoversitionList.vue b/src/views/newMap/displayNew/chatView/chatCoversitionList.vue
index 04f3dfc30..91b3f9b6b 100644
--- a/src/views/newMap/displayNew/chatView/chatCoversitionList.vue
+++ b/src/views/newMap/displayNew/chatView/chatCoversitionList.vue
@@ -31,6 +31,9 @@ export default {
'userRole':function(val) {
this.initPage(true);
}
+ // '$store.state.scriptRecord.updateRoleStatus':function(val) {
+ // this.initPage(true);
+ // }
},
mounted() {
},
diff --git a/src/views/newMap/displayNew/chatView/chatMemberList.vue b/src/views/newMap/displayNew/chatView/chatMemberList.vue
index a58adb699..b191b744e 100644
--- a/src/views/newMap/displayNew/chatView/chatMemberList.vue
+++ b/src/views/newMap/displayNew/chatView/chatMemberList.vue
@@ -49,6 +49,9 @@ export default {
if (val) {
this.getSimulationMembers();
}
+ },
+ '$store.state.scriptRecord.updateRoleStatus':function(val) {
+ this.getSimulationMembers();
}
},
mounted() {
diff --git a/src/views/newMap/displayNew/menuScript.vue b/src/views/newMap/displayNew/menuScript.vue
index 5cb240510..65a3ea535 100644
--- a/src/views/newMap/displayNew/menuScript.vue
+++ b/src/views/newMap/displayNew/menuScript.vue
@@ -88,7 +88,7 @@ export default {
} else if (this.$store.state.training.prdType == null) {
return '';
} else {
- return 'AUDIENCE';
+ return this.$store.state.scriptRecord.userRole ? this.$store.state.scriptRecord.userRole : 'AUDIENCE';
}
}
},
diff --git a/src/views/scriptManage/display/tipScriptRecordNew.vue b/src/views/scriptManage/display/tipScriptRecordNew.vue
index 1056d28e4..d1195f505 100644
--- a/src/views/scriptManage/display/tipScriptRecordNew.vue
+++ b/src/views/scriptManage/display/tipScriptRecordNew.vue
@@ -98,6 +98,7 @@ export default {
beforeDestroy() {
this.clearAutoSave();
this.$store.dispatch('scriptRecord/updateBgSet', false);
+ this.$store.dispatch('scriptRecord/updateRole', null);
},
mounted() {
this.initData();
@@ -149,6 +150,11 @@ export default {
}
}
this.$store.dispatch('training/setPrdType', prdType);
+ ConstConfig.ConstSelect.roleTypeNew.forEach(each=>{
+ if (each.label == memberInfo.role) {
+ this.$store.dispatch('scriptRecord/updateRole', each.value);
+ }
+ });
}).catch(()=>{
this.$messageBox('切换角色失败');
});
diff --git a/src/views/scriptManage/scriptRecord/getActionNew.vue b/src/views/scriptManage/scriptRecord/getActionNew.vue
index 309828f73..f3ada43a4 100644
--- a/src/views/scriptManage/scriptRecord/getActionNew.vue
+++ b/src/views/scriptManage/scriptRecord/getActionNew.vue
@@ -10,6 +10,7 @@
{{ actionInfo.memberName }}
邀请
{{ actionInfo.targetName }}
+
开始会话
{{ actionInfo.memberName }}
@@ -110,7 +111,6 @@ export default {
return lastData;
},
covertData(memberVOList, element) {
- debugger;
const member = memberVOList.find(elem=>{ return elem.id == element.memberId; });
const memberName = member.name;
switch (element.type) {