2020-07-21 15:15:28 +08:00
|
|
|
<template>
|
2020-09-11 17:10:11 +08:00
|
|
|
<div class="chatBox" :class="{'active': drawer}" :style="{'bottom':bottom+'px'}">
|
2020-07-31 18:49:35 +08:00
|
|
|
<div class="menuTrainListBtn" @click="clickBtn">
|
2020-09-24 18:34:25 +08:00
|
|
|
<template v-if="userRole == 'DISPATCHER'">
|
|
|
|
<p style="margin: 0;">调</p>
|
|
|
|
<p style="margin: 0;">度</p>
|
|
|
|
<p style="margin: 0;">电</p>
|
|
|
|
<p style="margin: 0;">话</p>
|
|
|
|
</template>
|
|
|
|
<template v-if="userRole != 'AUDIENCE' && userRole != 'DISPATCHER'">
|
|
|
|
<p style="margin: 0;">电</p>
|
|
|
|
<p style="margin: 0;">话</p>
|
|
|
|
</template>
|
|
|
|
<template v-if="userRole == 'AUDIENCE'">
|
|
|
|
<p style="margin: 0;">通</p>
|
|
|
|
<p style="margin: 0;">话</p>
|
|
|
|
<p style="margin: 0;">记</p>
|
|
|
|
<p style="margin: 0;">录</p>
|
|
|
|
</template>
|
2020-07-31 18:49:35 +08:00
|
|
|
</div>
|
|
|
|
<div class="chat-box-main">
|
2020-09-24 17:25:52 +08:00
|
|
|
<!-- v-if="!conversitionId && userRole !== 'AUDIENCE' && !commonConversation" -->
|
|
|
|
<template v-if="userRole != 'AUDIENCE'">
|
2020-09-11 17:10:11 +08:00
|
|
|
<div class="chat-box-header">
|
2020-09-24 17:25:52 +08:00
|
|
|
<!-- <div class="chat-box-header-title">
|
2020-09-11 17:10:11 +08:00
|
|
|
<el-input v-model="queryMember" size="small" placeholder="请输入搜索人员">
|
|
|
|
<el-button slot="append" icon="el-icon-search" />
|
|
|
|
</el-input>
|
2020-09-24 17:25:52 +08:00
|
|
|
</div> -->
|
2020-09-11 17:10:11 +08:00
|
|
|
<div class="chat-setting" @click="handleSetting()">
|
|
|
|
<i class="el-icon-s-tools" />
|
|
|
|
</div>
|
2020-09-24 17:25:52 +08:00
|
|
|
<!-- <div v-if="!commonConversation" class="chat-setting" @click="goCommonConversation">
|
2020-09-11 17:10:11 +08:00
|
|
|
<el-tooltip effect="dark" content="公共会话" placement="top-start">
|
|
|
|
<i class="el-icon-chat-line-round" />
|
|
|
|
</el-tooltip>
|
|
|
|
</div>
|
|
|
|
<div v-if="conversitionId && commonConversation" class="chat-setting" @click="cancelCommonConversation">
|
|
|
|
<el-tooltip effect="dark" content="私有会话" placement="top-start">
|
|
|
|
<i class="el-icon-chat-round" />
|
|
|
|
</el-tooltip>
|
2020-09-24 17:25:52 +08:00
|
|
|
</div> -->
|
2020-07-31 18:49:35 +08:00
|
|
|
</div>
|
2020-09-11 17:10:11 +08:00
|
|
|
<div class="chat-box-content">
|
2020-09-24 17:25:52 +08:00
|
|
|
<div v-for="(item, index) in treeData" :key="index" class="proper_box">
|
|
|
|
<div class="proper_title">{{ item.label }}</div>
|
2020-09-25 17:15:25 +08:00
|
|
|
<div v-for="(data, i) in item.children" :key="i" style="position: relative; width: 73px; heigth: 73px; margin-left: 5px; float: left;">
|
2020-09-24 19:04:33 +08:00
|
|
|
<div v-if="data.show && item.id == 'driver'" class="proper_content_box" :class="{'active': data.active}" @click="handleCheckChange(data)">{{ data.label + (data.userId? '(' + (simulationUsers[data.userId]||{}).nickName + ')': '') }}</div>
|
2020-09-24 17:25:52 +08:00
|
|
|
<div v-if="item.id != 'driver'" class="proper_content_box" :class="{'active':data.active}" @click="handleCheckChange(data)">{{ data.label + (data.userId? '(' + (simulationUsers[data.userId]||{}).nickName + ')': '') }}</div>
|
2020-09-25 17:15:25 +08:00
|
|
|
<div v-if="data.loading" class="mask_loading">
|
2020-09-24 17:25:52 +08:00
|
|
|
<i class="el-icon-loading" style="margin-bottom: 4px;" />
|
|
|
|
<span>呼叫中</span>
|
|
|
|
</div>
|
2020-09-29 13:18:31 +08:00
|
|
|
<div v-if="data.isConnect||data.disabled" class="content_connect" />
|
2020-09-24 17:25:52 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="chat-box-content1">
|
|
|
|
<chat-content
|
|
|
|
ref="chatContent"
|
|
|
|
:project="project"
|
|
|
|
:is-answering="IsAnswering"
|
|
|
|
:conversition-id="conversitionId"
|
|
|
|
:conversition-member-list="conversitionMemberList"
|
|
|
|
:message-list="messageList"
|
|
|
|
:my-member-id="myMemberId"
|
|
|
|
:simulation-users="simulationUsers"
|
|
|
|
:common-conversation="commonConversation"
|
|
|
|
:user-role="userRole"
|
|
|
|
@changeMessageList="changeMessageList"
|
|
|
|
/>
|
2020-09-11 17:10:11 +08:00
|
|
|
</div>
|
|
|
|
<div class="chat-box-footer">
|
2020-09-24 17:25:52 +08:00
|
|
|
<div v-if="!conversitionId">
|
|
|
|
<div style="width: 400px;font-size: 14px;line-height: 38px; padding-left: 10px;">{{ userString }}</div>
|
2020-09-24 17:55:06 +08:00
|
|
|
<el-button size="mini" type="primary" class="chat-box-footer-create" :loading="createLoading" @click="createCoversition()">
|
|
|
|
<i class="el-icon-phone" />
|
|
|
|
</el-button>
|
2020-09-24 17:25:52 +08:00
|
|
|
</div>
|
|
|
|
<div v-else>
|
2020-09-24 17:55:06 +08:00
|
|
|
<el-button v-if="isButtonShow && !commonConversation" size="mini" type="danger" class="chat-box-footer-create chat-box-footer-quit" :loading="quitLoading" @click="quitConversition()">
|
|
|
|
<i class="el-icon-phone" />
|
|
|
|
</el-button>
|
2020-09-25 13:58:41 +08:00
|
|
|
<el-button v-if="isButtonShow && !commonConversation" class="chat-box-footer-create chat-box-footer-send" :class="{'active': recordSending}" size="mini" type="primary" @click="startRecording()">
|
|
|
|
<el-progress id="record_progress_bar" type="circle" :show-text="false" :percentage="100/60*seconds" :width="40" :stroke-width="2" status="success" />
|
|
|
|
<i v-if="recordSending" class="el-icon-close close_icon" @click.stop="cancleRecording()" />
|
|
|
|
<span class="iconfont icon-yuyin"></span>
|
|
|
|
</el-button>
|
2020-09-24 17:25:52 +08:00
|
|
|
</div>
|
2020-09-11 17:10:11 +08:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
<template v-else>
|
|
|
|
<div class="chat-box-header">
|
|
|
|
<div class="chat-setting" @click="handleSetting()">
|
|
|
|
<i class="el-icon-s-tools" />
|
|
|
|
</div>
|
2020-09-24 17:25:52 +08:00
|
|
|
<!-- <div v-if="!conversitionId && userRole !== 'AUDIENCE'" class="chat-setting" @click="cancelCommonConversation">
|
2020-09-11 17:10:11 +08:00
|
|
|
<el-tooltip effect="dark" content="成员列表" placement="top-start">
|
|
|
|
<i class="el-icon-s-custom" />
|
|
|
|
</el-tooltip>
|
2020-09-24 17:25:52 +08:00
|
|
|
</div> -->
|
|
|
|
<!-- <div v-if="!commonConversation" class="chat-setting" @click="goCommonConversation">
|
2020-09-11 17:10:11 +08:00
|
|
|
<el-tooltip effect="dark" content="公共会话" placement="top-start">
|
|
|
|
<i class="el-icon-chat-line-round" />
|
|
|
|
</el-tooltip>
|
|
|
|
</div>
|
|
|
|
<div v-if="conversitionId && commonConversation" class="chat-setting" @click="cancelCommonConversation">
|
|
|
|
<el-tooltip effect="dark" content="私有会话" placement="top-start">
|
|
|
|
<i class="el-icon-chat-round" />
|
|
|
|
</el-tooltip>
|
2020-09-24 17:25:52 +08:00
|
|
|
</div> -->
|
2020-07-31 18:49:35 +08:00
|
|
|
</div>
|
2020-09-24 17:25:52 +08:00
|
|
|
<div class="chat-box-content chat-box-content_audience">
|
2020-09-11 17:10:11 +08:00
|
|
|
<chat-content
|
|
|
|
ref="chatContent"
|
|
|
|
:project="project"
|
|
|
|
:is-answering="IsAnswering"
|
|
|
|
:conversition-id="conversitionId"
|
|
|
|
:conversition-member-list="conversitionMemberList"
|
|
|
|
:message-list="messageList"
|
|
|
|
:my-member-id="myMemberId"
|
|
|
|
:simulation-users="simulationUsers"
|
|
|
|
:common-conversation="commonConversation"
|
|
|
|
:user-role="userRole"
|
2020-09-24 17:25:52 +08:00
|
|
|
width="360px"
|
2020-09-11 17:10:11 +08:00
|
|
|
@changeMessageList="changeMessageList"
|
|
|
|
/>
|
|
|
|
<chat-member-list ref="chatMemberList" :conversition-member-list="conversitionMemberList" :simulation-users="simulationUsers" />
|
2020-07-31 18:49:35 +08:00
|
|
|
</div>
|
2020-09-11 17:10:11 +08:00
|
|
|
</template>
|
2020-07-21 15:15:28 +08:00
|
|
|
</div>
|
|
|
|
<chat-setting ref="chatSetting" :form="form" @setSetting="setSetting" />
|
2020-09-25 17:15:25 +08:00
|
|
|
<chat-tooltip ref="chatToolTip" :group="group" :conversition-id="conversitionId" :invite-user-name="inviteUserName" @acceptUser="acceptUser" />
|
|
|
|
|
2020-07-21 15:15:28 +08:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
<script>
|
2020-09-25 17:15:25 +08:00
|
|
|
import ChatTooltip from './chatTooltip';
|
2020-07-21 15:15:28 +08:00
|
|
|
import ChatSetting from './chatSetting';
|
|
|
|
import ChatContent from './chatContent';
|
2020-09-11 17:10:11 +08:00
|
|
|
import ChatMemberList from './chatMemberList';
|
2020-07-21 19:27:32 +08:00
|
|
|
import RecordRTC from 'recordrtc';
|
2020-09-11 17:10:11 +08:00
|
|
|
import {sendSimulationConversition, startConversition, overSimulationConversition, getAllConversition} from '@/api/chat';
|
|
|
|
import { getSessionStorage } from '@/utils/auth';
|
2020-07-21 15:15:28 +08:00
|
|
|
export default {
|
2020-09-11 17:10:11 +08:00
|
|
|
name: 'ChatBox',
|
2020-07-21 15:15:28 +08:00
|
|
|
components:{
|
|
|
|
ChatSetting,
|
2020-07-22 17:20:24 +08:00
|
|
|
ChatContent,
|
2020-09-25 17:15:25 +08:00
|
|
|
ChatMemberList,
|
|
|
|
ChatTooltip
|
2020-07-21 15:15:28 +08:00
|
|
|
},
|
2020-09-11 17:10:11 +08:00
|
|
|
props: {
|
2020-07-21 15:15:28 +08:00
|
|
|
group: {
|
|
|
|
type: String,
|
|
|
|
required: true
|
|
|
|
},
|
2020-09-11 17:10:11 +08:00
|
|
|
userRole: {
|
2020-07-21 15:15:28 +08:00
|
|
|
type: String,
|
|
|
|
required: true
|
|
|
|
}
|
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
2020-07-31 18:49:35 +08:00
|
|
|
drawer: false,
|
2020-07-21 15:15:28 +08:00
|
|
|
bottom:15,
|
|
|
|
recordSending:false,
|
2020-09-11 17:10:11 +08:00
|
|
|
commonConversation: false,
|
2020-07-21 15:15:28 +08:00
|
|
|
seconds:0,
|
|
|
|
inter:null,
|
2020-09-11 17:10:11 +08:00
|
|
|
recorders: null,
|
2020-07-21 19:27:32 +08:00
|
|
|
microphone:null,
|
2020-09-11 17:10:11 +08:00
|
|
|
createLoading:false,
|
2020-09-25 17:15:25 +08:00
|
|
|
inviteUserName:'',
|
2020-09-11 17:10:11 +08:00
|
|
|
form:{
|
|
|
|
language:'zh',
|
|
|
|
sex:'1'
|
|
|
|
},
|
|
|
|
treeData: [],
|
|
|
|
defaultProps: {
|
|
|
|
children: 'children',
|
|
|
|
label: 'label'
|
|
|
|
},
|
2020-09-24 17:25:52 +08:00
|
|
|
// queryMember: '',
|
2020-09-11 17:10:11 +08:00
|
|
|
activeTrains: [],
|
|
|
|
firstClick: true,
|
|
|
|
memberData: {},
|
|
|
|
simulationUsers: {},
|
|
|
|
userString: '',
|
|
|
|
memberIdList: [],
|
2020-09-25 15:22:54 +08:00
|
|
|
memberObject: '',
|
2020-09-11 17:10:11 +08:00
|
|
|
quitLoading: false,
|
|
|
|
conversitionMemberList: [],
|
|
|
|
commonMemberList: [],
|
2020-09-24 17:25:52 +08:00
|
|
|
messageList: [], // 消息列表
|
2020-09-11 17:10:11 +08:00
|
|
|
commonMessageList: [],
|
|
|
|
temData: [],
|
|
|
|
conversitionStateMap:{},
|
|
|
|
myMemberId: ''
|
2020-07-21 15:15:28 +08:00
|
|
|
};
|
|
|
|
},
|
2020-09-11 17:10:11 +08:00
|
|
|
computed:{
|
|
|
|
isButtonShow() {
|
|
|
|
return this.userRole != 'AUDIENCE';
|
|
|
|
},
|
|
|
|
project() {
|
|
|
|
return getSessionStorage('project');
|
|
|
|
},
|
|
|
|
IsAnswering() {
|
|
|
|
return !(this.$route.path.includes('refereeJsxtDisplay'));
|
|
|
|
},
|
|
|
|
userId() {
|
|
|
|
return this.$store.state.user.id;
|
|
|
|
},
|
|
|
|
conversitionId() {
|
2020-09-25 18:41:59 +08:00
|
|
|
console.log(this.conversitionStateMap, this.myMemberId, this.conversitionStateMap[this.myMemberId], (this.conversitionStateMap[this.myMemberId] || {conversitionId:''}));
|
2020-09-11 17:10:11 +08:00
|
|
|
return (this.conversitionStateMap[this.myMemberId] || {conversitionId:''}).conversitionId;
|
|
|
|
},
|
|
|
|
privateMemberList() {
|
|
|
|
return (this.conversitionStateMap[this.myMemberId] || {privateMemberList: []}).privateMemberList;
|
|
|
|
},
|
|
|
|
privateMessageList() {
|
|
|
|
return (this.conversitionStateMap[this.myMemberId] || {privateMessageList: []}).privateMessageList;
|
|
|
|
}
|
|
|
|
},
|
2020-07-21 15:15:28 +08:00
|
|
|
watch:{
|
2020-09-24 17:25:52 +08:00
|
|
|
// queryMember(val) {
|
|
|
|
// if (this.$refs.tree) {
|
|
|
|
// this.$refs.tree.filter(val);
|
|
|
|
// }
|
|
|
|
// },
|
2020-09-11 17:10:11 +08:00
|
|
|
conversitionId(val) {
|
|
|
|
if (val) {
|
|
|
|
this.conversitionMemberList = this.privateMemberList;
|
|
|
|
this.messageList = [...this.privateMessageList];
|
|
|
|
}
|
|
|
|
},
|
|
|
|
userRole(val) {
|
|
|
|
if (val === 'AUDIENCE') {
|
|
|
|
this.goCommonConversation();
|
|
|
|
this.myMemberId = '';
|
|
|
|
} else {
|
|
|
|
this.myMemberId = (this.simulationUsers[this.userId] || {}).memberId;
|
2020-09-25 18:41:59 +08:00
|
|
|
this.cancelCommonConversation();
|
2020-09-11 17:10:11 +08:00
|
|
|
}
|
|
|
|
},
|
2020-09-25 18:41:59 +08:00
|
|
|
'$store.state.map.mapViewLoadedCount': function(val) {
|
2020-09-11 17:10:11 +08:00
|
|
|
const object = document.querySelector('.menuButton');
|
|
|
|
if (object) {
|
|
|
|
const objectBottom = object.offsetHeight || 0;
|
|
|
|
this.bottom = objectBottom + 15;
|
|
|
|
} else {
|
|
|
|
this.bottom = 15;
|
|
|
|
}
|
|
|
|
this.isAudienceInitData();
|
|
|
|
},
|
|
|
|
'$store.state.training.prdType': function(val) {
|
|
|
|
this.$nextTick(() => {
|
|
|
|
const object = document.querySelector('.menuButton');
|
|
|
|
if (object) {
|
|
|
|
const objectBottom = object.offsetHeight || 0;
|
|
|
|
this.bottom = objectBottom + 15;
|
|
|
|
} else {
|
|
|
|
this.bottom = 15;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
},
|
|
|
|
'$store.state.socket.createConversition':function(val) {
|
|
|
|
val.memberList.forEach(member => {
|
|
|
|
this.$set(this.conversitionStateMap, member.memberId, {conversitionId: val.id, privateMemberList: val.memberList, privateMessageList: []});
|
|
|
|
});
|
|
|
|
},
|
2020-09-25 17:15:25 +08:00
|
|
|
'$store.state.socket.inviteSimulationConversition':function(val) {
|
|
|
|
const inviteUser = this.memberData[val.creatorId];
|
|
|
|
this.inviteUserName = inviteUser.label;
|
|
|
|
this.$refs.chatToolTip.doShow();
|
|
|
|
},
|
2020-09-11 17:10:11 +08:00
|
|
|
'$store.state.map.activeTrainListChange': function (val) { // 按计划行车的列车列表更新标识
|
|
|
|
this.activeTrains = [];
|
|
|
|
const activeTrainList = this.$store.state.map.activeTrainList;
|
|
|
|
if (activeTrainList && activeTrainList.length) {
|
|
|
|
activeTrainList.forEach(groupNumber => {
|
|
|
|
this.activeTrains.push(groupNumber);
|
|
|
|
});
|
|
|
|
}
|
2020-09-24 17:25:52 +08:00
|
|
|
this.filterNode();
|
|
|
|
// if (this.$refs.tree) {
|
|
|
|
// this.$refs.tree.filter(this.queryMember);
|
|
|
|
// }
|
2020-09-11 17:10:11 +08:00
|
|
|
},
|
|
|
|
'$store.state.training.simulationUserList': {
|
|
|
|
handler(val, o) {
|
|
|
|
this.simulationUsers = {};
|
|
|
|
if (val && val.length) {
|
|
|
|
val.forEach(user => {
|
|
|
|
this.simulationUsers[user.userId] = user;
|
|
|
|
});
|
|
|
|
this.myMemberId = this.simulationUsers[this.userId].memberId;
|
|
|
|
}
|
|
|
|
},
|
|
|
|
deep: true
|
|
|
|
},
|
|
|
|
'$store.state.socket.exitConversition': function (val) {
|
|
|
|
for (const memberId in this.conversitionStateMap) {
|
|
|
|
if (memberId == val.memberId) {
|
|
|
|
this.conversitionStateMap[memberId].conversitionId = '';
|
|
|
|
this.conversitionStateMap[memberId].privateMemberList = [];
|
|
|
|
this.conversitionStateMap[memberId].privateMessageList = [];
|
|
|
|
} else if ( this.conversitionStateMap[memberId].conversitionId == val.id ) {
|
|
|
|
const mList = [];
|
|
|
|
this.conversitionStateMap[memberId].privateMemberList.forEach(member => {
|
|
|
|
if (member.memberId != val.memberId) {
|
|
|
|
mList.push(member);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
this.conversitionStateMap[memberId].privateMemberList = mList;
|
|
|
|
}
|
|
|
|
}
|
2020-09-24 17:25:52 +08:00
|
|
|
// 有人退出会话更新人员列表
|
|
|
|
this.treeData.forEach(item => {
|
|
|
|
if (item.children && item.children.length) {
|
|
|
|
item.children.forEach(data =>{
|
|
|
|
if (data.id == val.memberId) {
|
|
|
|
data.active = false;
|
2020-09-29 13:18:31 +08:00
|
|
|
data.isConnect = false;
|
2020-09-29 13:30:12 +08:00
|
|
|
data.disabled = false;
|
2020-09-24 17:25:52 +08:00
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
});
|
2020-09-11 17:10:11 +08:00
|
|
|
},
|
|
|
|
'$store.state.training.memberList': function (val) {
|
|
|
|
if (val && val.length) {
|
2020-09-24 19:04:33 +08:00
|
|
|
this.memberData = this.$store.state.training.memberData;
|
2020-09-11 17:10:11 +08:00
|
|
|
const dispatcherList = [];
|
|
|
|
const electricDispatcherList = [];
|
|
|
|
const depotDispatcherList = [];
|
|
|
|
const stationSupervisorList = [];
|
|
|
|
const driverList = [];
|
|
|
|
const maintainerList = [];
|
|
|
|
val.forEach(item => {
|
|
|
|
const device = this.$store.getters['map/getDeviceByCode'](item.deviceCode);
|
2020-09-24 17:25:52 +08:00
|
|
|
this.memberData[item.id]['active'] = false;
|
|
|
|
this.memberData[item.id]['loading'] = false;
|
2020-09-11 17:10:11 +08:00
|
|
|
switch (item.type) {
|
|
|
|
case 'DISPATCHER':
|
|
|
|
this.memberData[item.id].label = '行调' + (item.name || '');
|
|
|
|
dispatcherList.push(this.memberData[item.id]);
|
|
|
|
break;
|
|
|
|
case 'ELECTRIC_DISPATCHER':
|
|
|
|
electricDispatcherList.push(this.memberData[item.id]);
|
|
|
|
break;
|
|
|
|
case 'DEPOT_DISPATCHER':
|
|
|
|
this.memberData[item.id].label = '车辆段';
|
|
|
|
depotDispatcherList.push(this.memberData[item.id]);
|
|
|
|
break;
|
|
|
|
case 'STATION_SUPERVISOR':
|
2020-09-24 17:25:52 +08:00
|
|
|
this.memberData[item.id].label = device.name;
|
|
|
|
// this.memberData[item.id].label = '值班员-' + device.name;
|
2020-09-11 17:10:11 +08:00
|
|
|
stationSupervisorList.push(this.memberData[item.id]);
|
|
|
|
break;
|
|
|
|
case 'DRIVER':
|
2020-09-24 17:25:52 +08:00
|
|
|
// this.memberData[item.id].label = '司机-列车' + item.deviceCode;
|
|
|
|
this.memberData[item.id]['show'] = false;
|
|
|
|
this.memberData[item.id].label = item.deviceCode;
|
2020-09-11 17:10:11 +08:00
|
|
|
driverList.push(this.memberData[item.id]);
|
|
|
|
break;
|
|
|
|
case 'MAINTAINER':
|
|
|
|
this.memberData[item.id].label = '通号' + (item.name || '');
|
2020-09-24 17:25:52 +08:00
|
|
|
// this.memberData[item.id].label = item.name || '';
|
2020-09-11 17:10:11 +08:00
|
|
|
maintainerList.push(this.memberData[item.id]);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
});
|
2020-09-25 15:22:54 +08:00
|
|
|
// { label: '全部集中站', value: 'allConcentrateStation', active: false, sign: 'DEVICE_STATION' },
|
|
|
|
stationSupervisorList.push({ label: '全部车站', value: 'allStation', active: false, sign: 'ALL_STATION' });
|
|
|
|
driverList.push({ label: '所有列车', value: 'allTrain', show: false, active: false, sign: 'ALL_TRAIN' });
|
2020-09-11 17:10:11 +08:00
|
|
|
this.treeData = [{
|
|
|
|
label: '行调',
|
|
|
|
id: 'dispatcher',
|
|
|
|
type: 'role',
|
|
|
|
children: dispatcherList
|
|
|
|
}, {
|
|
|
|
label: '车站值班员',
|
|
|
|
id: 'stationSupervisor',
|
|
|
|
type: 'role',
|
|
|
|
children: stationSupervisorList
|
|
|
|
}, {
|
|
|
|
label: '司机',
|
|
|
|
id: 'driver',
|
|
|
|
type: 'role',
|
|
|
|
children: driverList
|
|
|
|
}, {
|
|
|
|
label: '通号',
|
|
|
|
id: 'maintainer',
|
|
|
|
type: 'role',
|
|
|
|
children: maintainerList
|
|
|
|
}, {
|
|
|
|
label: '车辆段',
|
|
|
|
id: 'depotDispatcher',
|
|
|
|
type: 'role',
|
|
|
|
children: depotDispatcherList
|
|
|
|
}];
|
|
|
|
this.temData = [...dispatcherList, ...stationSupervisorList, ...driverList, ...maintainerList, ...depotDispatcherList];
|
|
|
|
this.initCommonMemberList();
|
2020-09-24 17:25:52 +08:00
|
|
|
// this.$nextTick(() => {
|
|
|
|
// if (this.$refs.tree) {
|
|
|
|
// this.$refs.tree.filter(this.queryMember);
|
|
|
|
// }
|
|
|
|
// });
|
2020-09-11 17:10:11 +08:00
|
|
|
}
|
|
|
|
},
|
|
|
|
'$store.state.socket.simulationReset': function () {
|
|
|
|
this.conversitionStateMap = {};
|
2020-09-25 17:15:25 +08:00
|
|
|
},
|
|
|
|
'$store.state.socket.acceptConversionInvite':function(val) {
|
2020-09-25 17:33:18 +08:00
|
|
|
if (this.conversitionId == val.id) {
|
|
|
|
this.treeData.forEach(data => {
|
|
|
|
data.children && data.children.forEach(item => {
|
|
|
|
if (val.memberId == item.id && val.memberId != this.myMemberId) {
|
|
|
|
if (item.active) {
|
|
|
|
item.loading = false;
|
2020-09-29 13:18:31 +08:00
|
|
|
item.isConnect = true;
|
2020-09-25 17:33:18 +08:00
|
|
|
} else {
|
|
|
|
item.active = true;
|
2020-09-29 13:18:31 +08:00
|
|
|
item.isConnect = true;
|
2020-09-25 17:33:18 +08:00
|
|
|
}
|
2020-09-25 17:15:25 +08:00
|
|
|
}
|
2020-09-25 17:33:18 +08:00
|
|
|
});
|
2020-09-25 17:15:25 +08:00
|
|
|
});
|
2020-09-25 17:33:18 +08:00
|
|
|
}
|
2020-07-21 15:15:28 +08:00
|
|
|
}
|
|
|
|
},
|
2020-09-11 17:10:11 +08:00
|
|
|
mounted() {
|
|
|
|
this.firstClick = true;
|
2020-09-24 17:25:52 +08:00
|
|
|
this.$nextTick(() => {
|
|
|
|
this.filterNode();
|
|
|
|
});
|
2020-09-11 17:10:11 +08:00
|
|
|
},
|
2020-07-21 15:15:28 +08:00
|
|
|
methods:{
|
2020-09-25 18:41:59 +08:00
|
|
|
getUserRole() {
|
|
|
|
if (this.userRole === 'AUDIENCE') {
|
|
|
|
this.goCommonConversation();
|
|
|
|
this.myMemberId = '';
|
|
|
|
} else {
|
|
|
|
this.myMemberId = (this.simulationUsers[this.userId] || {}).memberId;
|
|
|
|
this.cancelCommonConversation();
|
|
|
|
}
|
|
|
|
},
|
2020-07-31 18:49:35 +08:00
|
|
|
clickBtn() {
|
2020-07-29 16:15:39 +08:00
|
|
|
if (this.drawer) {
|
|
|
|
this.drawer = false;
|
|
|
|
} else {
|
|
|
|
this.drawer = true;
|
2020-09-24 17:25:52 +08:00
|
|
|
// this.$nextTick(() => {
|
|
|
|
// if (this.$refs.tree) {
|
|
|
|
// this.$refs.tree.filter(this.queryMember);
|
|
|
|
// }
|
|
|
|
// });
|
2020-07-21 19:27:32 +08:00
|
|
|
}
|
2020-07-21 15:15:28 +08:00
|
|
|
},
|
2020-09-25 17:15:25 +08:00
|
|
|
acceptUser(memberId) {
|
|
|
|
this.treeData.forEach(data => {
|
|
|
|
data.children && data.children.forEach(item => {
|
|
|
|
if (memberId == item.id) {
|
|
|
|
item.active = true;
|
2020-09-29 13:18:31 +08:00
|
|
|
item.isConnect = true;
|
2020-09-25 17:15:25 +08:00
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
2020-07-21 15:15:28 +08:00
|
|
|
setSetting(data) {
|
|
|
|
this.form = data;
|
|
|
|
},
|
2020-09-24 17:25:52 +08:00
|
|
|
// 创建会话 拨打电话
|
2020-09-11 17:10:11 +08:00
|
|
|
createCoversition() {
|
2020-09-29 13:18:31 +08:00
|
|
|
if (this.memberIdList.length || this.memberObject) {
|
2020-09-11 17:10:11 +08:00
|
|
|
this.createLoading = true;
|
2020-09-29 13:18:31 +08:00
|
|
|
if (this.memberIdList.length > 0) {
|
|
|
|
// this.memberObject
|
|
|
|
this.treeData.forEach(data => {
|
|
|
|
data.children && data.children.forEach(item => {
|
|
|
|
if (item.active) {
|
|
|
|
item.loading = true;
|
|
|
|
}
|
|
|
|
});
|
2020-09-25 17:15:25 +08:00
|
|
|
});
|
2020-09-29 13:18:31 +08:00
|
|
|
} else {
|
|
|
|
// allTrain
|
|
|
|
if (this.memberObject == 'ALL_STATION') {
|
|
|
|
const stationList = this.treeData[1].children;
|
|
|
|
const length = stationList.length;
|
|
|
|
stationList.forEach((item, index) => {
|
|
|
|
if (index != length - 1) {
|
|
|
|
item.active = true;
|
|
|
|
item.loading = true;
|
|
|
|
} else {
|
|
|
|
item.active = false;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
2020-09-25 15:22:54 +08:00
|
|
|
startConversition(this.group, this.memberIdList, this.memberObject).then(resp => {
|
2020-09-29 13:18:31 +08:00
|
|
|
if (this.memberObject == 'ALL_STATION') {
|
|
|
|
const stationList = this.treeData[1].children;
|
|
|
|
const length = stationList.length;
|
|
|
|
stationList[length - 1].active = false;
|
|
|
|
stationList[length - 1].isConnect = true;
|
|
|
|
}
|
2020-09-11 17:10:11 +08:00
|
|
|
this.messageList = [];
|
|
|
|
this.memberIdList = [];
|
2020-09-25 15:22:54 +08:00
|
|
|
this.memberObject = '';
|
2020-09-22 09:51:01 +08:00
|
|
|
// this.$message.success('创建会话成功!');
|
2020-09-11 17:10:11 +08:00
|
|
|
this.createLoading = false;
|
|
|
|
}).catch((error) => {
|
|
|
|
this.$message.error(error.code == '3005' ? '创建会话失败:仿真会话成员忙线中!' : '创建仿真失败!');
|
|
|
|
this.createLoading = false;
|
|
|
|
});
|
|
|
|
} else {
|
2020-09-24 17:25:52 +08:00
|
|
|
this.userString = '请选择人员';
|
2020-09-11 17:10:11 +08:00
|
|
|
}
|
|
|
|
},
|
|
|
|
coverName(inviteUser) {
|
|
|
|
const member = this.$store.state.training.memberData[inviteUser.creatorId];
|
|
|
|
if (member.userId) {
|
|
|
|
const user = this.simulationUsers[member.userId];
|
|
|
|
return member.label + '(' + user.nickName + ')';
|
|
|
|
} else {
|
|
|
|
return member.label;
|
|
|
|
}
|
|
|
|
},
|
2020-07-21 19:27:32 +08:00
|
|
|
// 语音录制开始
|
|
|
|
startRecording() {
|
|
|
|
const that = this;
|
2020-09-25 13:58:41 +08:00
|
|
|
if (!this.recordSending) {
|
|
|
|
if (!this.recordSending && !this.recorders && !this.microphone) {
|
|
|
|
this.$refs.chatSetting.doClose();
|
|
|
|
const StereoAudioRecorder = RecordRTC.StereoAudioRecorder;
|
|
|
|
navigator.getUserMedia(
|
|
|
|
{ audio: true } // 只启用音频
|
|
|
|
, function (stream) {
|
|
|
|
that.microphone = stream;
|
|
|
|
that.recorders = new RecordRTC(that.microphone, {
|
|
|
|
type: 'audio',
|
|
|
|
recorderType: StereoAudioRecorder,
|
|
|
|
numberOfAudioChannels: 1,
|
|
|
|
bitsPerSecond:256000,
|
|
|
|
desiredSampRate: 16000
|
2020-07-21 19:27:32 +08:00
|
|
|
});
|
2020-09-25 13:58:41 +08:00
|
|
|
that.recorders.startRecording();
|
|
|
|
that.recordSending = true;
|
|
|
|
that.inter = setInterval(() => {
|
|
|
|
if (that.seconds < 60) {
|
|
|
|
that.seconds++;
|
|
|
|
} else {
|
|
|
|
clearInterval(that.inter);
|
|
|
|
}
|
|
|
|
}, 1000);
|
|
|
|
}, function (error) {
|
|
|
|
switch (error.code || error.name) {
|
|
|
|
case 'PERMISSION_DENIED':
|
|
|
|
case 'PermissionDeniedError':
|
|
|
|
that.$message({
|
|
|
|
showClose: true,
|
|
|
|
message: '用户拒绝提供信息',
|
|
|
|
type: 'error'
|
|
|
|
});
|
|
|
|
break;
|
|
|
|
case 'NOT_SUPPORTED_ERROR':
|
|
|
|
case 'NotSupportedError':
|
|
|
|
that.$message({
|
|
|
|
showClose: true,
|
|
|
|
message: '浏览器不支持硬件设备',
|
|
|
|
type: 'error'
|
|
|
|
});
|
|
|
|
break;
|
|
|
|
case 'MANDATORY_UNSATISFIED_ERROR':
|
|
|
|
case 'MandatoryUnsatisfiedError':
|
|
|
|
that.$message({
|
|
|
|
showClose: true,
|
|
|
|
message: '无法发现指定的硬件设备',
|
|
|
|
type: 'error'
|
|
|
|
});
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
that.$message({
|
|
|
|
showClose: true,
|
|
|
|
message: '无法打开麦克风',
|
|
|
|
type: 'error'
|
|
|
|
});
|
|
|
|
break;
|
|
|
|
}
|
2020-07-21 19:27:32 +08:00
|
|
|
}
|
2020-09-25 13:58:41 +08:00
|
|
|
);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
this.stopRecording(); // 发送语音
|
2020-07-21 19:27:32 +08:00
|
|
|
}
|
|
|
|
},
|
2020-09-11 17:10:11 +08:00
|
|
|
cancleRecording() {
|
|
|
|
if (this.microphone) {
|
|
|
|
clearInterval(this.inter);
|
|
|
|
this.seconds = 0;
|
|
|
|
this.microphone.stop();
|
|
|
|
this.microphone = null;
|
|
|
|
this.recordSending = false;
|
|
|
|
this.recorders = null;
|
|
|
|
}
|
|
|
|
},
|
2020-09-25 15:22:54 +08:00
|
|
|
// 停止录制 发送语音
|
2020-07-21 15:15:28 +08:00
|
|
|
stopRecording() {
|
|
|
|
const that = this;
|
|
|
|
this.recorders.stopRecording(function(blobURL) {
|
|
|
|
clearInterval(that.inter);
|
|
|
|
that.seconds = 0;
|
|
|
|
const blob = that.recorders.getBlob();
|
|
|
|
const fd = new FormData();
|
|
|
|
fd.append('file', blob);
|
|
|
|
sendSimulationConversition(that.group, that.conversitionId, fd)
|
|
|
|
.then((data) => {
|
|
|
|
})
|
|
|
|
.catch(error => {
|
|
|
|
console.log(error);
|
|
|
|
});
|
|
|
|
if (that.microphone) {
|
|
|
|
that.microphone.stop();
|
|
|
|
that.microphone = null;
|
|
|
|
that.recordSending = false;
|
|
|
|
that.recorders = null;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
},
|
2020-09-11 17:10:11 +08:00
|
|
|
handleSetting() {
|
|
|
|
this.$refs.chatSetting.doShow();
|
2020-07-21 19:27:32 +08:00
|
|
|
},
|
2020-09-25 15:22:54 +08:00
|
|
|
// 点击按钮事件
|
2020-09-24 18:34:25 +08:00
|
|
|
handleCheckChange(data, jude = false) {
|
2020-09-29 13:18:31 +08:00
|
|
|
this.memberObject = '';
|
2020-09-25 17:15:25 +08:00
|
|
|
if (data.userId && data.userId == this.$store.state.user.id) {
|
|
|
|
return;
|
|
|
|
}
|
2020-09-25 15:22:54 +08:00
|
|
|
if (data.value == 'allConcentrateStation' || data.value == 'allStation' || data.value == 'allTrain') {
|
2020-09-29 13:18:31 +08:00
|
|
|
const stationList = this.treeData[1].children;
|
|
|
|
const length = stationList.length;
|
2020-09-29 13:30:12 +08:00
|
|
|
if (!data.active) {
|
2020-09-29 13:18:31 +08:00
|
|
|
stationList.forEach((item, index) => {
|
|
|
|
if (index != length - 1) {
|
2020-09-29 13:30:12 +08:00
|
|
|
item.active = false;
|
2020-09-29 13:18:31 +08:00
|
|
|
item.disabled = true;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
stationList.forEach((item, index) => {
|
|
|
|
if (index != length - 1) {
|
|
|
|
item.disabled = false;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
2020-09-24 18:34:25 +08:00
|
|
|
data.active = !data.active;
|
2020-09-25 15:22:54 +08:00
|
|
|
this.memberObject = data.sign;
|
2020-09-24 17:25:52 +08:00
|
|
|
} else {
|
2020-09-24 18:34:25 +08:00
|
|
|
if (!jude) {
|
|
|
|
data.active = !data.active;
|
|
|
|
}
|
|
|
|
const member = data;
|
|
|
|
if (data.active) {
|
|
|
|
if (member && member.type === 'DRIVER' && !this.activeTrains.includes(member.deviceCode)) {
|
|
|
|
return;
|
2020-07-21 19:27:32 +08:00
|
|
|
}
|
2020-09-24 18:34:25 +08:00
|
|
|
if (member && member.userId) {
|
|
|
|
this.memberIdList.push(member.id);
|
|
|
|
} else if (member) {
|
|
|
|
this.memberIdList.push(member.id);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
this.memberIdList.forEach((id, index) => {
|
|
|
|
if (id == member.id) {
|
|
|
|
this.memberIdList.splice(index, 1);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
2020-07-31 18:49:35 +08:00
|
|
|
}
|
2020-07-22 17:20:24 +08:00
|
|
|
},
|
2020-09-25 15:22:54 +08:00
|
|
|
// 过滤全部列车 显示正在运行的列车
|
2020-09-24 17:25:52 +08:00
|
|
|
filterNode() {
|
|
|
|
this.treeData[2] && this.treeData[2]['children'].forEach(train => {
|
|
|
|
train.show = false;
|
|
|
|
if (this.activeTrains.includes(train.deviceCode)) {
|
|
|
|
train.show = true;
|
|
|
|
}
|
2020-09-25 15:22:54 +08:00
|
|
|
if (train.value == 'allTrain') {
|
|
|
|
train.show = true;
|
|
|
|
}
|
2020-09-24 17:25:52 +08:00
|
|
|
});
|
2020-09-11 17:10:11 +08:00
|
|
|
},
|
2020-09-25 15:22:54 +08:00
|
|
|
// 退出会话
|
2020-07-22 17:20:24 +08:00
|
|
|
quitConversition() {
|
2020-09-11 17:10:11 +08:00
|
|
|
this.quitLoading = true;
|
2020-07-22 17:20:24 +08:00
|
|
|
overSimulationConversition(this.group, this.conversitionId).then(resp => {
|
2020-09-11 17:10:11 +08:00
|
|
|
this.conversitionMemberList = [];
|
|
|
|
this.messageList = [];
|
|
|
|
this.quitLoading = false;
|
2020-09-24 17:25:52 +08:00
|
|
|
// this.$nextTick(() => {
|
|
|
|
// this.$refs.tree && this.$refs.tree.filter(this.queryMember);
|
|
|
|
// });
|
|
|
|
this.treeData.forEach(item => {
|
|
|
|
if (item.children && item.children.length) {
|
|
|
|
item.children.forEach(data =>{
|
|
|
|
data.active = false;
|
2020-09-29 13:18:31 +08:00
|
|
|
data.isConnect = false;
|
2020-09-25 17:15:25 +08:00
|
|
|
data.loading = false;
|
2020-09-29 13:30:12 +08:00
|
|
|
data.disabled = false;
|
2020-09-24 17:25:52 +08:00
|
|
|
});
|
|
|
|
}
|
2020-09-11 17:10:11 +08:00
|
|
|
});
|
2020-07-22 17:20:24 +08:00
|
|
|
}).catch(() => {
|
|
|
|
this.$message.error('退出会话失败!');
|
2020-09-11 17:10:11 +08:00
|
|
|
this.quitLoading = false;
|
2020-07-22 17:20:24 +08:00
|
|
|
});
|
|
|
|
},
|
2020-09-11 17:10:11 +08:00
|
|
|
sortByMessageTime(message1, message2) {
|
|
|
|
const time1 = new Date(message1.time).valueOf();
|
|
|
|
const time2 = new Date(message2.time).valueOf();
|
|
|
|
return time1 - time2;
|
2020-09-01 11:20:53 +08:00
|
|
|
},
|
2020-09-24 17:25:52 +08:00
|
|
|
// 获取历史消息
|
2020-09-11 17:10:11 +08:00
|
|
|
isAudienceInitData() {
|
|
|
|
getAllConversition(this.group).then(resp => {
|
|
|
|
const messages = [];
|
|
|
|
if (resp.data && resp.data.length) {
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
messages.push(message);
|
|
|
|
});
|
|
|
|
const tempMessageList = [];
|
|
|
|
!conversation.over && conversation.messageList.forEach(message => {
|
|
|
|
message.src = `/audio/${message.audioPath}`;
|
|
|
|
tempMessageList.push(message);
|
|
|
|
});
|
|
|
|
!conversation.over && conversation.memberList.forEach(member => {
|
2020-09-25 18:41:59 +08:00
|
|
|
const param = {
|
|
|
|
conversitionId: conversation.id,
|
2020-09-11 17:10:11 +08:00
|
|
|
privateMemberList: conversation.memberList,
|
|
|
|
privateMessageList: tempMessageList
|
|
|
|
};
|
2020-09-25 18:41:59 +08:00
|
|
|
this.$set(this.conversitionStateMap, member.memberId, param);
|
2020-09-11 17:10:11 +08:00
|
|
|
});
|
|
|
|
});
|
2020-09-25 18:41:59 +08:00
|
|
|
this.getUserRole();
|
2020-09-11 17:10:11 +08:00
|
|
|
}
|
|
|
|
this.commonMessageList = messages.sort(this.sortByMessageTime);
|
|
|
|
this.initCommonMemberList();
|
|
|
|
});
|
|
|
|
},
|
2020-09-24 17:25:52 +08:00
|
|
|
// 初始化人员列表
|
2020-09-11 17:10:11 +08:00
|
|
|
initCommonMemberList() {
|
|
|
|
const temDispatcherList = [];
|
|
|
|
const temStationSupervisorList = [];
|
|
|
|
const temMaintainerList = [];
|
|
|
|
const temDriverList = [];
|
|
|
|
const temDepotDispatcherList = [];
|
|
|
|
this.$store.state.training.memberList.forEach(item =>{
|
|
|
|
switch (item.type) {
|
|
|
|
case 'DISPATCHER':
|
|
|
|
temDispatcherList.push({memberId: item.id, connect:true });
|
|
|
|
break;
|
|
|
|
case 'STATION_SUPERVISOR':
|
|
|
|
temStationSupervisorList.push({memberId: item.id, connect:true });
|
|
|
|
break;
|
|
|
|
case 'MAINTAINER':
|
|
|
|
temMaintainerList.push({memberId: item.id, connect:true });
|
|
|
|
break;
|
|
|
|
case 'DRIVER':
|
|
|
|
temDriverList.push({memberId: item.id, connect:true });
|
|
|
|
break;
|
|
|
|
case 'DEPOT_DISPATCHER':
|
|
|
|
temDepotDispatcherList.push({memberId: item.id, connect:true });
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
this.commonMemberList = [...temDispatcherList, ...temStationSupervisorList, ...temMaintainerList, ...temDriverList, ...temDepotDispatcherList];
|
2020-09-24 17:25:52 +08:00
|
|
|
if (this.userRole == 'AUDIENCE' || this.commonConversation) {
|
2020-09-11 17:10:11 +08:00
|
|
|
this.conversitionMemberList = [];
|
|
|
|
this.messageList = [...this.commonMessageList];
|
|
|
|
this.conversitionMemberList = this.commonMemberList;
|
|
|
|
}
|
|
|
|
},
|
|
|
|
changeMessageList(data) {
|
|
|
|
this.commonMessageList.push(data.message);
|
|
|
|
// if (this.conversitionStateMap[data.message.memberId]) {
|
|
|
|
// this.conversitionStateMap[data.message.memberId].privateMessageList.push(data.message);
|
|
|
|
// }
|
|
|
|
if (this.conversitionStateMap[data.message.memberId]) {
|
|
|
|
(this.conversitionStateMap[data.message.memberId].privateMemberList || []).forEach(member => {
|
|
|
|
this.conversitionStateMap[member.memberId] && this.conversitionStateMap[member.memberId].privateMessageList.push(data.message);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
if (this.commonConversation) {
|
|
|
|
this.messageList.push(data.message);
|
|
|
|
} else if (!this.commonConversation && this.conversitionId === data.id) {
|
|
|
|
this.messageList.push(data.message);
|
|
|
|
}
|
|
|
|
},
|
|
|
|
goCommonConversation() {
|
|
|
|
!this.commonConversation && this.$refs.chatContent && this.$refs.chatContent.conversationChange();
|
|
|
|
this.commonConversation = true;
|
|
|
|
this.conversitionMemberList = this.commonMemberList;
|
|
|
|
this.messageList = [...this.commonMessageList];
|
|
|
|
},
|
|
|
|
cancelCommonConversation() {
|
|
|
|
this.commonConversation && this.$refs.chatContent && this.$refs.chatContent.conversationChange();
|
|
|
|
this.commonConversation = false;
|
|
|
|
this.conversitionMemberList = this.privateMemberList;
|
|
|
|
this.messageList = [...this.privateMessageList];
|
2020-09-24 17:25:52 +08:00
|
|
|
// this.$nextTick(() => {
|
|
|
|
// this.$refs.tree && this.$refs.tree.filter(this.queryMember);
|
|
|
|
// });
|
2020-09-11 17:10:11 +08:00
|
|
|
},
|
|
|
|
clearAllData() {
|
|
|
|
this.recordSending = false;
|
|
|
|
this.inter = null;
|
|
|
|
this.recorders = null;
|
|
|
|
this.microphone = null;
|
|
|
|
this.treeData = [];
|
|
|
|
this.conversitionMemberList = [];
|
|
|
|
this.messageList = [];
|
2020-09-18 16:02:22 +08:00
|
|
|
},
|
2020-09-25 15:22:54 +08:00
|
|
|
// 剧本重置清空公有会话
|
2020-09-18 16:02:22 +08:00
|
|
|
resetCoversition() {
|
2020-09-21 14:20:33 +08:00
|
|
|
this.commonMessageList = [];
|
2020-09-18 16:02:22 +08:00
|
|
|
this.conversitionStateMap = {};
|
2020-07-21 15:15:28 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
<style lang="scss" scoped>
|
2020-07-29 16:15:39 +08:00
|
|
|
.chatBox {
|
|
|
|
position: absolute;
|
|
|
|
left: 0;
|
2020-09-25 13:58:41 +08:00
|
|
|
top: calc((100% - 600px) / 2);
|
|
|
|
height: 600px;
|
2020-07-29 16:15:39 +08:00
|
|
|
width: 503px;
|
|
|
|
transform: translateX(-503px);
|
|
|
|
transition: all 0.4s;
|
|
|
|
z-index: 9;
|
|
|
|
&.active{
|
|
|
|
transform: translateX(0px);
|
|
|
|
}
|
2020-07-21 15:15:28 +08:00
|
|
|
}
|
2020-09-24 17:25:52 +08:00
|
|
|
.proper_box{
|
|
|
|
overflow: hidden;
|
|
|
|
.proper_title{
|
|
|
|
width: 100%;
|
|
|
|
text-align: center;
|
|
|
|
height: 30px;
|
|
|
|
font-size: 14px;
|
|
|
|
background: #F27867;
|
|
|
|
line-height: 30px;
|
|
|
|
margin-bottom: 5px;
|
|
|
|
}
|
|
|
|
.proper_content_box{
|
|
|
|
float: left;
|
|
|
|
width: 73px;
|
|
|
|
height: 73px;
|
|
|
|
font-size: 12px;
|
|
|
|
display: flex;
|
|
|
|
justify-content: center;
|
|
|
|
align-items: center;
|
|
|
|
background: #676688;
|
|
|
|
border-radius: 4px;
|
|
|
|
margin-left: 5px;
|
|
|
|
margin-bottom: 5px;
|
|
|
|
padding: 0 3px;
|
|
|
|
text-align: center;
|
|
|
|
cursor: pointer;
|
|
|
|
color: #fff;
|
|
|
|
position: relative;
|
|
|
|
&.active{
|
|
|
|
background: #6BBE16;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
.mask_loading{
|
|
|
|
position: absolute;
|
2020-09-25 17:15:25 +08:00
|
|
|
width: 73px;
|
|
|
|
height: 73px;
|
|
|
|
left: 5px;
|
2020-09-24 17:25:52 +08:00
|
|
|
top: 0;
|
|
|
|
display: flex;
|
|
|
|
justify-content: center;
|
|
|
|
align-items: center;
|
|
|
|
background: rgba(0,0,0,0.4);
|
|
|
|
flex-direction: column;
|
2020-09-25 17:15:25 +08:00
|
|
|
border-radius:4px;
|
|
|
|
font-size: 14px;
|
2020-09-24 17:25:52 +08:00
|
|
|
}
|
2020-09-29 13:18:31 +08:00
|
|
|
.content_connect{
|
|
|
|
position: absolute;
|
|
|
|
width: 73px;
|
|
|
|
height: 73px;
|
|
|
|
left: 5px;
|
|
|
|
top: 0;
|
|
|
|
display: flex;
|
|
|
|
justify-content: center;
|
|
|
|
align-items: center;
|
|
|
|
background: rgba(0,0,0,0);
|
|
|
|
flex-direction: column;
|
|
|
|
border-radius:4px;
|
|
|
|
font-size: 14px;
|
|
|
|
}
|
2020-09-24 17:25:52 +08:00
|
|
|
}
|
2020-07-29 16:15:39 +08:00
|
|
|
.menuTrainListBtn {
|
|
|
|
background: #fff;
|
|
|
|
text-align: center;
|
|
|
|
border-radius: 0px 6px 6px 0px;
|
|
|
|
position: absolute;
|
2020-09-24 13:40:09 +08:00
|
|
|
top: 40%;
|
2020-07-29 16:15:39 +08:00
|
|
|
z-index: 2;
|
|
|
|
transform: translateX(502px);
|
|
|
|
cursor: pointer;
|
|
|
|
z-index: 9;
|
2020-07-31 18:49:35 +08:00
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
align-items: center;
|
|
|
|
text-align: center;
|
|
|
|
justify-content: center;
|
2020-08-03 09:53:34 +08:00
|
|
|
padding: 7px 4px;
|
2020-07-29 16:15:39 +08:00
|
|
|
.el-icon-more{
|
|
|
|
font-size: 20px;
|
|
|
|
margin-top: 9px;
|
|
|
|
transform-origin: 50% 50%;
|
|
|
|
transform: rotate(90deg);
|
|
|
|
margin-left:0px;
|
|
|
|
}
|
2020-07-21 15:15:28 +08:00
|
|
|
}
|
|
|
|
.chat-box-header{
|
|
|
|
width: 100%;
|
|
|
|
height: 40px;
|
|
|
|
border-bottom: 1px #dedede solid;
|
2020-09-11 17:10:11 +08:00
|
|
|
.chat-box-header-title{
|
|
|
|
font-size: 15px;
|
|
|
|
margin-left: 15px;
|
|
|
|
display: inline-block;
|
|
|
|
margin-top: 5px;
|
|
|
|
width: 70%;
|
|
|
|
overflow: hidden;
|
|
|
|
white-space: nowrap;
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
}
|
2020-07-21 15:15:28 +08:00
|
|
|
}
|
2020-09-11 17:10:11 +08:00
|
|
|
|
2020-07-21 15:15:28 +08:00
|
|
|
.chat-box-content{
|
|
|
|
width: 100%;
|
|
|
|
height: 300px;
|
|
|
|
position: relative;
|
2020-09-24 17:25:52 +08:00
|
|
|
overflow: auto;
|
|
|
|
}
|
|
|
|
.chat-box-content_audience{
|
|
|
|
height: calc(100% - 40px);
|
|
|
|
}
|
|
|
|
.chat-box-content1{
|
|
|
|
height: 200px;
|
|
|
|
position: relative;
|
2020-09-24 17:55:06 +08:00
|
|
|
border-top: 1px #9a9a9a solid;
|
2020-09-24 17:25:52 +08:00
|
|
|
margin-top: 8px;
|
2020-07-21 15:15:28 +08:00
|
|
|
}
|
|
|
|
|
2020-07-21 19:27:32 +08:00
|
|
|
.chat-box-footer{
|
|
|
|
display: inline-block;
|
|
|
|
width: 100%;
|
2020-09-25 13:58:41 +08:00
|
|
|
height: 55px;
|
2020-09-24 17:25:52 +08:00
|
|
|
position: relative;
|
2020-09-24 17:55:06 +08:00
|
|
|
border-top: 1px solid #afafaf;
|
2020-07-21 19:27:32 +08:00
|
|
|
}
|
2020-07-21 15:15:28 +08:00
|
|
|
.chat-setting{
|
|
|
|
float: right;
|
|
|
|
line-height: 40px;
|
|
|
|
margin-right: 10px;
|
|
|
|
cursor: pointer;
|
|
|
|
font-size: 16px;
|
|
|
|
}
|
2020-09-11 17:10:11 +08:00
|
|
|
.chat-createGroup{
|
|
|
|
float: right;
|
|
|
|
line-height: 40px;
|
|
|
|
margin-right: 10px;
|
|
|
|
cursor: pointer;
|
|
|
|
font-size: 16px;
|
|
|
|
position: relative;
|
|
|
|
}
|
2020-07-21 19:27:32 +08:00
|
|
|
.chat-box-footer-tool{
|
|
|
|
width: 100%;
|
2020-09-11 17:10:11 +08:00
|
|
|
height: 17px;
|
2020-07-21 19:27:32 +08:00
|
|
|
}
|
2020-07-21 15:15:28 +08:00
|
|
|
.minimality {
|
|
|
|
float: right;
|
|
|
|
line-height: 40px;
|
|
|
|
margin-right: 10px;
|
|
|
|
cursor: pointer;
|
|
|
|
font-size:16px;
|
|
|
|
}
|
|
|
|
.chat-box-main{
|
|
|
|
position: absolute;
|
|
|
|
width: 100%;
|
|
|
|
left: 0;
|
|
|
|
height: 100%;
|
|
|
|
top: 0;
|
|
|
|
border-right: 1px #dedede solid;
|
|
|
|
z-index: 4;
|
|
|
|
background: #fff;
|
|
|
|
border-radius: 5px;
|
2020-07-29 16:15:39 +08:00
|
|
|
left: 0;
|
2020-09-24 17:25:52 +08:00
|
|
|
// font-size:0;
|
2020-07-21 15:15:28 +08:00
|
|
|
}
|
2020-09-11 17:10:11 +08:00
|
|
|
.chat-box-footer-create{
|
2020-09-24 17:55:06 +08:00
|
|
|
font-size: 16px;
|
2020-09-11 17:10:11 +08:00
|
|
|
text-align: center;
|
|
|
|
color: #fff;
|
2020-07-21 19:27:32 +08:00
|
|
|
position: absolute;
|
2020-09-11 17:10:11 +08:00
|
|
|
right: 5px;
|
2020-09-25 13:58:41 +08:00
|
|
|
top: 6px;
|
2020-09-24 17:55:06 +08:00
|
|
|
line-height: 30px;
|
2020-09-11 17:10:11 +08:00
|
|
|
cursor: pointer;
|
2020-09-25 13:58:41 +08:00
|
|
|
width: 40px;
|
|
|
|
height: 40px;
|
2020-09-24 17:55:06 +08:00
|
|
|
border-radius: 50%;
|
|
|
|
background: green;
|
2020-09-25 13:58:41 +08:00
|
|
|
border: none;
|
2020-09-24 17:55:06 +08:00
|
|
|
display: flex;
|
|
|
|
justify-content: center;
|
|
|
|
align-items: center;
|
|
|
|
}
|
|
|
|
.chat-box-footer-quit{
|
|
|
|
background: red;
|
|
|
|
}
|
|
|
|
.chat-box-footer-send{
|
2020-09-25 13:58:41 +08:00
|
|
|
background: #F2F2F2;
|
|
|
|
right: 55px;
|
|
|
|
cursor: pointer;
|
|
|
|
.icon-yuyin{
|
|
|
|
color: #333;
|
|
|
|
font-size: 24px;
|
|
|
|
margin: 0;
|
|
|
|
}
|
2020-09-24 17:55:06 +08:00
|
|
|
&.active{
|
2020-09-25 13:58:41 +08:00
|
|
|
.icon-yuyin{
|
|
|
|
color: green;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
.close_icon{
|
|
|
|
position: absolute;
|
|
|
|
top: -15px;
|
|
|
|
left: 11px;
|
|
|
|
font-size: 16px;
|
|
|
|
color: #333;
|
|
|
|
font-weight: 600;
|
2020-09-24 17:55:06 +08:00
|
|
|
}
|
2020-09-11 17:10:11 +08:00
|
|
|
}
|
|
|
|
.showMembers{
|
|
|
|
float: right;
|
|
|
|
line-height: 40px;
|
|
|
|
margin-right: 10px;
|
|
|
|
cursor: pointer;
|
|
|
|
font-size: 17px;
|
2020-07-21 19:27:32 +08:00
|
|
|
}
|
2020-07-21 15:15:28 +08:00
|
|
|
#record_progress_bar{
|
2020-09-25 13:58:41 +08:00
|
|
|
width: 40px;
|
|
|
|
height: 40px;
|
2020-07-21 15:15:28 +08:00
|
|
|
position: absolute;
|
2020-09-25 13:58:41 +08:00
|
|
|
left: 0;
|
|
|
|
top: 0;
|
|
|
|
border-radius: 50%;
|
2020-07-21 15:15:28 +08:00
|
|
|
}
|
|
|
|
.chat_record_tip{
|
|
|
|
height: 28px;
|
|
|
|
display: inline-block;
|
|
|
|
background: #dfe6ee;
|
2020-09-11 17:10:11 +08:00
|
|
|
width: 370px;
|
2020-07-21 15:15:28 +08:00
|
|
|
font-size: 13px;
|
|
|
|
border-top: 1px #d8dce5 solid;
|
|
|
|
position: absolute;
|
|
|
|
bottom: 0;
|
2020-09-11 17:10:11 +08:00
|
|
|
left: 0;
|
2020-07-21 15:15:28 +08:00
|
|
|
}
|
2020-09-11 17:10:11 +08:00
|
|
|
.chat-box-footer-send.disbled{
|
|
|
|
cursor: no-drop;
|
|
|
|
}
|
2020-07-21 15:15:28 +08:00
|
|
|
|
|
|
|
</style>
|