rt-sim-training-client/src/views/newMap/jointTrainingNew/chatView/chatBox.vue

918 lines
33 KiB
Vue
Raw Normal View History

2020-07-03 18:42:29 +08:00
<template>
<div class="chatBox" :style="{'bottom':bottom+'px'}">
<div v-show="!minimize" class="chat-box">
<div class="chat-box-main">
2020-07-20 13:18:38 +08:00
<div v-if="!conversitionId && userRole !== 'AUDIENCE' && !commonConversation" class="chat-window">
2020-07-03 18:42:29 +08:00
<div class="chat-box-header">
<div class="chat-box-header-title">
<el-input v-model="queryMember" size="small" placeholder="请输入搜索人员">
<el-button slot="append" icon="el-icon-search" />
</el-input>
</div>
<div class="minimality" @click="handleMinimality('min')">
<i class="el-icon-remove" />
</div>
<div class="chat-setting" @click="handleSetting()">
<i class="el-icon-s-tools" />
</div>
</div>
<div class="chat-box-content">
<el-tree
ref="tree"
:data="treeData"
:props="defaultProps"
2020-07-06 18:00:44 +08:00
node-key="id"
2020-07-03 18:42:29 +08:00
default-expand-all
show-checkbox
:filter-node-method="filterNode"
2020-07-06 18:00:44 +08:00
style="margin: 10px;overflow-y: auto;height: 100%;margin-right: 0;"
2020-07-03 18:42:29 +08:00
@node-click="handleNodeClick"
2020-07-06 18:00:44 +08:00
@check-change="handleCheckChange"
>
<span :id="data.id" slot-scope="{ node, data }">
<span style="font-size: 14px">{{ data.label + (data.userId? '(' + (simulationUsers[data.userId]||{}).nickName + ')': '') }}</span>
</span>
</el-tree>
2020-07-03 18:42:29 +08:00
</div>
<div class="chat-box-footer">
2020-07-06 18:00:44 +08:00
<div style="width: 400px;font-size: 14px;">{{ userString }}</div>
2020-07-20 13:18:38 +08:00
<el-button size="mini" type="primary" class="chat-box-footer-create" style="right: 80px;" @click="goCommonConversation">公共会话</el-button>
2020-07-03 18:42:29 +08:00
<el-button size="mini" type="primary" class="chat-box-footer-create" :loading="createLoading" @click="createCoversition()">创建群聊</el-button>
2020-07-21 10:49:01 +08:00
<div v-if="scriptTip" class="scriptTip">{{ scriptTip }}</div>
2020-07-03 18:42:29 +08:00
</div>
</div>
2020-07-06 18:00:44 +08:00
<div v-else class="chat-window">
<div class="chat-box-header">
2020-07-20 10:28:31 +08:00
<!-- <div class="chat-box-header-title">{{ headerTitle }}</div> -->
2020-07-06 18:00:44 +08:00
<div class="minimality" @click="handleMinimality('min')">
<i class="el-icon-remove" />
</div>
<div class="chat-setting" @click="handleSetting()">
<i class="el-icon-s-tools" />
</div>
</div>
<div class="chat-box-content">
2020-07-07 10:54:57 +08:00
<chat-content
ref="chatContent"
:project="project"
:is-answering="IsAnswering"
:conversition-id="conversitionId"
:conversition-member-list="conversitionMemberList"
:message-list="messageList"
:simulation-users="simulationUsers"
:common-conversation="commonConversation"
2020-07-17 19:07:34 +08:00
:user-role="userRole"
2020-07-07 10:54:57 +08:00
@changeMessageList="changeMessageList"
/>
2020-07-06 18:00:44 +08:00
<div v-if="recordSending" class="chat_record_tip">
<div id="record_progress_bar" :style="'width:'+100/60*seconds+'%'" />
<div class="record_icon" />
<div class="record_tip_text">正在录音...</div>
<div class="record_tip_confirm" @click="stopRecording()">确定</div>
<div class="record_tip_cancle" @click="cancleRecording()">取消</div>
</div>
<chat-member-list ref="chatMemberList" :conversition-member-list="conversitionMemberList" :simulation-users="simulationUsers" @connectMember="connectMember" />
</div>
<div class="chat-box-footer">
<div class="chat-box-footer-tool" />
2020-07-20 13:18:38 +08:00
<el-button v-if="isConversitionCreator && isButtonShow && !commonConversation" size="mini" type="danger" class="chat-box-footer-quit" :loading="quitLoading" @click="quitConversition()">退出群聊</el-button>
2020-07-20 10:48:53 +08:00
<el-button v-if="!commonConversation" class="chat-box-footer-send" size="mini" type="primary" @click="goCommonConversation">公共会话</el-button>
<el-button v-if="!conversitionId && userRole !== 'AUDIENCE'" class="chat-box-footer-send" size="mini" type="primary" @click="cancelCommonConversation">成员列表</el-button>
<el-button v-if="conversitionId && commonConversation" class="chat-box-footer-send" size="mini" type="primary" @click="cancelCommonConversation">私有会话</el-button>
2020-07-20 13:18:38 +08:00
<el-button v-if="isButtonShow && !commonConversation" class="chat-box-footer-send" size="mini" type="primary" :disabled="recordSending" @click="startRecording()">发送语音</el-button>
2020-07-21 10:49:01 +08:00
<div v-if="scriptTip" class="scriptTip">{{ scriptTip }}</div>
2020-07-06 18:00:44 +08:00
</div>
</div>
2020-07-03 18:42:29 +08:00
</div>
</div>
<div v-show="minimize" class="reminder-drag minimize-box">
<div class="chat-title">聊天窗口</div>
<div class="minimality" @click="handleMinimality('max')">
<i class="el-icon-circle-plus" />
</div>
</div>
<chat-setting ref="chatSetting" :form="form" @setSetting="setSetting" />
2020-07-06 18:00:44 +08:00
<chat-tooltip :group="group" :simulation-users="simulationUsers" @acceptInvite="acceptInvite" />
2020-07-03 18:42:29 +08:00
</div>
</template>
<script>
import ChatSetting from './chatSetting';
import ChatTooltip from './chatTooltip';
2020-07-06 18:00:44 +08:00
import ChatContent from './chatContent';
2020-07-21 10:49:01 +08:00
import CMD from '@/scripts/cmdPlugin/CommandEnum';
2020-07-06 18:00:44 +08:00
import ChatMemberList from './chatMemberList';
2020-07-03 18:42:29 +08:00
import RecordRTC from 'recordrtc';
2020-07-06 18:14:03 +08:00
import {sendSimulationConversition, startConversition, overSimulationConversition, getAllConversition} from '@/api/chat';
2020-07-03 18:42:29 +08:00
import { getSessionStorage } from '@/utils/auth';
export default {
name: 'ChatBox',
components:{
ChatSetting,
2020-07-06 18:00:44 +08:00
ChatTooltip,
ChatContent,
ChatMemberList
2020-07-03 18:42:29 +08:00
},
props: {
group: {
type: String,
required: true
},
userRole: {
type: String,
required: true
}
},
data() {
return {
minimize:true,
bottom:15,
recordSending:false,
2020-07-06 18:00:44 +08:00
conversitionId: '',
2020-07-20 10:48:53 +08:00
commonConversation: false,
2020-07-03 18:42:29 +08:00
seconds:0,
inter:null,
recorders: null,
microphone:null,
createLoading:false,
form:{
language:'zh',
sex:'1'
},
2020-07-21 10:49:01 +08:00
scriptTip:'',
2020-07-03 18:42:29 +08:00
treeData: [],
defaultProps: {
children: 'children',
label: 'label'
},
queryMember: '',
activeTrains: [],
firstClick: true,
memberData: {},
2020-07-06 18:00:44 +08:00
simulationUsers: {},
userString: '',
memberIdList: [],
quitLoading: false,
conversitionMemberList: [],
2020-07-20 10:48:53 +08:00
commonMemberList: [],
privateMemberList: [],
isConversitionCreator: false,
2020-07-20 10:48:53 +08:00
messageList: [],
commonMessageList: [],
privateMessageList: []
2020-07-03 18:42:29 +08:00
};
},
computed:{
isButtonShow() {
2020-07-06 18:00:44 +08:00
return this.userRole != 'AUDIENCE';
2020-07-03 18:42:29 +08:00
},
project() {
return getSessionStorage('project');
},
IsAnswering() {
return !(this.$route.path.includes('refereeJsxtDisplay'));
}
},
watch:{
queryMember(val) {
2020-07-06 18:00:44 +08:00
if (this.$refs.tree) {
this.$refs.tree.filter(val);
}
},
userRole(val) {
if (val === 'AUDIENCE') {
2020-07-20 10:48:53 +08:00
// this.isAudienceInitData();
this.goCommonConversation();
2020-07-06 18:00:44 +08:00
}
2020-07-03 18:42:29 +08:00
},
'$store.state.map.mapViewLoadedCount':function(val) {
const object = document.querySelector('.menuButton');
if (object) {
const objectBottom = parseInt(object.style.bottom) || 0;
this.bottom = this.bottom + object.offsetHeight + objectBottom;
}
},
2020-07-09 15:06:15 +08:00
'$store.state.training.prdType': function(val) {
this.$nextTick(() => {
const object = document.querySelector('.menuButton');
if (object) {
const objectBottom = parseInt(object.style.bottom) || 0;
this.bottom = this.bottom + object.offsetHeight + objectBottom;
}
});
},
'$store.state.socket.createConversition':function(val) {
2020-07-17 19:07:34 +08:00
const member = this.memberData[val.creatorId];
if (member.userId == this.$store.state.user.id) {
const memberList = [];
val.memberIds.forEach(id=>{
if (val.creatorId == id) {
memberList.push({memberId:id, connect:true});
} else {
memberList.push({memberId:id, connect:false});
}
});
this.conversitionMemberList = memberList;
2020-07-20 10:48:53 +08:00
this.privateMemberList = memberList;
2020-07-20 13:18:38 +08:00
this.commonConversation = false;
2020-07-17 19:07:34 +08:00
}
2020-07-21 10:49:01 +08:00
this.conversitionId = val.id;
},
'$store.state.socket.simulationScriptTip':function(val, old) {
if (val) {
if (val.type == 'Conversation') {
// const target = this.$refs.chatMemberList.getMember(val.targetId);
// if (target && target.length > 0) {
this.scriptTip = '请说:' + val.content;
// }
} else if (val.type == 'Command') {
const commandName = val.operationType;
let device = val.operationType.split('_')[0];
if (device == 'CM') {
device = 'ControlConvertMenu';
}
const operateName = Object.values(CMD[device]).find(res=>{ return res.value == commandName; });
this.$messageBox('请执行【' + operateName.label + '】操作');
} else if (val.type == 'Over_Conversation') {
this.scriptTip = '请结束当前会话';
} else if (val.type == 'Start_Conversation' ) {
debugger;
const inviteMember = [];
val.conversationMemberIds.forEach(id=>{
if (val.memberId != id) {
// const userName = memberList.find(elem=>{ return elem.id == id; });
inviteMember.push(this.memberData[id].label);
}
});
this.scriptTip = '请创建会话,选择' + inviteMember.toString();
}
}
},
2020-07-20 10:28:31 +08:00
'$store.state.socket.scriptFinish':function(val, old) {
this.$message('剧本执行完成');
},
2020-07-09 15:06:15 +08:00
'$store.state.map.activeTrainListChange': function (val) { // 按计划行车的列车列表更新标识
2020-07-03 18:42:29 +08:00
this.activeTrains = [];
const activeTrainList = this.$store.state.map.activeTrainList;
if (activeTrainList && activeTrainList.length) {
2020-07-09 13:05:50 +08:00
activeTrainList.forEach(groupNumber => {
this.activeTrains.push(groupNumber);
2020-07-03 18:42:29 +08:00
});
}
2020-07-06 18:00:44 +08:00
if (this.$refs.tree) {
2020-07-08 10:56:14 +08:00
this.$refs.tree.filter(this.queryMember);
2020-07-06 18:00:44 +08:00
}
2020-07-03 18:42:29 +08:00
},
'$store.state.training.simulationUserList': {
handler(val, o) {
this.simulationUsers = {};
if (val && val.length) {
val.forEach(user => {
this.simulationUsers[user.userId] = user;
});
}
},
deep: true
2020-07-03 18:42:29 +08:00
},
2020-07-06 18:00:44 +08:00
'$store.state.socket.overConversition': function (val) {
2020-07-20 10:48:53 +08:00
if (val.id === this.conversitionId) {
2020-07-17 19:07:34 +08:00
this.conversitionId = '';
this.conversitionMemberList = [];
2020-07-20 10:48:53 +08:00
this.privateMemberList = [];
2020-07-17 19:07:34 +08:00
this.messageList = [];
2020-07-20 10:48:53 +08:00
this.privateMessageList = [];
2020-07-17 19:07:34 +08:00
}
2020-07-06 18:00:44 +08:00
},
2020-07-03 18:42:29 +08:00
'$store.state.training.memberList': function (val) {
if (val && val.length) {
this.memberData = this.$store.state.training.memberData;
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-07-08 13:49:14 +08:00
switch (item.type) {
2020-07-03 18:42:29 +08:00
case 'DISPATCHER':
this.memberData[item.id].label = '行调' + (dispatcherList.length + 1);
dispatcherList.push(this.memberData[item.id]);
break;
case 'ELECTRIC_DISPATCHER':
electricDispatcherList.push(this.memberData[item.id]);
break;
case 'DEPOT_DISPATCHER':
depotDispatcherList.push(this.memberData[item.id]);
break;
case 'STATION_SUPERVISOR':
this.memberData[item.id].label = '值班员-' + device.name;
stationSupervisorList.push(this.memberData[item.id]);
break;
case 'DRIVER':
this.memberData[item.id].label = '司机-列车' + item.deviceCode;
driverList.push(this.memberData[item.id]);
break;
case 'MAINTAINER':
this.memberData[item.id].label = '通号' + (maintainerList.length + 1);
maintainerList.push(this.memberData[item.id]);
break;
}
});
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
}];
}
}
},
mounted() {
this.firstClick = true;
2020-07-21 10:49:01 +08:00
this.scriptTip = '';
2020-07-03 18:42:29 +08:00
},
methods:{
handleMinimality(data) {
if (data == 'min') {
this.minimize = true;
this.$refs.chatSetting.doClose();
} else {
this.firstClick && this.$nextTick(() => {
2020-07-07 14:58:10 +08:00
this.isAudienceInitData();
2020-07-06 18:00:44 +08:00
if (this.$refs.tree) {
this.$refs.tree.filter(this.queryMember);
}
2020-07-03 18:42:29 +08:00
this.firstClick = false;
});
this.minimize = false;
}
},
setSetting(data) {
this.form = data;
},
createCoversition() {
this.createLoading = true;
2020-07-06 18:00:44 +08:00
startConversition(this.group, this.memberIdList).then(resp => {
this.conversitionId = resp.data.id;
2020-07-07 10:54:57 +08:00
this.messageList = [];
2020-07-20 10:48:53 +08:00
this.privateMessageList = [];
2020-07-06 18:00:44 +08:00
this.userString = '';
this.isConversitionCreator = true;
this.$message.success('创建会话成功!');
2020-07-03 18:42:29 +08:00
this.createLoading = false;
2020-07-06 18:00:44 +08:00
}).catch((error) => {
this.$message.error(error.code == '3005' ? '创建会话失败:仿真会话成员忙线中!' : '创建仿真失败!');
2020-07-03 18:42:29 +08:00
this.createLoading = false;
});
},
// 语音录制开始
startRecording() {
2020-07-21 10:49:01 +08:00
this.scriptTip = '';
2020-07-03 18:42:29 +08:00
const that = this;
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
});
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;
}
}
);
}
},
cancleRecording() {
if (this.microphone) {
clearInterval(this.inter);
this.seconds = 0;
this.microphone.stop();
this.microphone = null;
this.recordSending = false;
this.recorders = null;
}
},
// 停止录制
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);
2020-07-06 18:14:03 +08:00
sendSimulationConversition(that.group, that.conversitionId, fd)
2020-07-03 18:42:29 +08:00
.then((data) => {
})
.catch(error => {
console.log(error);
});
if (that.microphone) {
that.microphone.stop();
that.microphone = null;
that.recordSending = false;
that.recorders = null;
}
});
},
handleSetting() {
this.$refs.chatSetting.doShow();
},
handleNodeClick() {
2020-07-06 18:00:44 +08:00
},
handleCheckChange() {
const memberList = this.$refs.tree.getCheckedKeys();
this.userString = '';
this.memberIdList = [];
if (memberList && memberList.length) {
memberList.forEach(memberId => {
const member = this.memberData[memberId];
if (member && member.userId) {
this.memberIdList.push(member.id);
this.userString += ((this.userString ? ',' : '') + member.label + '(' + this.simulationUsers[member.userId].nickName + ')');
} else if (member) {
this.userString += ((this.userString ? ',' : '') + member.label);
this.memberIdList.push(member.id);
}
});
}
2020-07-03 18:42:29 +08:00
},
filterNode(value, data) {
let flag = false;
if (this.memberData[data.id] && this.memberData[data.id].nickName) {
flag = this.memberData[data.id].nickName.indexOf(value) !== -1;
}
let driverNoShow = true;
2020-07-09 13:05:50 +08:00
if (data.type && data.type === 'DRIVER' && !this.activeTrains.includes(data.deviceCode)) {
2020-07-03 18:42:29 +08:00
driverNoShow = false;
}
return (data.label.indexOf(value) !== -1 || flag) && driverNoShow;
2020-07-06 18:00:44 +08:00
},
quitConversition() {
this.quitLoading = true;
2020-07-21 10:49:01 +08:00
this.scriptTip = '';
2020-07-06 18:00:44 +08:00
overSimulationConversition(this.group, this.conversitionId).then(resp => {
this.conversitionId = '';
this.conversitionMemberList = [];
2020-07-20 10:48:53 +08:00
this.privateMemberList = [];
2020-07-06 18:00:44 +08:00
this.messageList = [];
2020-07-20 10:48:53 +08:00
this.privateMessageList = [];
2020-07-06 18:00:44 +08:00
this.quitLoading = false;
}).catch(() => {
this.$message.error('退出会话失败!');
this.quitLoading = false;
});
},
acceptInvite(data) {
this.userString = '';
this.conversitionId = data.id;
this.conversitionMemberList = data.memberList;
2020-07-21 13:51:13 +08:00
this.privateMemberList = data.memberList;
2020-07-06 18:00:44 +08:00
this.isConversitionCreator = false;
2020-07-07 10:54:57 +08:00
this.messageList = [];
2020-07-20 10:48:53 +08:00
this.privateMessageList = [];
2020-07-07 10:54:57 +08:00
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);
2020-07-20 10:48:53 +08:00
this.privateMessageList.push(message);
2020-07-07 10:54:57 +08:00
});
}
2020-07-21 15:38:47 +08:00
this.cancelCommonConversation();
2020-07-06 18:00:44 +08:00
},
connectMember(val) {
this.conversitionMemberList.forEach(member => {
if (member.memberId == val.memberId) {
member.connect = true;
}
});
},
2020-07-07 14:11:04 +08:00
sortByMessageTime(message1, message2) {
const time1 = new Date(message1.time).valueOf();
const time2 = new Date(message2.time).valueOf();
return time1 - time2;
},
2020-07-06 18:00:44 +08:00
isAudienceInitData() {
getAllConversition(this.group).then(resp => {
2020-07-20 13:18:38 +08:00
const messages = [];
2020-07-06 18:00:44 +08:00
if (resp.data && resp.data.length) {
resp.data.forEach(conversation => {
2020-07-20 10:48:53 +08:00
(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);
});
2020-07-20 13:18:38 +08:00
if (this.userRole !== 'AUDIENCE') {
2020-07-07 14:58:10 +08:00
const user = this.simulationUsers[this.$store.state.user.id];
this.isConversitionCreator = conversation.creatorId == user.memberId;
2020-07-07 14:58:10 +08:00
!conversation.over && conversation.memberList.forEach(member =>{
2020-07-14 17:21:39 +08:00
if (member.memberId == user.memberId && member.connect) {
2020-07-07 14:58:10 +08:00
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;
}
2020-07-20 10:48:53 +08:00
this.privateMessageList.push(message);
2020-07-07 14:58:10 +08:00
this.messageList.push(message);
});
}
});
}
2020-07-06 18:00:44 +08:00
});
2020-07-17 16:35:24 +08:00
}
2020-07-20 13:18:38 +08:00
this.commonMessageList = messages.sort(this.sortByMessageTime);
const temDispatcherList = [];
const temStationSupervisorList = [];
const temMaintainerList = [];
const temDriverList = [];
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;
}
});
if (this.userRole === 'AUDIENCE' || this.commonConversation) {
this.conversitionMemberList = [];
2020-07-21 14:56:46 +08:00
this.messageList = [...this.commonMessageList];
2020-07-20 13:18:38 +08:00
this.commonMemberList = [...temDispatcherList, ...temStationSupervisorList, ...temMaintainerList, ...temDriverList];
this.conversitionMemberList = this.commonMemberList;
}
2020-07-06 18:00:44 +08:00
});
2020-07-07 10:54:57 +08:00
},
changeMessageList(data) {
2020-07-21 14:56:46 +08:00
if (data.flag) {
this.messageList.push(data.message);
}
2020-07-21 13:22:58 +08:00
this.commonMessageList.push(data.message);
2020-07-21 13:57:45 +08:00
if (this.userRole !== 'AUDIENCE' && data.private) {
2020-07-21 13:22:58 +08:00
this.privateMessageList.push(data.message);
2020-07-20 10:48:53 +08:00
}
},
goCommonConversation() {
!this.commonConversation && this.$refs.chatContent && this.$refs.chatContent.conversationChange();
this.commonConversation = true;
this.conversitionMemberList = this.commonMemberList;
2020-07-21 14:56:46 +08:00
this.messageList = [...this.commonMessageList];
2020-07-20 10:48:53 +08:00
},
cancelCommonConversation() {
this.commonConversation && this.$refs.chatContent && this.$refs.chatContent.conversationChange();
this.commonConversation = false;
this.conversitionMemberList = this.privateMemberList;
2020-07-21 14:56:46 +08:00
this.messageList = [...this.privateMessageList];
2020-07-20 10:28:31 +08:00
},
clearAllData() {
this.recordSending = false;
this.conversitionId = '';
this.inter = null;
this.recorders = null;
this.microphone = null;
this.treeData = [];
this.conversitionMemberList = [];
this.messageList = [];
2020-07-03 18:42:29 +08:00
}
}
};
</script>
<style lang="scss" scoped>
.chatBox{
width: 503px;
position: absolute;
padding-left:5px;
left: 0;
bottom:28px;
z-index:9;
}
.chat-box{
width: 100%;
2020-07-08 09:21:54 +08:00
height: 400px;
2020-07-03 18:42:29 +08:00
}
.chat-box-header{
width: 100%;
height: 40px;
border-bottom: 1px #dedede solid;
}
.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;
}
.chat-box-content{
width: 100%;
height: 300px;
border-bottom: 1px #dedede solid;
position: relative;
}
.chat-box-contentTip{
}
.chat-box-footer{
display: inline-block;
width: 100%;
2020-07-06 18:00:44 +08:00
height: 50px;
overflow-y: auto;
2020-07-03 18:42:29 +08:00
}
.chat-window{
display: inline-block;
width: 100%;
}
.chat-setting{
float: right;
line-height: 40px;
margin-right: 10px;
cursor: pointer;
font-size: 16px;
}
.chat-createGroup{
float: right;
line-height: 40px;
margin-right: 10px;
cursor: pointer;
font-size: 16px;
position: relative;
}
.chat-box-footer-tool{
width: 100%;
2020-07-06 18:00:44 +08:00
height: 17px;
2020-07-03 18:42:29 +08:00
}
.chat-box-footer-send{
background: #36a2fd;
width: 65px;
font-size: 12px;
padding: 5px 0px 4px 0px;
text-align: center;
border-radius: 3px;
color: #fff;
float: right;
margin-right: 10px;
margin-bottom: 10px;
cursor: pointer;
}
2020-07-06 18:00:44 +08:00
.chat-box-footer-quit{
width: 65px;
font-size: 12px;
padding: 5px 0px 4px 0px;
text-align: center;
border-radius: 3px;
color: #fff;
margin-left: 10px;
margin-bottom: 10px;
cursor: pointer;
}
2020-07-03 18:42:29 +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;
left:5px;
font-size:0;
}
.chat-coversition{
}
.coversition-list{
}
.chat-box-footer-create{
width: 65px;
font-size: 12px;
padding: 5px 0px 4px 0px;
text-align: center;
border-radius: 3px;
color: #fff;
2020-07-06 18:00:44 +08:00
position: absolute;
right: 5px;
bottom: 5px;
2020-07-03 18:42:29 +08:00
margin-right: 10px;
margin-top: 10px;
cursor: pointer;
}
.showMembers{
float: right;
line-height: 40px;
margin-right: 10px;
cursor: pointer;
font-size: 17px;
}
#record_progress_bar{
height: 100%;
position: absolute;
background: #bbe5f5;
}
.chat_record_tip{
height: 28px;
display: inline-block;
background: #dfe6ee;
2020-07-06 18:14:03 +08:00
width: 370px;
2020-07-03 18:42:29 +08:00
font-size: 13px;
border-top: 1px #d8dce5 solid;
position: absolute;
bottom: 0;
2020-07-06 18:14:03 +08:00
left: 0;
2020-07-03 18:42:29 +08:00
}
.record_icon{
display: inline-block;
width: 8px;
height: 8px;
background: #25d825;
border-radius: 10px;
left: 7px;
margin-right: 0px;
box-shadow: -1px 0px 3px #6d6d6d;
border: 1px #28d228 solid;
position: absolute;
top: 10px;
}
.record_tip_text{
display: inline-block;
font-size: 12px;
margin-left: 3px;
// padding: 8px 0px 6px 0px;
position: absolute;
top: 8px;
left:20px
}
.record_tip_confirm{
position: absolute;
right: 63px;
padding: 3px 0px 2px 0px;
border: 1px #a2a5aa solid;
border-radius: 5px;
width: 45px;
text-align: center;
font-size: 12px;
top: 4px;
background: #eeeeee;
cursor: pointer;
}
.record_tip_cancle{
position: absolute;
right: 10px;
padding: 3px 0px 2px 0px;
border: 1px #a2a5aa solid;
border-radius: 5px;
width: 45px;
text-align: center;
font-size: 12px;
top: 4px;
background: #eeeeee;
cursor: pointer;
}
.chat-box-footer-send.disbled{
cursor: no-drop;
}
.minimize-box {
width: 97.5%;
height: 40px;
position: absolute;
left: 5px;
bottom: 0;
z-index: 222;
background: #fff;
border-radius: 5px;
.chat-title {
float: left;
font-size: 15px;
margin-left: 10px;
line-height: 40px;
}
.minimality {
float: right;
height: 40px;
line-height: 40px;
margin-right: 10px;
cursor: pointer;
}
}
2020-07-21 10:49:01 +08:00
.scriptTip{
position: absolute;
width: 260px;
padding: 10px;
background: rgb(250, 246, 3);
right: 89px;
bottom:45px;
border-radius: 5px;
font-size: 14px;
color: #000000;
z-index:2;
}
.scriptTip::after{
content: '';
position: absolute;
width: 0;
height: 0;
border-left: 10px solid transparent;
border-right: 10px solid transparent;
border-top: 8px solid #faf603;
right: 16px;
bottom: -7px;
}
2020-07-03 18:42:29 +08:00
</style>