@@ -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 => {
@@ -492,6 +511,9 @@ export default {
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..17de7f0c3 100644
--- a/src/views/newMap/jointTrainingNew/newChatView/chatContent.vue
+++ b/src/views/newMap/jointTrainingNew/newChatView/chatContent.vue
@@ -5,15 +5,15 @@
- {{ covertName(chatContent.targetUser,true) }}
+ {{ covertName(chatContent,true) }}
- {{ chatContent.message }}
+ {{ chatContent.content }}
@@ -39,6 +39,14 @@ export default {
conversitionId: {
type: String,
required: true
+ },
+ conversitionMemberList: {
+ type: Array,
+ required: true
+ },
+ simulationUsers: {
+ type: Object,
+ required: true
}
},
data() {
@@ -54,10 +62,15 @@ export default {
watch:{
'$store.state.socket.conversationInfo':function (val, old) { // 仿真聊天
const conversationInfo = this.$store.state.socket.conversationInfo;
+ const member = this.$store.state.training.memberData[val.message.memberId];
+ conversationInfo.src = `/audio/${conversationInfo.audioPath}`;
+ if (member) {
+ conversationInfo.self = this.$store.state.userId == member.userId;
+ }
if (this.conversitionId == val.id) {
- this.chatContentList.push(conversationInfo);
- if (simulationText.userId != this.$store.state.user.id) {
- this.currentAudioList.push(this.baseUrl + conversationInfo.src);
+ this.$emit('changeMessageList', conversationInfo.message);
+ if (member && member.userId != this.$store.state.user.id) {
+ this.currentAudioList.push(this.baseUrl + '/audio/' + conversationInfo.message.audioPath);
if (!this.isPlay) {
this.isPlay = true;
this.playAllAudio();
@@ -65,9 +78,9 @@ export default {
}
this.scrollTop();
} else if (this.userRole === 'AUDIENCE') {
- this.messageList.push(conversationInfo.data);
- if (simulationText.userId != this.$store.state.user.id) {
- this.currentAudioList.push(this.baseUrl + conversationInfo.src);
+ this.$emit('changeMessageList', conversationInfo.message);
+ if (member && member.userId != this.$store.state.user.id) {
+ this.currentAudioList.push(this.baseUrl + '/audio/' + conversationInfo.message.audioPath);
if (!this.isPlay) {
this.isPlay = true;
this.playAllAudio();
@@ -109,9 +122,9 @@ export default {
document.querySelector('.chatcontentIn').scrollTop = scrollTop;
});
},
- formatTime(time) {
- return /\d{2}:\d{2}:\d{2}/.exec(time)[0] || time;
- },
+ // formatTime(time) {
+ // return /\d{2}:\d{2}:\d{2}/.exec(time)[0] || time;
+ // },
playAllAudio() {
this.playEachAudio(this.currentAudioList[this.currentAudioIndex]);
},
@@ -132,41 +145,29 @@ export default {
});
},
covertName(data, status) {
- if (data != 'All') {
- if (data instanceof Array) {
- let result = '';
- data.forEach(each=>{
- result += this.covertEachName(each, status);
- });
- return result;
- } else {
- return this.covertEachName(data, status);
- }
+ if (status) {
+ let result = '';
+ const members = data.members || this.conversitionMemberList;
+ (members || []).forEach(member => {
+ if (member.memberId != data.memberId) {
+ result += ('@' + this.covertEachName(member.memberId));
+ }
+ });
+ return result;
} else {
- return '@All';
+ return this.covertEachName(data.memberId);
}
},
- covertEachName(data, status) {
- 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 : '';
- if (status) {
- return '@' + data.role + deviceName + memberName;
- } else {
- return data.role + deviceName + memberName;
+ covertEachName(memberId) {
+ let name = '';
+ const member = this.$store.state.training.memberData[memberId];
+ if (member && member.userId) {
+ const user = this.simulationUsers[member.userId];
+ name = member.lable + '(' + user.nickName + ')';
+ } else if (member) {
+ name = member.label;
}
+ return name;
},
playAudio(audioUrl) {
document.querySelector('#audioPlay').src = audioUrl;
From 24daf6aea1edab4adb1c5ee9a90e67bf1c796453 Mon Sep 17 00:00:00 2001
From: joylink_fanyuhong <18706759286@163.com>
Date: Tue, 7 Jul 2020 13:15:20 +0800
Subject: [PATCH 2/4] =?UTF-8?q?=E8=81=8A=E5=A4=A9=E5=AE=A4=E8=B0=83?=
=?UTF-8?q?=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/newMap/jointTrainingNew/newChatView/chatBox.vue | 1 +
.../newMap/jointTrainingNew/newChatView/chatContent.vue | 6 +++---
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/views/newMap/jointTrainingNew/newChatView/chatBox.vue b/src/views/newMap/jointTrainingNew/newChatView/chatBox.vue
index 30f6136e6..2e050a6cd 100644
--- a/src/views/newMap/jointTrainingNew/newChatView/chatBox.vue
+++ b/src/views/newMap/jointTrainingNew/newChatView/chatBox.vue
@@ -505,6 +505,7 @@ export default {
resp.data.forEach(conversation => {
messageList = [...messageList, ...conversation.messageList];
});
+ this.messageList = messageList;
}
});
this.conversitionMemberList = [];
diff --git a/src/views/newMap/jointTrainingNew/newChatView/chatContent.vue b/src/views/newMap/jointTrainingNew/newChatView/chatContent.vue
index 17de7f0c3..04b43dfc6 100644
--- a/src/views/newMap/jointTrainingNew/newChatView/chatContent.vue
+++ b/src/views/newMap/jointTrainingNew/newChatView/chatContent.vue
@@ -63,9 +63,9 @@ export default {
'$store.state.socket.conversationInfo':function (val, old) { // 仿真聊天
const conversationInfo = this.$store.state.socket.conversationInfo;
const member = this.$store.state.training.memberData[val.message.memberId];
- conversationInfo.src = `/audio/${conversationInfo.audioPath}`;
+ conversationInfo.message.src = `/audio/${conversationInfo.message.audioPath}`;
if (member) {
- conversationInfo.self = this.$store.state.userId == member.userId;
+ conversationInfo.message.self = this.$store.state.userId == member.userId;
}
if (this.conversitionId == val.id) {
this.$emit('changeMessageList', conversationInfo.message);
@@ -163,7 +163,7 @@ export default {
const member = this.$store.state.training.memberData[memberId];
if (member && member.userId) {
const user = this.simulationUsers[member.userId];
- name = member.lable + '(' + user.nickName + ')';
+ name = member.label + '(' + user.nickName + ')';
} else if (member) {
name = member.label;
}
From aced11181585ea3a55b8295cd4d842ade1ff4b86 Mon Sep 17 00:00:00 2001
From: fan <18706759286@163.com>
Date: Tue, 7 Jul 2020 14:11:04 +0800
Subject: [PATCH 3/4] =?UTF-8?q?=E8=81=8A=E5=A4=A9=E5=AE=A4=E8=B0=83?=
=?UTF-8?q?=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/jsxt/refereeList/menuReplay.vue | 2 +-
src/views/newMap/displayNew/index.vue | 15 +-
src/views/newMap/displayNew/menuDemon.vue | 2 +-
.../jointTrainingNew/chatView/chatBox.vue | 506 ------------------
.../jointTrainingNew/chatView/chatContent.vue | 290 ----------
.../chatView/chatCoversitionList.vue | 172 ------
.../chatView/chatCreateGroup.vue | 234 --------
.../chatView/chatMemberList.vue | 163 ------
.../jointTrainingNew/chatView/chatSetting.vue | 126 -----
.../jointTrainingNew/chatView/chatTooltip.vue | 110 ----
.../jointTrainingNew/newChatView/chatBox.vue | 21 +-
11 files changed, 33 insertions(+), 1608 deletions(-)
delete mode 100644 src/views/newMap/jointTrainingNew/chatView/chatBox.vue
delete mode 100644 src/views/newMap/jointTrainingNew/chatView/chatContent.vue
delete mode 100644 src/views/newMap/jointTrainingNew/chatView/chatCoversitionList.vue
delete mode 100644 src/views/newMap/jointTrainingNew/chatView/chatCreateGroup.vue
delete mode 100644 src/views/newMap/jointTrainingNew/chatView/chatMemberList.vue
delete mode 100644 src/views/newMap/jointTrainingNew/chatView/chatSetting.vue
delete mode 100644 src/views/newMap/jointTrainingNew/chatView/chatTooltip.vue
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 @@
-
-
-
-
-
-
-
-
-
- {{ covertName(chatContent.targetUser,true) }}
-
- {{ chatContent.message }}
-
-
-
-
-
-
-
-
-
-
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 @@
-
-
-
-
-
-
{{ coversition.name }}
-
-
-
-
-
-
-
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 @@
-
-
-
-
-
-
-
- {{ member.memberName }}
-
-
-
-
- {{ member.memberName }}
-
-
-
-
-
-
- 创建会话
- 取消
-
-
-
-
-
-
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 @@
-
-
-
成员列表
-
-
{{ member.memberName }}
-
-
-
-
-
-
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 2e050a6cd..071e9c0b1 100644
--- a/src/views/newMap/jointTrainingNew/newChatView/chatBox.vue
+++ b/src/views/newMap/jointTrainingNew/newChatView/chatBox.vue
@@ -498,14 +498,27 @@ 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];
+ (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);
+ });
});
- this.messageList = messageList;
+ this.messageList = messageList.sort(this.sortByMessageTime);
}
});
this.conversitionMemberList = [];
@@ -514,7 +527,7 @@ export default {
});
},
changeMessageList(data) {
- this.messageList.push(data);
+ this.messageList.push(data);
}
}
};
From f83a60bd88a339b9dc2d8cb1f41490d363a515bd Mon Sep 17 00:00:00 2001
From: fan <18706759286@163.com>
Date: Tue, 7 Jul 2020 14:58:10 +0800
Subject: [PATCH 4/4] =?UTF-8?q?=E8=81=8A=E5=A4=A9=E5=AE=A4=E8=B0=83?=
=?UTF-8?q?=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../jointTrainingNew/newChatView/chatBox.vue | 39 ++++++++++++++-----
src/views/studentManage/index.vue | 22 +++++------
2 files changed, 40 insertions(+), 21 deletions(-)
diff --git a/src/views/newMap/jointTrainingNew/newChatView/chatBox.vue b/src/views/newMap/jointTrainingNew/newChatView/chatBox.vue
index 071e9c0b1..2e057aee7 100644
--- a/src/views/newMap/jointTrainingNew/newChatView/chatBox.vue
+++ b/src/views/newMap/jointTrainingNew/newChatView/chatBox.vue
@@ -277,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);
}
@@ -508,15 +508,34 @@ export default {
if (resp.data && resp.data.length) {
const messageList = [];
resp.data.forEach(conversation => {
- (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);
- });
+ 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);
}
diff --git a/src/views/studentManage/index.vue b/src/views/studentManage/index.vue
index 90ea21845..67ae2fad0 100644
--- a/src/views/studentManage/index.vue
+++ b/src/views/studentManage/index.vue
@@ -331,30 +331,30 @@ export default {
item.scores.forEach(elem => {
if (elem.prdType === '01') {
this.showLocal = true;
- localExamSocreRadio = elem.examSocreRadio * 100 * 60 / 100 / item.scores.length;
- localLessonPassRate = elem.lessonPassRate * 100 * 30 / 100 / item.scores.length;
+ localExamSocreRadio = elem.examSocreRadio * 60 / item.scores.length;
+ localLessonPassRate = elem.lessonPassRate * 30 / item.scores.length;
totolScore += localExamSocreRadio * 100;
totolScore += localLessonPassRate * 100;
} else if (elem.prdType === '02') {
this.showCenter = true;
- centerExamSocreRadio = elem.examSocreRadio * 100 * 60 / 100 / item.scores.length;
- centerLessonPassRate = elem.lessonPassRate * 100 * 30 / 100 / item.scores.length;
+ centerExamSocreRadio = elem.examSocreRadio * 60 / item.scores.length;
+ centerLessonPassRate = elem.lessonPassRate * 30 / item.scores.length;
totolScore += centerExamSocreRadio * 100;
totolScore += centerLessonPassRate * 100;
}
});
- totolScore += item.attendance * 100 * 10 / 100 * 100;
+ totolScore += item.attendance * 100 * 10;
this.tableData.push(
{
index: index + 1,
name: item.name,
studentID: item.studentID,
- attendance: item.attendance * 100 * 10 / 100,
- localExamSocreRadio:localExamSocreRadio,
- localLessonPassRate: localLessonPassRate,
- centerExamSocreRadio: centerExamSocreRadio,
- centerLessonPassRate: centerLessonPassRate,
- totolScore: totolScore / 100
+ attendance: Math.round(item.attendance * 10) / 10,
+ localExamSocreRadio: Math.round(localExamSocreRadio * 10) / 10,
+ localLessonPassRate: Math.round(localLessonPassRate * 10) / 10,
+ centerExamSocreRadio: Math.round(centerExamSocreRadio * 10) / 10,
+ centerLessonPassRate: Math.round(centerLessonPassRate * 10) / 10,
+ totolScore: Math.round(totolScore) / 100
});
});
}).catch(() =>{