From ce5cada8984b0cc076efed9ee7661309ffcad7f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B5=85=E5=BF=B5?= Date: Thu, 20 Aug 2026 15:34:17 +0800 Subject: [PATCH] =?UTF-8?q?feat(chat):=20=E5=BD=92=E5=B1=9E=E8=B4=A6?= =?UTF-8?q?=E5=8F=B7=E6=98=BE=E7=A4=BA=E6=98=B5=E7=A7=B0(=E8=B4=A6?= =?UTF-8?q?=E5=8F=B7=E8=A1=A8=E6=9F=A5=E8=AF=A2,=E6=98=B5=E7=A7=B0+ID?= =?UTF-8?q?=E5=B9=B6=E5=88=97,=E5=9B=9E=E9=80=80=E5=8E=9F=E5=A7=8BID)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude --- yunkes/src/views/ChatTimeline.vue | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/yunkes/src/views/ChatTimeline.vue b/yunkes/src/views/ChatTimeline.vue index 9bc9ba3..3d8a303 100644 --- a/yunkes/src/views/ChatTimeline.vue +++ b/yunkes/src/views/ChatTimeline.vue @@ -3,7 +3,7 @@ import { computed, nextTick, onMounted, ref, watch } from 'vue' import { useRoute, useRouter } from 'vue-router' import { ElMessage } from 'element-plus' import { ArrowLeft } from '@element-plus/icons-vue' -import { getCustomers, getGroups, getMessages } from '@/api' +import { getAccounts, getCustomers, getGroups, getMessages } from '@/api' import { downloadBlob } from '@/api/client' import type { Channel, Message } from '@/api/types' import MessageBubble from '@/components/MessageBubble.vue' @@ -134,13 +134,30 @@ const winStart = computed(() => dateRange.value[0].getTime()) const winEnd = computed(() => dateRange.value[1].getTime()) const keyword = ref('') +/** 归属账号昵称(账号表查,回退原始 id)。 */ +const ownerNickname = ref(null) + +async function loadOwnerNickname(): Promise { + ownerNickname.value = null + try { + const res = await getAccounts({ channel: channelTyped.value, page: 1, page_size: 100 }) + const acc = res.items.find(a => a.account_id === props.ownerId) + ownerNickname.value = acc?.nickname || acc?.user_name || null + } catch { + ownerNickname.value = null + } +} + function onDateChange(): void { loadInitial() } const subtitle = computed(() => { + const ownerLabel = ownerNickname.value + ? `${ownerNickname.value}(${props.ownerId})` + : props.ownerId let s = - `渠道:${channelLabel(channelTyped.value)} · 归属账号:${props.ownerId}` + + `渠道:${channelLabel(channelTyped.value)} · 归属账号:${ownerLabel}` + (total.value > 0 ? ` · 共 ${total.value} 条` : '') s += ` · 时段:${formatTime(winStart.value)} ~ ${formatTime(winEnd.value)}` return s @@ -302,12 +319,14 @@ watch( () => { loadInitial() loadTalkerName() + loadOwnerNickname() }, ) onMounted(() => { loadInitial() loadTalkerName() + loadOwnerNickname() })