调整剧本会话@
This commit is contained in:
parent
71d3ff5d87
commit
0a7d3d97bd
@ -47,38 +47,16 @@ export default {
|
||||
formatTime(time) {
|
||||
return /\d{2}:\d{2}:\d{2}/.exec(time)[0] || time;
|
||||
},
|
||||
covertName(data) {
|
||||
if (data != 'All') {
|
||||
if (data instanceof Array) {
|
||||
let result = '';
|
||||
data.forEach(each=>{
|
||||
result += this.covertEachName(each);
|
||||
});
|
||||
return result;
|
||||
} else {
|
||||
const userInfoName = this.covertEachName(data);
|
||||
return userInfoName.slice(0, userInfoName.length - 1);
|
||||
}
|
||||
} else {
|
||||
return '@All';
|
||||
covertName(memberId) {
|
||||
let name = '';
|
||||
const member = this.$store.state.training.memberData[memberId];
|
||||
if (member && member.userId) {
|
||||
const user = this.simulationUsers[member.userId];
|
||||
name = member.label + '(' + user.nickName + ')';
|
||||
} else if (member) {
|
||||
name = member.label;
|
||||
}
|
||||
},
|
||||
covertEachName(data) {
|
||||
let deviceName = '';
|
||||
if (data.deviceCode) {
|
||||
const device = this.$store.getters['map/getDeviceByCode'](data.deviceCode);
|
||||
if (device) {
|
||||
if (device._type == 'Train') {
|
||||
deviceName = device.groupNumber;
|
||||
} else {
|
||||
deviceName = device.name;
|
||||
}
|
||||
} else {
|
||||
deviceName = data.deviceCode;
|
||||
}
|
||||
}
|
||||
const memberName = data.name ? '-' + data.name : '';
|
||||
return data.type + deviceName + memberName + ',';
|
||||
return name;
|
||||
},
|
||||
playAudio(audioUrl) {
|
||||
document.querySelector('#audioPlay').src = audioUrl;
|
||||
|
@ -4,7 +4,7 @@
|
||||
<div v-for="(chatContent,index) in messageList" :key="index" class="chatContentInClass">
|
||||
<div :class="chatContent.self?'rightUser':'leftUser'">
|
||||
<div class="userHeader">
|
||||
<div v-if="!chatContent.self" class="userName">{{ covertName(chatContent,false) }}</div>
|
||||
<div v-if="!chatContent.self" class="userName">{{ covertName(chatContent.memberId) }}</div>
|
||||
<div :class="chatContent.self?'userChatTime textRight':'userChatTime'">{{ chatContent.time }}</div>
|
||||
</div>
|
||||
<div class="userBubble" @click="playAudio(baseUrl+chatContent.src)">
|
||||
@ -122,21 +122,7 @@ export default {
|
||||
};
|
||||
});
|
||||
},
|
||||
covertName(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 this.covertEachName(data.memberId);
|
||||
}
|
||||
},
|
||||
covertEachName(memberId) {
|
||||
covertName(memberId) {
|
||||
let name = '';
|
||||
const member = this.$store.state.training.memberData[memberId];
|
||||
if (member && member.userId) {
|
||||
|
Loading…
Reference in New Issue
Block a user