From 13a3ccf066d76096c1474484d750db2e30d573f0 Mon Sep 17 00:00:00 2001 From: joylink_cuiweidong <364937672@qq.com> Date: Tue, 12 May 2020 19:02:53 +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/socket.js | 2 +- src/views/newMap/jointTrainingNew/chatBox.vue | 31 +++++++++++++++++-- .../newMap/jointTrainingNew/chatContent.vue | 2 ++ 3 files changed, 32 insertions(+), 3 deletions(-) diff --git a/src/store/modules/socket.js b/src/store/modules/socket.js index 1a7d85da5..06559b9b8 100644 --- a/src/store/modules/socket.js +++ b/src/store/modules/socket.js @@ -148,7 +148,7 @@ function handleSimulationInfo(state, data) { memberOnline:data.member.online, chatTime: data.chatTime, targetOnline:data.targetMember ? data.targetMember.online : null, - targetName:data.targetMember ? data.targetMember.name : null, + targetName:data.targetMember ? data.targetMember.name : 'All', targetRole:data.targetMember ? data.targetMember.role : null, group: data.group, date: +new Date(`${myDate1} ${chatTime}`) diff --git a/src/views/newMap/jointTrainingNew/chatBox.vue b/src/views/newMap/jointTrainingNew/chatBox.vue index f835d15b3..f6ebeedaf 100644 --- a/src/views/newMap/jointTrainingNew/chatBox.vue +++ b/src/views/newMap/jointTrainingNew/chatBox.vue @@ -5,7 +5,7 @@
成员列表
-
{{ member.role+'-'+member.name }}
+
{{ handleMember(member) }}
@@ -17,7 +17,7 @@ :key="coversition.id" :class="coversition.id==currentCoversition.id?'coversition-active each-coversition':'each-coversition'" @click="changeCoversition(coversition)" - >{{ coversition.name }}
+ >{{ handleMemberName(coversition) }}
@@ -129,6 +129,33 @@ export default { setSetting(data) { this.form = data; }, + handleMemberName(conversition) { + if (conversition.group) { + return conversition.name; + } else { + let coversitionName = ''; + conversition.memberList.forEach(member=>{ + if (member.userId != this.$store.state.user.id) { + const roleTypeList = ConstConfig.ConstSelect.roleTypeNew; + let data = member.role; + roleTypeList.forEach(function(element) { + const rolename = element.value; + if (Cookies.get('user_lang') == 'en') { + data = data.replace(rolename, element.enLabel); + } else { + data = data.replace(rolename, element.label); + } + }); + coversitionName = member.name ? data + '-' + member.name : data; + } + }); + return coversitionName; + // conversition.name ? coversitionName + '-' + conversition.name : coversitionName; + } + }, + handleMember(member) { + return member.name ? member.role + '-' + member.name : member.role; + }, // 语音录制开始 startRecording() { const that = this; diff --git a/src/views/newMap/jointTrainingNew/chatContent.vue b/src/views/newMap/jointTrainingNew/chatContent.vue index 67f05b3c7..d5ad57611 100644 --- a/src/views/newMap/jointTrainingNew/chatContent.vue +++ b/src/views/newMap/jointTrainingNew/chatContent.vue @@ -8,6 +8,7 @@
+ @{{ chatContent.targetName }} {{ chatContent.message }}