Merge branch 'test' of https://git.code.tencent.com/lian-cbtc/jl-client into test
This commit is contained in:
commit
8663a4fba0
@ -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);
|
||||
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;
|
||||
}
|
||||
} else {
|
||||
return '@All';
|
||||
}
|
||||
},
|
||||
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) {
|
||||
|
@ -192,6 +192,8 @@ export default {
|
||||
this.deviceShow = true;
|
||||
}
|
||||
if (this.$route.query.type === 'DRIVE') {
|
||||
this.$store.dispatch('training/setPrdType', '04');
|
||||
this.$store.dispatch('training/setRoles', 'DRIVER');
|
||||
this.hidepanel();
|
||||
}
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user