diff --git a/src/utils/baseUrl.js b/src/utils/baseUrl.js index c59924e25..778caeb7b 100644 --- a/src/utils/baseUrl.js +++ b/src/utils/baseUrl.js @@ -2,9 +2,9 @@ export function getBaseUrl() { let BASE_API; if (process.env.NODE_ENV === 'development') { // BASE_API = 'https://joylink.club/jlcloud'; - // BASE_API = 'https://test.joylink.club/jlcloud'; + BASE_API = 'https://test.joylink.club/jlcloud'; // BASE_API = 'http://192.168.3.5:9000'; // 袁琪 - BASE_API = 'http://192.168.3.6:9000'; // 旭强 + // BASE_API = 'http://192.168.3.6:9000'; // 旭强 // BASE_API = 'http://192.168.3.41:9000'; // 张赛 // BASE_API = 'http://192.168.3.82:9000'; // 杜康 // BASE_API = 'http://b29z135112.zicp.vip'; diff --git a/src/views/jsxt/refereeList/menuReplay.vue b/src/views/jsxt/refereeList/menuReplay.vue index ac52d9992..8d1a6d0ee 100644 --- a/src/views/jsxt/refereeList/menuReplay.vue +++ b/src/views/jsxt/refereeList/menuReplay.vue @@ -22,7 +22,7 @@ - diff --git a/src/views/newMap/jointTrainingNew/chatView/chatContent.vue b/src/views/newMap/jointTrainingNew/chatView/chatContent.vue deleted file mode 100644 index 7405bdf0d..000000000 --- a/src/views/newMap/jointTrainingNew/chatView/chatContent.vue +++ /dev/null @@ -1,290 +0,0 @@ - - - diff --git a/src/views/newMap/jointTrainingNew/chatView/chatCoversitionList.vue b/src/views/newMap/jointTrainingNew/chatView/chatCoversitionList.vue deleted file mode 100644 index 9ac8b5273..000000000 --- a/src/views/newMap/jointTrainingNew/chatView/chatCoversitionList.vue +++ /dev/null @@ -1,172 +0,0 @@ - - - diff --git a/src/views/newMap/jointTrainingNew/chatView/chatCreateGroup.vue b/src/views/newMap/jointTrainingNew/chatView/chatCreateGroup.vue deleted file mode 100644 index 5f16484b8..000000000 --- a/src/views/newMap/jointTrainingNew/chatView/chatCreateGroup.vue +++ /dev/null @@ -1,234 +0,0 @@ - - - diff --git a/src/views/newMap/jointTrainingNew/chatView/chatMemberList.vue b/src/views/newMap/jointTrainingNew/chatView/chatMemberList.vue deleted file mode 100644 index 284a5f1a1..000000000 --- a/src/views/newMap/jointTrainingNew/chatView/chatMemberList.vue +++ /dev/null @@ -1,163 +0,0 @@ - - - diff --git a/src/views/newMap/jointTrainingNew/chatView/chatSetting.vue b/src/views/newMap/jointTrainingNew/chatView/chatSetting.vue deleted file mode 100644 index 26e59ac5b..000000000 --- a/src/views/newMap/jointTrainingNew/chatView/chatSetting.vue +++ /dev/null @@ -1,126 +0,0 @@ - - - - diff --git a/src/views/newMap/jointTrainingNew/chatView/chatTooltip.vue b/src/views/newMap/jointTrainingNew/chatView/chatTooltip.vue deleted file mode 100644 index 5ccc19fc7..000000000 --- a/src/views/newMap/jointTrainingNew/chatView/chatTooltip.vue +++ /dev/null @@ -1,110 +0,0 @@ - - - diff --git a/src/views/newMap/jointTrainingNew/newChatView/chatBox.vue b/src/views/newMap/jointTrainingNew/newChatView/chatBox.vue index 387c6c6f2..2e057aee7 100644 --- a/src/views/newMap/jointTrainingNew/newChatView/chatBox.vue +++ b/src/views/newMap/jointTrainingNew/newChatView/chatBox.vue @@ -51,7 +51,16 @@
- +
@@ -268,7 +277,7 @@ export default { this.$refs.chatSetting.doClose(); } else { this.firstClick && this.$nextTick(() => { - this.userRole == 'AUDIENCE' && this.isAudienceInitData(); + this.isAudienceInitData(); if (this.$refs.tree) { this.$refs.tree.filter(this.queryMember); } @@ -303,7 +312,7 @@ export default { startConversition(this.group, this.memberIdList).then(resp => { this.conversitionId = resp.data.id; this.conversitionMemberList = resp.data.memberList; - this.messageList = resp.data.messageList; + this.messageList = []; this.userString = ''; this.isConversitionCreator = true; this.$message.success('创建会话成功!'); @@ -470,7 +479,17 @@ export default { this.conversitionId = data.id; this.conversitionMemberList = data.memberList; this.isConversitionCreator = false; - this.messageList = data.messageList; + this.messageList = []; + if (data.messageList && data.messageList) { + data.messageList.forEach(message => { + const member = this.memberData[message.memberId]; + message.src = `/audio/${message.audioPath}`; + if (member) { + message.self = this.$store.state.userId == member.userId; + } + this.messageList.push(message); + }); + } }, connectMember(val) { this.conversitionMemberList.forEach(member => { @@ -479,19 +498,55 @@ export default { } }); }, + sortByMessageTime(message1, message2) { + const time1 = new Date(message1.time).valueOf(); + const time2 = new Date(message2.time).valueOf(); + return time1 - time2; + }, isAudienceInitData() { getAllConversition(this.group).then(resp => { if (resp.data && resp.data.length) { - let messageList = []; + const messageList = []; resp.data.forEach(conversation => { - messageList = [...messageList, ...conversation.messageList]; + if (this.userRole == 'AUDIENCE') { + (conversation.messageList || []).forEach(message => { + const member = this.memberData[message.memberId]; + message.src = `/audio/${message.audioPath}`; + message.members = conversation.memberList; + if (member) { + message.self = this.$store.state.userId == member.userId; + } + messageList.push(message); + }); + } else { + const user = this.simulationUsers[this.$store.state.user.id]; + !conversation.over && conversation.memberList.forEach(member =>{ + if (member.memberId == user.memberId) { + this.conversitionMemberList = conversation.memberList; + this.conversitionId = conversation.id; + this.messageList = []; + conversation.messageList.forEach(message => { + const member = this.memberData[message.memberId]; + message.src = `/audio/${message.audioPath}`; + if (member) { + message.self = this.$store.state.userId == member.userId; + } + this.messageList.push(message); + }); + } + }); + } }); + this.messageList = messageList.sort(this.sortByMessageTime); } }); this.conversitionMemberList = []; this.$store.state.training.memberList.forEach(item =>{ this.conversitionMemberList.push({memberId: item.id, connect:true }); }); + }, + changeMessageList(data) { + this.messageList.push(data); } } }; diff --git a/src/views/newMap/jointTrainingNew/newChatView/chatContent.vue b/src/views/newMap/jointTrainingNew/newChatView/chatContent.vue index 29187bc07..04b43dfc6 100644 --- a/src/views/newMap/jointTrainingNew/newChatView/chatContent.vue +++ b/src/views/newMap/jointTrainingNew/newChatView/chatContent.vue @@ -5,15 +5,15 @@
-
{{ covertName(chatContent.member,false) }}
-
{{ formatTime(chatContent.chatTime) }}
+
{{ covertName(chatContent,false) }}
+
{{ chatContent.time }}
- {{ covertName(chatContent.targetUser,true) }} + {{ covertName(chatContent,true) }} - {{ chatContent.message }} + {{ chatContent.content }}