This commit is contained in:
fan 2023-05-22 17:16:53 +08:00
commit 1501a75ad3
3 changed files with 27 additions and 7 deletions

View File

@ -1,8 +1,8 @@
<template>
<div>
<div class="alarm-button">
<el-button type="warning" icon="el-icon-message-solid" circle @click="showAlarm" />
<div v-if="alarmDetailMessageList.length>0" class="alarm-counter">{{ alarmDetailMessageList.length }}</div>
<div>
<!-- <el-button type="warning" icon="el-icon-message-solid" circle @click="showAlarm" />
<div v-if="alarmDetailMessageList.length>0" class="alarm-counter">{{ alarmDetailMessageList.length }}</div> -->
<audio ref="audio" />
</div>
<!-- <el-dialog

View File

@ -56,7 +56,7 @@
</div>
</div>
<div class="right">
<chat-content :id="id" :group-name="activeGroupName" :private-chat-id="privateChatId" :message-list="activeMessageList" />
<chat-content v-if="id || privateChatId" :id="id" :group-name="activeGroupName" :private-chat-id="privateChatId" :message-list="activeMessageList" />
</div>
</div>
<div v-show="tabActive==1" class="contentBox">
@ -129,6 +129,13 @@ export default {
memberData() {
return this.$store.state.training.memberData;
},
totalUnread() {
let n = 0;
this.groupList.forEach(item => {
n += this.getBadge(item.messageList);
});
return n;
},
chatList() {
const list = JSON.parse(JSON.stringify(this.groupList));
this.noIdChatList.forEach(item => {
@ -168,7 +175,10 @@ export default {
'$store.state.socket.simulationReset': function (val) { // 仿
if (val) {
this.id = 0;
this.privateChatId = '';
this.$store.dispatch('socket/resetConversationGroup');
this.groupList = [];
this.noIdChatList = [];
}
},
'$store.state.socket.conversationGroup.MESSAGE': function(val) {
@ -191,6 +201,7 @@ export default {
}
if (val.id) {
this.groupList.push({...val, messageList: [], imageUrl: ''});
this.removeNoIdItem();
}
},
'$store.state.socket.conversationGroup.UPDATE_NAME': function(val) {
@ -228,6 +239,9 @@ export default {
this.groupList.splice(index, 1);
}
},
totalUnread() {
this.$emit('setTotalUnread', this.totalUnread);
},
myMemberId() {
this.getGroupList();
},
@ -350,7 +364,7 @@ export default {
},
sendPrivateMsg(item) {
this.privateChatId = item.id;
const findIndex = this.groupList.findIndex(ii => {
const findIndex = this.chatList.findIndex(ii => {
return ii.type == 'PRIVATE_CHAT' && ii.memberList.find(m => {
return m.memberId == item.id;
});

View File

@ -1,9 +1,11 @@
<template>
<div v-quickMenuDrag class="voice-chat-box">
<div v-if="chatBoxMin" :id="sideButtonDom.domId" @click="clickBtn">
<el-button circle style="color: #0C161A;" icon="el-icon-mic" />
<el-badge :value="totalUnreadNum" :hidden="!totalUnreadNum" :max="99">
<el-button circle style="color: #0C161A;" icon="el-icon-mic" />
</el-badge>
</div>
<chatDialog ref="chatDialog" />
<chatDialog ref="chatDialog" @setTotalUnread="setTotalUnread" />
</div>
</template>
@ -18,6 +20,7 @@ export default {
},
data() {
return {
totalUnreadNum: 0
};
},
computed:{
@ -33,6 +36,9 @@ export default {
mounted() {
},
methods: {
setTotalUnread(val) {
this.totalUnreadNum = val;
},
clickBtn() {
const operate = {
operation: this.sideButtonDom.operation,