feat(staffchat): 入口改造(StaffList/CustomerList微信行切新页)+useStaffProfile缓存+StatsPane固定列/金额格式+vitest依赖化

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
浅念
2026-08-25 19:56:22 +08:00
parent 4c3bc3ee93
commit 50635d0df8
9 changed files with 489 additions and 46 deletions
+10 -4
View File
@@ -264,7 +264,12 @@ function viewGroups(row: Account): void {
async function viewChat(row: Account) {
// 账号级聊天窗口(左侧会话列表 + 右消息流);对齐云客 badge→聊天窗口。
await router.push({ name: 'chat', params: { channel: row.channel, ownerId: row.account_id } })
// 微信 → 新员工聊天窗口(五视图);WA 保持旧 ChatTimeline(新窗口仅微信)。
if (row.channel === 'wechat') {
await router.push({ name: 'staff-chat', params: { ownerId: row.account_id, tab: 'single' } })
} else {
await router.push({ name: 'chat', params: { channel: row.channel, ownerId: row.account_id } })
}
}
// ---------------------------------------------------------------------------
@@ -369,12 +374,13 @@ function joinFields(...vals: (string | undefined | null)[]): string {
return parts.length ? parts.join(' ') : '--'
}
/** modal 客户微信 → 该员工×客户聊天(带 StaffList 当前日期窗)。缺失 owner/talker 静默 no-op。 */
/** modal 客户微信 → 该员工×客户聊天(带 StaffList 当前日期窗)。缺失 owner/talker 静默 no-op。
* 微信 → 新员工聊天窗口 single tab(modal 跳转不带 msgid 定位)。 */
function openCustomerChat(row: Account, customer: StaffChatCustomer): void {
if (!row.account_id || !customer.talker_id) return
router.push({
name: 'chat',
params: { channel: 'wechat', ownerId: row.account_id, talkerId: customer.talker_id },
name: 'staff-chat',
params: { ownerId: row.account_id, tab: 'single', talkerId: customer.talker_id },
query: { start: String(statsStart.value), end: String(statsEnd.value) },
})
}