@@ -72,18 +72,22 @@ import { KeFuConversationApi, KeFuConversationRespVO } from '@/api/mall/promotio
72
72
import { useEmoji } from ' ./tools/emoji'
73
73
import { formatDate } from ' @/utils/formatTime'
74
74
import { KeFuMessageContentTypeEnum } from ' ./tools/constants'
75
+ import { useAppStore } from ' @/store/modules/app'
75
76
76
77
defineOptions ({ name: ' KeFuConversationList' })
77
78
78
79
const message = useMessage () // 消息弹窗
79
-
80
+ const appStore = useAppStore ()
80
81
const { replaceEmoji } = useEmoji ()
81
82
const conversationList = ref <KeFuConversationRespVO []>([]) // 会话列表
82
83
const activeConversationId = ref (- 1 ) // 选中的会话
84
+ const collapse = computed (() => appStore .getCollapse ) // 折叠菜单
83
85
84
86
/** 加载会话列表 */
85
87
const getConversationList = async () => {
86
- conversationList .value = await KeFuConversationApi .getConversationList ()
88
+ const list = await KeFuConversationApi .getConversationList ()
89
+ list .sort ((a : KeFuConversationRespVO , _ ) => (a .adminPinned ? - 1 : 1 ))
90
+ conversationList .value = list
87
91
}
88
92
defineExpose ({ getConversationList })
89
93
@@ -132,7 +136,7 @@ const rightClick = (mouseEvent: PointerEvent, item: KeFuConversationRespVO) => {
132
136
showRightMenu .value = true
133
137
rightMenuStyle .value = {
134
138
top: mouseEvent .clientY - 110 + ' px' ,
135
- left: mouseEvent .clientX - 80 + ' px'
139
+ left: collapse . value ? mouseEvent .clientX - 80 + ' px ' : mouseEvent . clientX - 210 + ' px'
136
140
}
137
141
}
138
142
/** 关闭右键菜单 */
0 commit comments