|
|
@@ -51,14 +51,24 @@
|
|
|
:max="99"
|
|
|
:hidden="getUnreadCount(item.appKey) < 1">
|
|
|
<el-avatar shape="square" :src="item.avatar"></el-avatar>
|
|
|
- <div class="name" :title="item.qwUserName">{{item.qwUserName}}</div>
|
|
|
- <div class="text" :title="item.corpName">{{item.corpName}}</div>
|
|
|
+ <el-popover
|
|
|
+ popper-class="popover"
|
|
|
+ placement="right"
|
|
|
+ :title="'姓名:'+item.qwUserName"
|
|
|
+ trigger="hover"
|
|
|
+ :content="'所属公司:'+item.corpName">
|
|
|
+ <div slot="reference">
|
|
|
+ <div class="name" >{{item.qwUserName}}</div>
|
|
|
+ <div class="text" >{{item.corpName}}</div>
|
|
|
+ </div>
|
|
|
+ </el-popover>
|
|
|
+
|
|
|
</el-badge>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
<template #sidebar-message-top>
|
|
|
- <div style="padding: 8px; display: flex; align-items: center;">
|
|
|
+ <div style="padding: 12px; display: flex; align-items: center;">
|
|
|
<el-input
|
|
|
v-model="searchKeyword"
|
|
|
prefix-icon="el-icon-search"
|
|
|
@@ -96,6 +106,27 @@
|
|
|
</el-popover>
|
|
|
</div>
|
|
|
</template>
|
|
|
+ <template #sidebar-contact-top>
|
|
|
+ <!-- 联系人顶部 -->
|
|
|
+ </template>
|
|
|
+ <template #group-top>
|
|
|
+ <div class="group-item" @click="toggleGroup" style="padding-top: 14px;">
|
|
|
+ <div class="left">
|
|
|
+ <i class="el-icon-arrow-right" :class="{ 'rotate': openGroup }"></i>
|
|
|
+ <div class="name">群聊</div>
|
|
|
+ </div>
|
|
|
+ <div class="num">{{qwGroupNum}}</div>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <template #contact-top>
|
|
|
+ <div class="group-item" @click="toggleContact">
|
|
|
+ <div class="left">
|
|
|
+ <i class="el-icon-arrow-right" :class="{ 'rotate': openContact }"></i>
|
|
|
+ <div class="name">联系人</div>
|
|
|
+ </div>
|
|
|
+ <div class="num">{{qwContactNum}}</div>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
<template #message-title="contact">
|
|
|
<div class="user-name">
|
|
|
{{contact.displayName}}
|
|
|
@@ -116,13 +147,14 @@
|
|
|
<div class="close-box">
|
|
|
<i class="el-icon-close" @click="handleClose" style="font-size: 22px;cursor: pointer;"/>
|
|
|
</div>
|
|
|
- <div v-if="contact.extId" style="width: 100%;height: 100%;overflow: auto">
|
|
|
+ <div v-if="contact.extId" style="width:100%;overflow: auto">
|
|
|
<userDetail :ext-id="contact.extId" :conversation-id="contact.conversationId" :extend="true" ref="userDetail" />
|
|
|
- </div>
|
|
|
+ </div>
|
|
|
<!-- 课程管理 -->
|
|
|
<div v-if="showCourseManage">
|
|
|
<course-manage :conversationId="contact.conversationId" :extend="true"/>
|
|
|
</div>
|
|
|
+
|
|
|
</template>
|
|
|
</lemon-imui>
|
|
|
</div>
|
|
|
@@ -185,6 +217,9 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ activeNames: ['0'],
|
|
|
+ openContact:false,
|
|
|
+ openGroup:false,
|
|
|
contactName:'',
|
|
|
appKey:null,
|
|
|
appId:null,
|
|
|
@@ -253,8 +288,10 @@ export default {
|
|
|
qwUserUnreadCount: [],
|
|
|
//联系人列表
|
|
|
qwContactList:[],
|
|
|
+ qwContactNum:0,
|
|
|
//群聊列表
|
|
|
- qwGrouList:[],
|
|
|
+ qwGroupList:[],
|
|
|
+ qwGroupNum:0,
|
|
|
//课程列表
|
|
|
showCourseManage:false
|
|
|
};
|
|
|
@@ -277,8 +314,12 @@ export default {
|
|
|
|
|
|
// 初始化未读消息数
|
|
|
this.initUnreadCount();
|
|
|
+ //群聊
|
|
|
+ this.initGroup(this.qwUser.id)
|
|
|
+ //this.toggleContact();
|
|
|
//联系人
|
|
|
- this.initContact(this.qwUser.id)
|
|
|
+ // this.initContact(this.qwUser.id)
|
|
|
+
|
|
|
}else {
|
|
|
this.qwUser={};
|
|
|
}
|
|
|
@@ -511,27 +552,46 @@ export default {
|
|
|
this.qwUser=this.qwUserList[index];
|
|
|
// 清除当前账号的未读消息数
|
|
|
this.clearUnreadCount(this.appKey);
|
|
|
-
|
|
|
// 不需要重新创建WebSocket连接,只需更新当前账号信息
|
|
|
this.setQwUserInfo();
|
|
|
this.getConversation(); //获取会话信息
|
|
|
this.initGroup(this.qwUser.id)
|
|
|
- this.initContact(this.qwUser.id)
|
|
|
},
|
|
|
//联系人列表
|
|
|
initContact(id){
|
|
|
getContactList(id).then(response => {
|
|
|
- this.qwContactList = response.rows;
|
|
|
- this.$refs.IMUI.initContacts(response.rows);
|
|
|
+ this.qwContactList=response.rows;
|
|
|
+ this.qwContactNum=response.total
|
|
|
+ const mergedList = [...this.qwGroupList, ...this.qwContactList];
|
|
|
+ this.$refs.IMUI.initContacts(mergedList);
|
|
|
// this.getConversationId(id)
|
|
|
});
|
|
|
},
|
|
|
//群聊列表
|
|
|
initGroup(id){
|
|
|
getGroupList(id).then(response => {
|
|
|
- this.qwGrouList = response.rows;
|
|
|
+ this.qwGroupList=response.rows
|
|
|
+ this.qwGroupNum = response.total
|
|
|
+ this.initContact(id)
|
|
|
+ //this.$refs.IMUI.initContacts(this.qwContactList);
|
|
|
});
|
|
|
},
|
|
|
+ // 切换分组展开/收起状态
|
|
|
+ toggleGroup() {
|
|
|
+ this.openGroup = !this.openGroup;
|
|
|
+ this.$refs.IMUI.changeOpenGroup(this.openGroup);
|
|
|
+ },
|
|
|
+ // 切换分组展开/收起状态
|
|
|
+ toggleContact() {
|
|
|
+ this.openContact = !this.openContact;
|
|
|
+ this.$refs.IMUI.changeOpenContact(this.openContact);
|
|
|
+ },
|
|
|
+ handleOpenGroup(val){
|
|
|
+ // console.log(val,'val')
|
|
|
+ },
|
|
|
+ handleChange(val) {
|
|
|
+ this.activeNames=val
|
|
|
+ },
|
|
|
setQwUserInfo(){
|
|
|
this.userData.id=this.qwUser.id;
|
|
|
this.userData.displayName=this.qwUser.qwUserName;
|
|
|
@@ -597,6 +657,7 @@ export default {
|
|
|
getMessageList(this.queryParams).then(response => {
|
|
|
if(response.code==200){
|
|
|
isEnd=response.data.isLastPage;
|
|
|
+ console.log(isEnd,'isEnd')
|
|
|
next(response.data.list, isEnd);
|
|
|
if(!isEnd){
|
|
|
this.qwUserPages[contact.conversationId]++;
|
|
|
@@ -657,7 +718,7 @@ export default {
|
|
|
getConversationId(data).then(response => {
|
|
|
IMUI.appendConversation(response.data)
|
|
|
IMUI.changeContact(contact.conversationId);
|
|
|
- // IMUI.currentContactId=contact.conversationId;
|
|
|
+ IMUI.currentNewContactId=contact.id;
|
|
|
});
|
|
|
}
|
|
|
},
|
|
|
@@ -1054,7 +1115,7 @@ export default {
|
|
|
<style lang="scss" scoped>
|
|
|
.close-box{
|
|
|
width: 100%;
|
|
|
- height: 49px;
|
|
|
+ height: 52px;
|
|
|
padding: 12px;
|
|
|
background: #FFFFFF;
|
|
|
// border-bottom: 1px solid #EDEFF2;
|
|
|
@@ -1151,6 +1212,43 @@ border-radius: 0 6px 6px 0;
|
|
|
// border-top-right-radius: 0; /* 避免与选中元素顶部衔接处的多余圆角 */
|
|
|
// }
|
|
|
}
|
|
|
+ .group-item{
|
|
|
+ padding-left: 12px;
|
|
|
+ padding-right: 12px;
|
|
|
+ width: 100%;
|
|
|
+ height: 45px;
|
|
|
+ line-height: 45px;
|
|
|
+ // padding-bottom: 12px;
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ align-items: center;
|
|
|
+ position: sticky;
|
|
|
+ position: -webkit-sticky;
|
|
|
+ top: 0px;
|
|
|
+ z-index: 9;
|
|
|
+ background-color: #fff;
|
|
|
+ /* 箭头旋转动画 */
|
|
|
+ .el-icon-arrow-right {
|
|
|
+ transition: transform 0.3s ease;
|
|
|
+ margin-right: 5px;
|
|
|
+ }
|
|
|
+ .el-icon-arrow-right.rotate {
|
|
|
+ transform: rotate(90deg); /* 展开时箭头向右旋转90度(指向下方) */
|
|
|
+ }
|
|
|
+ .left{
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ font-weight: 400;
|
|
|
+ font-size: 14px;
|
|
|
+ color: #141F36;
|
|
|
+ }
|
|
|
+ .num{
|
|
|
+ font-weight: 400;
|
|
|
+ font-size: 12px;
|
|
|
+ color: #84868C;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
.user-name{
|
|
|
font-weight: 500;
|
|
|
font-size: 18px;
|
|
|
@@ -1210,6 +1308,10 @@ border-radius: 0 6px 6px 0;
|
|
|
|
|
|
|
|
|
<style lang="stylus">
|
|
|
+ // .el-popover{
|
|
|
+ // color: #409EFF !important;
|
|
|
+ // }
|
|
|
+
|
|
|
.q-item{
|
|
|
.el-badge{
|
|
|
display: flex;
|
|
|
@@ -1220,8 +1322,7 @@ border-radius: 0 6px 6px 0;
|
|
|
background-color:#FC4B0E !important;
|
|
|
border: none !important;;
|
|
|
}
|
|
|
- }
|
|
|
-
|
|
|
+}
|
|
|
.lemon-container__title{
|
|
|
padding:12px !important;
|
|
|
background: #fff !important;
|
|
|
@@ -1284,14 +1385,16 @@ border-radius: 0 6px 6px 0;
|
|
|
color:#84868C !important;
|
|
|
}
|
|
|
.lemon-sidebar{
|
|
|
+ width:228px !important;
|
|
|
background: #fff !important;
|
|
|
}
|
|
|
+.lemon-sidebar div::-webkit-scrollbar {
|
|
|
+ display: none;
|
|
|
+}
|
|
|
.lemon-contact{
|
|
|
background: #fff !important;
|
|
|
}
|
|
|
-.lemon-sidebar__scroll{
|
|
|
|
|
|
-}
|
|
|
.lemon-contact--active{
|
|
|
background: #E9F1FE !important;
|
|
|
}
|