This commit is contained in:
fan 2023-05-22 16:07:08 +08:00
commit 83ee31034b
4 changed files with 60 additions and 23 deletions

View File

@ -180,6 +180,12 @@ class Handler {
operation3.operationType = CMD.Conversation.CMD_Conversation_Group_Audio_Base64.value;
operation3.params.id = operation.params.id;
}
if (operation.operationType == CMD.Conversation.CMD_Conversation_Group_Private_Text_Chat.value) { // 私聊新会话接口
step2.description = `私聊选中:${operation.params.groupName},点击录制语音`;
operation2.params.memberId = operation.params.memberId;
operation3.operationType = CMD.Conversation.CMD_Conversation_Group_Private_Audio_Base64.value;
operation3.params.memberId = operation.params.memberId;
}
const step3 = {
description: `请说出“${operation.params.content}”后,再次点击发送语音!`,
memberId: stepInfo.memberId,

View File

@ -2,7 +2,7 @@
<div class="main">
<div class="left">
<div class="searchBox">
<el-input v-model="queryMember" placeholder="请输入搜索人员" clearable>
<el-input v-model="queryMember" placeholder="请输入搜索人员" clearable size="medium">
<el-button slot="append" icon="el-icon-search" />
</el-input>
</div>
@ -121,6 +121,9 @@ export default {
display: flex;
.left{
width: 300px;
.searchBox {
padding: 2px 5px;
}
.treeBox {
height: calc(100% - 40px);
overflow: auto;

View File

@ -28,7 +28,7 @@
<div class="chat-box-footer">
<el-input v-model="textContent" size="small" placeholder="请输入会话文字点击T发送" style="flex: 1; margin-left: 5px;" :rows="1" />
<el-button :id="sendTextId" size="mini" class="chat-box-footer-create" :disabled="contentSend || (!id && !privateChatId)" @click="sendText">T</el-button>
<el-button :id="recordVoice" class="chat-box-footer-create chat-box-footer-send" :class="{'active': recordSending}" :disabled="audioPlay || (trainingDesign && !trainingSwitch) || !id" size="mini" type="primary" @click="startRecording()">
<el-button :id="recordVoice" class="chat-box-footer-create chat-box-footer-send" :class="{'active': recordSending}" :disabled="audioPlay || (trainingDesign && !trainingSwitch) || (!id && !privateChatId)" size="mini" type="primary" @click="startRecording()">
<el-progress id="voice_progress_bar" type="circle" :show-text="false" :percentage="100/maxSeconds*seconds" :width="40" :stroke-width="2" status="success" />
<i v-if="recordSending" class="el-icon-close close_icon" @click.stop="cancelRecording()" />
<span class="iconfont icon-yuyin">&#xe62b;</span>
@ -337,6 +337,10 @@ export default {
id: this.id
}
};
if (this.privateChatId) {
delete operate.param.id;
operate.param.memberId = this.privateChatId;
}
this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => {
if (valid) {
this.audioPlay = true;

View File

@ -56,7 +56,7 @@
</div>
</div>
<div class="right">
<chat-content :id="id" :group-name="groupName" :private-chat-id="privateChatId" :message-list="activeMessageList" />
<chat-content :id="id" :group-name="activeGroupName" :private-chat-id="privateChatId" :message-list="activeMessageList" />
</div>
</div>
<div v-show="tabActive==1" class="contentBox">
@ -146,13 +146,20 @@ export default {
}
return list;
},
groupName() {
activeGroupName() {
let name = '';
const find = this.groupList.find(item => {
return item.id == this.id;
});
if (find) {
name = this.getGroupName(find);
if (this.privateChatId) {
const m = this.memberData[this.privateChatId];
if (m) {
name = m.labelName;
}
} else {
const find = this.groupList.find(item => {
return item.id == this.id;
});
if (find) {
name = this.getGroupName(find);
}
}
return name;
}
@ -182,25 +189,44 @@ export default {
if (val.messageTips) {
this.$message.success(`${val.messageTips}`);
}
this.getGroupList();
if (val.id) {
this.groupList.push({...val, messageList: [], imageUrl: ''});
}
},
'$store.state.socket.conversationGroup.UPDATE_NAME': function(val) {
if (val.messageTips) {
this.$message.success(`${val.messageTips}`);
if (val.id) {
const index = this.groupList.findIndex(item => {
return item.id == val.id;
});
if (index > -1) {
this.groupList.splice(index, 1, {...this.groupList[index], name: val.name});
}
}
this.getGroupList();
},
'$store.state.socket.conversationGroup.UPDATE_MEMBER': function(val) {
if (val.messageTips) {
this.$message.success(`${val.messageTips}`);
if (val.id) {
const index = this.groupList.findIndex(item => {
return item.id == val.id;
});
if (index > -1) {
const obj = {
...this.groupList[index],
memberList: val.memberList
};
if (val.leaderId) {
obj.leaderId = val.leaderId;
}
this.groupList.splice(index, 1, obj);
}
}
this.getGroupList();
},
'$store.state.socket.conversationGroup.EXIT': function(val) {
if (val.messageTips) {
this.$message.success(`${val.messageTips}`);
if (val.id) {
const index = this.groupList.findIndex(item => {
return item.id == val.id;
});
this.groupList.splice(index, 1);
}
this.getGroupList();
},
myMemberId() {
this.getGroupList();
@ -250,7 +276,6 @@ export default {
name: suc.value
};
updateGroupName(this.groupId, data).then(res => {
this.getGroupList();
this.$message.success('修改群名称成功!');
}).catch(err => {
this.$message.error(`修改群名称失败!,${err.message}`);
@ -262,7 +287,6 @@ export default {
},
updateLeaderId(param) {
updateGroupLeader(this.groupId, param).then(res => {
this.getGroupList();
this.$message.success('修改群主成功!');
}).catch(err => {
this.$message.error(`修改群主失败!,${err.message}`);
@ -877,7 +901,7 @@ export default {
.text {
height: 22px;
line-height: 22px;
padding: 3px 5px;
padding: 0px 5px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
@ -890,7 +914,7 @@ export default {
flex-direction: column;
align-items: center;
.time, i {
padding: 3px 0px;
padding: 0px 0px;
justify-content: center;
}
.time {