From 9627e85bf0a824d91d2372b5ae00584f8a09d00a Mon Sep 17 00:00:00 2001 From: joylink_cuiweidong <364937672@qq.com> Date: Fri, 10 Jul 2020 18:06:55 +0800 Subject: [PATCH] =?UTF-8?q?=E5=89=A7=E6=9C=AC=E7=BC=96=E5=88=B6=20?= =?UTF-8?q?=E4=BC=9A=E8=AF=9D=E6=B6=88=E6=81=AF=E4=BB=A3=E7=A0=81=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../newMap/displayNew/chatView/chatBox.vue | 132 +++++++++--------- 1 file changed, 66 insertions(+), 66 deletions(-) diff --git a/src/views/newMap/displayNew/chatView/chatBox.vue b/src/views/newMap/displayNew/chatView/chatBox.vue index e492b8eaa..25f4ee623 100644 --- a/src/views/newMap/displayNew/chatView/chatBox.vue +++ b/src/views/newMap/displayNew/chatView/chatBox.vue @@ -55,7 +55,7 @@ import ChatCreateGroup from './chatCreateGroup'; import ChatMemberList from './chatMemberList'; import ChatTooltip from './chatTooltip'; import RecordRTC from 'recordrtc'; -import {sendSimulationConversition, overSimulationConversition, getSimulationMembersNew, getAllConversition, getSimulationConversition} from '@/api/chat'; +import {sendSimulationConversition, overSimulationConversition, getAllConversition, getSimulationConversition} from '@/api/chat'; import ConstConfig from '@/scripts/ConstConfig'; import Cookies from 'js-cookie'; export default { @@ -135,7 +135,6 @@ export default { const objectBottom = parseInt(object.style.bottom) || 0; this.bottom = this.bottom + object.offsetHeight + objectBottom; } - this.getSimulationMembers(); }, 'userRole':function(val) { this.isHasCoversition = false; @@ -196,77 +195,78 @@ export default { }, // 获取所有的成员列表 getSimulationMembers() { - getSimulationMembersNew(this.$route.query.group).then(resp => { - let lastData = JSON.stringify(resp.data); - const roleTypeList = ConstConfig.ConstSelect.roleTypeNew; - roleTypeList.forEach(function(element) { - const rolename = element.value; - if (Cookies.get('user_lang') == 'en') { - lastData = lastData.replace(new RegExp(rolename, 'g'), element.enLabel); - } else { - lastData = lastData.replace(new RegExp(rolename, 'g'), element.label); - } - }); - lastData = JSON.parse(lastData); - const activeList = this.$store.state.map.activeTrainList; - const memberList = []; - // lastData = lastData.filter(memberIn=>{ return memberIn.role != '观众'; }); - lastData.forEach((member, index)=>{ - if (member.type != '观众') { - const name = member.name == undefined ? '' : '-' + member.name; - if (member.deviceCode) { - const device = this.$store.getters['map/getDeviceByCode'](member.deviceCode); - if (device) { - if (device._type == 'Train') { - member.memberName = member.type + device.groupNumber + name; - if (activeList.length > 0 && activeList.includes(device.groupNumber)) { - memberList.push(member); - } - } else { - member.memberName = member.type + device.name + name; - memberList.push(member); + const memberList = this.$store.state.training.memberData; + let lastData = JSON.stringify(memberList); + const roleTypeList = ConstConfig.ConstSelect.roleTypeNew; + roleTypeList.forEach(function(element) { + const rolename = element.value; + if (Cookies.get('user_lang') == 'en') { + lastData = lastData.replace(new RegExp(rolename, 'g'), element.enLabel); + } else { + lastData = lastData.replace(new RegExp(rolename, 'g'), element.label); + } + }); + lastData = JSON.parse(lastData); + const activeList = this.$store.state.map.activeTrainList; + lastData = Object.values(lastData); + const lastMemberList = []; + lastData.forEach((member, index)=>{ + if (member.type != '观众') { + const name = member.name == undefined ? '' : '-' + member.name; + if (member.deviceCode) { + const device = this.$store.getters['map/getDeviceByCode'](member.deviceCode); + if (device) { + if (device._type == 'Train') { + member.memberName = member.type + device.groupNumber + name; + if (activeList.length > 0 && activeList.includes(device.groupNumber)) { + lastMemberList.push(member); } } else { - member.memberName = member.type + member.deviceCode + name; - memberList.push(member); + member.memberName = member.type + device.name + name; + lastMemberList.push(member); } } else { - member.memberName = member.type + name; - memberList.push(member); + member.memberName = member.type + member.deviceCode + name; + lastMemberList.push(member); } - } - }); - this.memberList = memberList; - - if (this.recordSending) { - this.cancleRecording(); - } - // 获取会话列表 - getAllConversition(this.$route.query.group).then(resp=>{ - if (resp.data && resp.data.length && resp.data.length > 0) { - this.isCreate = false; - const coversitionList = resp.data; - let memberListCoversition = {}; - coversitionList.forEach(coversition=>{ - if (!coversition.over) { - const memberList = coversition.memberList; - memberList.forEach(member=>{ - if (member.memberId == this.$store.state.scriptRecord.updateRoleId) { - memberListCoversition = {id:coversition.id, all:null}; - if (member.memberId == coversition.creatorId) { - this.isCreate = true; - } - } - }); - } - }); - this.memberListCoversition = memberListCoversition; } else { - this.isCreate = false; - this.memberListCoversition = {}; + member.memberName = member.type + name; + lastMemberList.push(member); } - this.getSimulationConverMembers(); - }); + } + }); + this.memberList = lastMemberList; + this.getAllConversition(); + }, + getAllConversition() { + if (this.recordSending) { + this.cancleRecording(); + } + // 获取会话列表 + getAllConversition(this.$route.query.group).then(resp=>{ + if (resp.data && resp.data.length && resp.data.length > 0) { + this.isCreate = false; + const coversitionList = resp.data; + let memberListCoversition = {}; + coversitionList.forEach(coversition=>{ + if (!coversition.over) { + const memberList = coversition.memberList; + memberList.forEach(member=>{ + if (member.memberId == this.$store.state.scriptRecord.updateRoleId) { + memberListCoversition = {id:coversition.id, all:null}; + if (member.memberId == coversition.creatorId) { + this.isCreate = true; + } + } + }); + } + }); + this.memberListCoversition = memberListCoversition; + } else { + this.isCreate = false; + this.memberListCoversition = {}; + } + this.getSimulationConverMembers(); }); }, // 获取当前对话的信息