Skip to content

Commit b6cd12a

Browse files
author
puhui999
committed
【优化】mall 客服会话置顶排序,右键菜单适配折叠菜单产生的位置偏移
1 parent 993d070 commit b6cd12a

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/views/mall/promotion/kefu/components/KeFuConversationList.vue

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,18 +72,22 @@ import { KeFuConversationApi, KeFuConversationRespVO } from '@/api/mall/promotio
7272
import { useEmoji } from './tools/emoji'
7373
import { formatDate } from '@/utils/formatTime'
7474
import { KeFuMessageContentTypeEnum } from './tools/constants'
75+
import { useAppStore } from '@/store/modules/app'
7576
7677
defineOptions({ name: 'KeFuConversationList' })
7778
7879
const message = useMessage() // 消息弹窗
79-
80+
const appStore = useAppStore()
8081
const { replaceEmoji } = useEmoji()
8182
const conversationList = ref<KeFuConversationRespVO[]>([]) // 会话列表
8283
const activeConversationId = ref(-1) // 选中的会话
84+
const collapse = computed(() => appStore.getCollapse) // 折叠菜单
8385
8486
/** 加载会话列表 */
8587
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
8791
}
8892
defineExpose({ getConversationList })
8993
@@ -132,7 +136,7 @@ const rightClick = (mouseEvent: PointerEvent, item: KeFuConversationRespVO) => {
132136
showRightMenu.value = true
133137
rightMenuStyle.value = {
134138
top: mouseEvent.clientY - 110 + 'px',
135-
left: mouseEvent.clientX - 80 + 'px'
139+
left: collapse.value ? mouseEvent.clientX - 80 + 'px' : mouseEvent.clientX - 210 + 'px'
136140
}
137141
}
138142
/** 关闭右键菜单 */

0 commit comments

Comments
 (0)