This commit is contained in:
sunzhenyu 2020-07-21 11:01:16 +08:00
commit 7e8aa6e72c
2 changed files with 64 additions and 0 deletions

View File

@ -714,6 +714,7 @@ export default {
border-radius: 5px;
font-size: 14px;
color: #000000;
z-index: 2;
}
.scriptTip::after{
content: '';

View File

@ -38,6 +38,7 @@
<div style="width: 400px;font-size: 14px;">{{ userString }}</div>
<el-button size="mini" type="primary" class="chat-box-footer-create" style="right: 80px;" @click="goCommonConversation">公共会话</el-button>
<el-button size="mini" type="primary" class="chat-box-footer-create" :loading="createLoading" @click="createCoversition()">创建群聊</el-button>
<div v-if="scriptTip" class="scriptTip">{{ scriptTip }}</div>
</div>
</div>
<div v-else class="chat-window">
@ -79,6 +80,7 @@
<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>
<el-button v-if="isButtonShow && !commonConversation" class="chat-box-footer-send" size="mini" type="primary" :disabled="recordSending" @click="startRecording()">发送语音</el-button>
<div v-if="scriptTip" class="scriptTip">{{ scriptTip }}</div>
</div>
</div>
</div>
@ -97,6 +99,7 @@
import ChatSetting from './chatSetting';
import ChatTooltip from './chatTooltip';
import ChatContent from './chatContent';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import ChatMemberList from './chatMemberList';
import RecordRTC from 'recordrtc';
import {sendSimulationConversition, startConversition, overSimulationConversition, getAllConversition} from '@/api/chat';
@ -135,6 +138,7 @@ export default {
language:'zh',
sex:'1'
},
scriptTip:'',
treeData: [],
defaultProps: {
children: 'children',
@ -197,6 +201,7 @@ export default {
});
},
'$store.state.socket.createConversition':function(val) {
debugger;
const member = this.memberData[val.creatorId];
if (member.userId == this.$store.state.user.id) {
const memberList = [];
@ -211,6 +216,37 @@ export default {
this.privateMemberList = memberList;
this.commonConversation = false;
}
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();
}
}
},
'$store.state.socket.scriptFinish':function(val, old) {
this.$message('剧本执行完成');
@ -309,6 +345,7 @@ export default {
},
mounted() {
this.firstClick = true;
this.scriptTip = '';
},
methods:{
handleMinimality(data) {
@ -346,6 +383,7 @@ export default {
},
//
startRecording() {
this.scriptTip = '';
const that = this;
if (!this.recordSending && !this.recorders && !this.microphone) {
this.$refs.chatSetting.doClose();
@ -477,6 +515,7 @@ export default {
},
quitConversition() {
this.quitLoading = true;
this.scriptTip = '';
overSimulationConversition(this.group, this.conversitionId).then(resp => {
this.conversitionId = '';
this.conversitionMemberList = [];
@ -849,4 +888,28 @@ export default {
}
}
.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;
}
</style>