From 933db5fb50271630ecd1b89cce3c07006f953cc9 Mon Sep 17 00:00:00 2001
From: joylink_cuiweidong <364937672@qq.com>
Date: Fri, 29 May 2020 16:56:02 +0800
Subject: [PATCH] =?UTF-8?q?=E7=BB=BC=E5=90=88=E6=BC=94=E7=BB=83=20?=
=?UTF-8?q?=E4=BB=BF=E7=9C=9F=E8=81=8A=E5=A4=A9=20=E4=BB=A3=E7=A0=81?=
=?UTF-8?q?=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/chat.js | 16 ++++
src/store/modules/socket.js | 8 +-
.../displayNew/chatView/chatContent.vue | 49 +++++++----
.../displayNew/chatView/chatCreateGroup.vue | 2 +-
src/views/newMap/displayNew/designIndex.vue | 12 +++
.../jointTrainingNew/chatView/chatBox.vue | 20 +++--
.../jointTrainingNew/chatView/chatContent.vue | 49 +++++++----
.../chatView/chatCoversitionList.vue | 87 ++-----------------
.../chatView/chatMemberList.vue | 3 +
.../jointTrainingNew/chatView/chatTooltip.vue | 20 ++++-
10 files changed, 137 insertions(+), 129 deletions(-)
diff --git a/src/api/chat.js b/src/api/chat.js
index 8d7915d4f..70eda4983 100644
--- a/src/api/chat.js
+++ b/src/api/chat.js
@@ -345,3 +345,19 @@ export function getSimulationChatMemberNew(group, conversationId) {
});
}
+// 接受其他人的会话邀请 (新版地图)
+export function acceptCoversitionInvite(group, conversationId) {
+ return request({
+ url: `/simulation/${group}/${conversationId}/accept`,
+ method: 'put'
+ });
+}
+
+// 退出该群聊 (新版地图)
+export function quitCoversition(group, conversationId) {
+ return request({
+ url: `/simulation/${group}/${conversationId}/exist`,
+ method: 'delete'
+ });
+}
+
diff --git a/src/store/modules/socket.js b/src/store/modules/socket.js
index 12c9f15c4..4f5ab7c90 100644
--- a/src/store/modules/socket.js
+++ b/src/store/modules/socket.js
@@ -32,6 +32,9 @@ function handle(state, data) {
case 'Simulation_Start_Conversation': // 综合演练仿真-聊天界面用户邀请其他人加入群聊
state.inviteOtherIntoChat = msg;
break;
+ case 'Simulation_Accept_Conversation': // 综合演练仿真-聊天界面用户接受被邀请
+ state.acceptInviteChat = msg;
+ break;
case 'Competition_Practical': // 竞赛裁判系统裁判员开始考试推送消息
state.competitionStart++; // 竞赛裁判系统裁判员开始考试推送消息
break;
@@ -163,9 +166,7 @@ function handleSimulationInfo(state, data) {
member:data.member,
memberOnline:data.member.online,
chatTime: data.chatTime,
- targetOnline:data.targetMember ? data.targetMember.online : null,
- targetName:data.targetMember ? data.targetMember : 'All',
- targetRole:data.targetMember ? data.targetMember.role : null,
+ targetUser:data.targetMember ? data.targetMember : 'All',
all: data.all,
date: +new Date(`${myDate1} ${chatTime}`)
};
@@ -218,6 +219,7 @@ const socket = {
simulationReset: '', // 仿真-异常消息
simulationText: {}, // 仿真-用户交互消息(聊天/命令),
inviteOtherIntoChat:{}, // 综合演练仿真-聊天界面用户邀请其他人加入群聊推送信息
+ acceptInviteChat:{}, // 综合演练仿真-聊天界面用户接受聊天邀请
// coversitionList:{}, // 历史仿真-用户消息列表
message: {}, // 仿真聊天
diff --git a/src/views/newMap/displayNew/chatView/chatContent.vue b/src/views/newMap/displayNew/chatView/chatContent.vue
index ff89831a5..67ed5ad7e 100644
--- a/src/views/newMap/displayNew/chatView/chatContent.vue
+++ b/src/views/newMap/displayNew/chatView/chatContent.vue
@@ -10,7 +10,7 @@
-
@{{ covertName(chatContent.targetName) }}
+
@{{ covertName(chatContent.targetUser) }}
{{ chatContent.message }}
@@ -78,7 +78,7 @@ export default {
coversition.self = true;
}
coversition.src = coversition.isAudio ? `/jlcloud/audio/${coversition.audioPath}` : '';
- coversition.targetName = coversition.targetMember ? coversition.targetMember : 'All';
+ coversition.targetUser = coversition.targetMember ? coversition.targetMember : 'All';
return coversition;
});
this.chatContentList = coversitionList;
@@ -103,26 +103,37 @@ export default {
},
covertName(data) {
if (data != 'All') {
- const roleTypeList = ConstConfig.ConstSelect.roleTypeNew;
- roleTypeList.forEach(function(element) {
- const rolename = element.value;
- if (Cookies.get('user_lang') == 'en') {
- if (rolename == data.role) {
- data.role = element.enLabel;
- }
- } else {
- if (rolename == data.role) {
- data.role = element.label;
- }
- }
- });
- const deviceName = data.deviceName ? '-' + data.deviceName : '';
- const memberName = data.name ? '-' + data.name : '';
- return data.role + deviceName + memberName;
+ if (data instanceof Array) {
+ let result = '';
+ data.forEach(each=>{
+ result += this.covertEachName(each);
+ });
+ return result;
+ } else {
+ return this.covertEachName(data);
+ }
} else {
- return 'All';
+ return '@All';
}
},
+ covertEachName(data) {
+ const roleTypeList = ConstConfig.ConstSelect.roleTypeNew;
+ roleTypeList.forEach(function(element) {
+ const rolename = element.value;
+ if (Cookies.get('user_lang') == 'en') {
+ if (rolename == data.role) {
+ data.role = element.enLabel;
+ }
+ } else {
+ if (rolename == data.role) {
+ data.role = element.label;
+ }
+ }
+ });
+ const deviceName = data.deviceName ? '-' + data.deviceName : '';
+ const memberName = data.name ? '-' + data.name : '';
+ return '@' + data.role + deviceName + memberName;
+ },
playAudio(id) {
document.querySelector('#' + id).play();
}
diff --git a/src/views/newMap/displayNew/chatView/chatCreateGroup.vue b/src/views/newMap/displayNew/chatView/chatCreateGroup.vue
index 68bcf6b89..e04d91923 100644
--- a/src/views/newMap/displayNew/chatView/chatCreateGroup.vue
+++ b/src/views/newMap/displayNew/chatView/chatCreateGroup.vue
@@ -102,7 +102,7 @@ export default {
this.checkList = [];
}
}).catch(error=>{
- this.$messageBox('创建会话失败: ' + error.messagfe);
+ this.$messageBox('创建会话失败: ' + error.message);
this.loading = false;
this.dialogVisible = false;
this.checkList = [];
diff --git a/src/views/newMap/displayNew/designIndex.vue b/src/views/newMap/displayNew/designIndex.vue
index 0d4132c3c..f46c0c74d 100644
--- a/src/views/newMap/displayNew/designIndex.vue
+++ b/src/views/newMap/displayNew/designIndex.vue
@@ -12,6 +12,7 @@
:offset-bottom="offsetBottom"
:group="group"
:quest-id="questId"
+ :user-role="userRole"
@tryTime="tryTime"
@hidepanel="hidepanel"
@quitQuest="quitQuest"
@@ -151,6 +152,17 @@ export default {
// return this.$route.query.prdType;
return this.$store.state.training.prdType;
},
+ userRole() {
+ if (this.prdType == '02') {
+ return 'DISPATCHER';
+ } else if (this.prdType == '01') {
+ return 'STATION_SUPERVISOR';
+ } else if (this.prdType == '04') {
+ return 'DRIVER';
+ } else {
+ return 'AUDIENCE';
+ }
+ },
isDemon() {
return this.mode === 'demon';
},
diff --git a/src/views/newMap/jointTrainingNew/chatView/chatBox.vue b/src/views/newMap/jointTrainingNew/chatView/chatBox.vue
index 23e97bbb0..ca3f0fc5d 100644
--- a/src/views/newMap/jointTrainingNew/chatView/chatBox.vue
+++ b/src/views/newMap/jointTrainingNew/chatView/chatBox.vue
@@ -2,9 +2,9 @@
-
+
-
+
-
+
diff --git a/src/views/newMap/jointTrainingNew/chatView/chatMemberList.vue b/src/views/newMap/jointTrainingNew/chatView/chatMemberList.vue
index eb68d680a..6aff4fb6d 100644
--- a/src/views/newMap/jointTrainingNew/chatView/chatMemberList.vue
+++ b/src/views/newMap/jointTrainingNew/chatView/chatMemberList.vue
@@ -46,6 +46,9 @@ export default {
if (val) {
this.getSimulationMembers();
}
+ },
+ '$store.state.socket.acceptInviteChat':function(val) {
+ this.getSimulationMembers();
}
},
mounted() {
diff --git a/src/views/newMap/jointTrainingNew/chatView/chatTooltip.vue b/src/views/newMap/jointTrainingNew/chatView/chatTooltip.vue
index 194e91059..5ccc19fc7 100644
--- a/src/views/newMap/jointTrainingNew/chatView/chatTooltip.vue
+++ b/src/views/newMap/jointTrainingNew/chatView/chatTooltip.vue
@@ -17,19 +17,28 @@