实训平台 综合演练 聊天代码调整

This commit is contained in:
joylink_cuiweidong 2020-05-13 10:21:53 +08:00
parent 6fe3fe6ecb
commit 6866b58b19
2 changed files with 5 additions and 136 deletions

View File

@ -154,7 +154,9 @@ export default {
} }
}, },
handleMember(member) { handleMember(member) {
return member.name ? member.role + '-' + member.name : member.role; const deviceName = member.deviceName ? '-' + member.deviceName : '';
const memberName = member.name ? '-' + member.name : '';
return member.role + deviceName + memberName;
}, },
// //
startRecording() { startRecording() {

View File

@ -1,63 +1,6 @@
<template> <template>
<div> <div>
<chat-box :group="group" /> <chat-box :group="group" />
<!-- <div v-show="!minimize" class="reminder-drag">
<div v-if="userRole != '05' && userRole != ''">
<div class="tabs-roles">
<div
class="roles roles-first"
:class="activeName == 'first' ? 'roles-active':''"
@click="clickRoles('first')"
>角色
</div>
<div
class="roles"
:class="activeName == 'second' ? 'roles-active':''"
@click="clickRoles('second')"
>所有人
</div>
<div class="minimality" @click="handleMinimality('min')">
<i class="el-icon-remove" />
</div>
</div>
<div class="tabs-content">
<div v-show="activeName == 'first'">
<chart-view
ref="chatView"
:group="group"
:station-list="stationLists"
@showChatSpeak="showChatSpeak"
@showChat="showChat"
@showChatNone="showChatNone"
/>
</div>
<div style="flex-grow: 1">
<chart-window
ref="chat"
:group="group"
:chat-show="chatShow"
:speaking="isSpeaking"
:is-show-auto="isShowAuto"
@handleChatShow="handleChatShow"
@handleChatList="handleChatList"
/>
</div>
</div>
</div>
<div v-else>
<el-tabs v-model="activeName2" type="card">
<el-tab-pane label="所有人" name="second">
<chart-window :speaking="isSpeaking" :group="group" :is-show-auto="true" />
</el-tab-pane>
</el-tabs>
</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> -->
<div class="display-draft" :class="{'display-type-hb': $route.query.lineCode == '07' && $store.state.training.prdType=='01'}"> <div class="display-draft" :class="{'display-type-hb': $route.query.lineCode == '07' && $store.state.training.prdType=='01'}">
<el-button-group> <el-button-group>
<el-button v-if="isProject && !dataError " type="primary" @click="setRelDevice">{{ $t('joinTraining.connectRealDevices') }}</el-button> <el-button v-if="isProject && !dataError " type="primary" @click="setRelDevice">{{ $t('joinTraining.connectRealDevices') }}</el-button>
@ -124,23 +67,11 @@ export default {
return { return {
isDisable: false, isDisable: false,
backLoading:false, backLoading:false,
timeNow: 0,
remainingTime: 0,
recordStep: 'BGSetting',
training: {
id: '',
name: '',
remarks: ''
},
chatShow: true, chatShow: true,
isShowAuto: false,
offset: 10, offset: 10,
userId: '', userId: '',
activeName: 'first',
activeName2: 'second',
stationList: [], stationList: [],
stationLists: [], stationLists: []
minimize: true
}; };
}, },
computed: { computed: {
@ -171,6 +102,7 @@ export default {
} }
}, },
'$store.state.socket.roleList': function (val) { '$store.state.socket.roleList': function (val) {
debugger;
if (val && val.length) { if (val && val.length) {
this.$nextTick(() => { this.$nextTick(() => {
this.addrolesList(val); this.addrolesList(val);
@ -208,63 +140,6 @@ export default {
console.log(error); console.log(error);
} }
}, },
// tab
clickRoles(active) {
if (active == 'first') {
this.chatShow = true;
this.isShowAuto = false;
this.$refs.chatView.select(); //
this.$refs.chat.clearPlay('', ''); // id
} else {
this.chatShow = false;
this.isShowAuto = true;
this.$refs.chat.getChathistory('', ''); //
}
this.activeName = active;
},
// handleChatShow(data) {
// if (!this.minimize) { //
// if (this.activeName == 'first') {
// this.$refs.chatView.select(data.id);
// this.chatShow = false;
// this.isShowAuto = false;
// this.$refs.chat.handleTextList(data.conversationId);
// } else {
// this.activeName = 'first';
// this.handleChatShow(data);
// }
// } else { //
// this.minimize = false;
// this.handleChatShow(data);
// }
// },
//
// showChatSpeak(data) {
// this.chatShow = false;
// this.isShowAuto = false;
// this.$refs.chat.handleTextList(data.conversationId);
// },
// list
showChat(obj) {
this.chatShow = false;
this.$refs.chat.getChathistory(obj.code, obj.id);
},
handleChatList(data) {
this.$refs.chatView.hintInfo(data);
},
//
showChatNone() {
this.chatShow = true;
},
messageInfo(message, type) {
this.$message({
showClose: true,
message: message,
type: type
});
},
setPosition() { setPosition() {
this.$nextTick(() => { this.$nextTick(() => {
let offset = 10; let offset = 10;
@ -336,14 +211,6 @@ export default {
this.$refs.chatView.getUserRole(); this.$refs.chatView.getUserRole();
} }
}, },
handleClick(tab, event) {
if (this.activeName == 'second') {
this.$refs.chat.getChathistory();
}
},
initPlannedDriving(isDisable) {
this.isDisable = isDisable;
},
selectBeginTime() { selectBeginTime() {
this.$refs.setTime.doShow(); this.$refs.setTime.doShow();
}, },