From 128df39113eee75e530399f1d663abde35e21aa4 Mon Sep 17 00:00:00 2001 From: jinliang Date: Tue, 14 Jul 2026 18:00:45 +0800 Subject: [PATCH] feat(admin): conversation scene and account binding by scene --- admin-web/src/views/Conversation.vue | 41 ++++++++++++++++++++++++---- 1 file changed, 36 insertions(+), 5 deletions(-) diff --git a/admin-web/src/views/Conversation.vue b/admin-web/src/views/Conversation.vue index bd81609..7be8018 100644 --- a/admin-web/src/views/Conversation.vue +++ b/admin-web/src/views/Conversation.vue @@ -28,6 +28,11 @@ + + + @@ -71,6 +76,12 @@ + + + + + + @@ -114,6 +125,12 @@ + + + + + + @@ -270,6 +287,7 @@ const editingId = ref(null) const dialogForm = reactive({ conversationType: 2, channelType: 'wecom', + conversationScene: undefined as number | undefined, channelConversationId: '', conversationName: '', ownerAccountId: undefined as number | undefined, @@ -311,6 +329,7 @@ watch([searchQuery, typeFilter], () => { function resetDialogForm() { dialogForm.conversationType = 2 dialogForm.channelType = 'wecom' + dialogForm.conversationScene = undefined dialogForm.channelConversationId = '' dialogForm.conversationName = '' dialogForm.ownerAccountId = undefined @@ -320,6 +339,7 @@ function resetDialogForm() { function fillDialogForm(row: any) { dialogForm.conversationType = row.conversationType ?? 2 dialogForm.channelType = row.channelType ?? 'wecom' + dialogForm.conversationScene = row.conversationScene ?? undefined dialogForm.channelConversationId = row.channelConversationId ?? '' dialogForm.conversationName = row.conversationName ?? '' dialogForm.ownerAccountId = row.ownerAccountId @@ -359,11 +379,14 @@ function formatAccountName(id: number | undefined) { } const filteredBindAccounts = computed(() => { - const channelType = currentBindConversation.value?.channelType - if (!channelType) return accounts.value - return accounts.value.filter((a: any) => - a.channelType?.toLowerCase() === channelType?.toLowerCase() - ) + const scene = currentBindConversation.value?.conversationScene + if (scene === 1) { + return accounts.value.filter((a: any) => a.accountType === 6) + } + if (scene === 2) { + return accounts.value.filter((a: any) => a.accountType === 3) + } + return accounts.value }) function formatConversationType(type: number | undefined) { @@ -372,6 +395,12 @@ function formatConversationType(type: number | undefined) { return type ?? '-' } +function formatConversationScene(scene: number | undefined) { + if (scene === 1) return '内部群' + if (scene === 2) return '外部群' + return scene ?? '-' +} + function formatParticipantType(type: number | undefined) { if (type === 1) return '群主' return '成员' @@ -447,6 +476,7 @@ async function handleSave() { const payload = { conversationType: dialogForm.conversationType, channelType: dialogForm.channelType, + conversationScene: dialogForm.conversationScene, channelConversationId: dialogForm.channelConversationId, conversationName: dialogForm.conversationName, ownerAccountId: dialogForm.ownerAccountId, @@ -473,6 +503,7 @@ async function handleStatusChange(row: any, val: any) { await updateConversation(row.id, { conversationType: row.conversationType, channelType: row.channelType, + conversationScene: row.conversationScene, channelConversationId: row.channelConversationId, conversationName: row.conversationName, ownerAccountId: row.ownerAccountId,