diff --git a/admin-web/src/views/Conversation.vue b/admin-web/src/views/Conversation.vue
index 06e23ca..1b5ed4e 100644
--- a/admin-web/src/views/Conversation.vue
+++ b/admin-web/src/views/Conversation.vue
@@ -95,7 +95,7 @@
+
+
+
取消
@@ -214,6 +217,12 @@ function formatAccountName(id: number | undefined) {
return accountMap.value.get(id) || id
}
+const filteredBindAccounts = computed(() => {
+ const channelType = currentBindConversation.value?.channelType
+ if (!channelType) return accounts.value
+ return accounts.value.filter((a: any) => a.channelType === channelType)
+})
+
function formatConversationType(type: number | undefined) {
if (type === 1) return '单聊'
if (type === 2) return '群聊'
@@ -312,23 +321,25 @@ async function handleDelete(row: any) {
}
const bindAccountVisible = ref(false)
-const currentConversationId = ref()
+const currentBindConversation = ref(null)
const bindAccountForm = reactive({
accountId: undefined as number | undefined,
bindingType: 1,
+ sortOrder: 0,
})
function openBindAccount(row: any) {
- currentConversationId.value = row.id
+ currentBindConversation.value = row
bindAccountForm.accountId = undefined
bindAccountForm.bindingType = 1
+ bindAccountForm.sortOrder = 0
bindAccountVisible.value = true
}
async function handleBindAccount() {
- if (!currentConversationId.value) return
+ if (!bindAccountForm.accountId || !currentBindConversation.value) return
try {
- await bindConversationAccount(currentConversationId.value, bindAccountForm)
+ await bindConversationAccount(currentBindConversation.value.id, bindAccountForm)
ElMessage.success('绑定成功')
bindAccountVisible.value = false
await loadConversations()
@@ -337,6 +348,8 @@ async function handleBindAccount() {
}
}
+const currentConversationId = ref()
+
const bindTagsVisible = ref(false)
const bindTagsForm = reactive({
tagIds: [] as number[],