fix(channel-conversation): address code review issues for Task 5

- Make frontend account filter case-insensitive in Conversation.vue
- Warn when bind dialog is submitted without selecting an account
- Reuse AccountSelector.isHealthy in resolvePersonTarget
- Expand ConversationService.bindAccount unit tests
- Update channel mismatch assertion in SendServiceResolveTargetTest
- Move currentConversationId declaration near tag binding state
This commit is contained in:
2026-07-08 17:58:35 +08:00
parent 2cdbc662f3
commit 78a46977ba
4 changed files with 61 additions and 10 deletions

View File

@@ -220,7 +220,9 @@ 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 === channelType)
return accounts.value.filter((a: any) =>
a.channelType?.toLowerCase() === channelType?.toLowerCase()
)
})
function formatConversationType(type: number | undefined) {
@@ -337,7 +339,10 @@ function openBindAccount(row: any) {
}
async function handleBindAccount() {
if (!bindAccountForm.accountId || !currentBindConversation.value) return
if (!bindAccountForm.accountId || !currentBindConversation.value) {
ElMessage.warning('请选择账号')
return
}
try {
await bindConversationAccount(currentBindConversation.value.id, bindAccountForm)
ElMessage.success('绑定成功')
@@ -348,8 +353,8 @@ async function handleBindAccount() {
}
}
const currentConversationId = ref<number | undefined>()
const currentConversationId = ref<number | undefined>()
const bindTagsVisible = ref(false)
const bindTagsForm = reactive({
tagIds: [] as number[],