diff --git a/yunkes/src/views/StaffList.vue b/yunkes/src/views/StaffList.vue index ee24c3b..09e55de 100644 --- a/yunkes/src/views/StaffList.vue +++ b/yunkes/src/views/StaffList.vue @@ -206,10 +206,16 @@ async function viewChat(row: Account) { ElMessage.info('该账号暂无聊天记录') return } - const path = m.room_id - ? `/group/${row.channel}/${row.account_id}/${m.room_id}` - : `/chat/${row.channel}/${row.account_id}/${m.talker_id}` - router.push(path) + const target = m.room_id ?? m.talker_id + if (!target) { + ElMessage.info('最近一条消息无会话标识') + return + } + await router.push( + m.room_id + ? `/group/${row.channel}/${row.account_id}/${m.room_id}` + : `/chat/${row.channel}/${row.account_id}/${m.talker_id}`, + ) } // --------------------------------------------------------------------------- @@ -238,25 +244,26 @@ const baseCustomerCols = [ function openAddedModal(row: Account) { // ⚠️ WA customer has no add_time (Task 2 confirmed: WA raw_json lacks // addTime; createTime is owner-staff). Degrade: do NOT set add_time_since - // (would be empty); show all WA customers for this staff, sorted by - // last_chat_time. - detailTitle.value = `添加人数 · ${row.user_name ?? row.account_id}` + // (would be empty); show all customers of this account, sorted by last_chat_time. + // 用 owner_account_id(=account_id,始终存在)而非 user_id(可能 null 导致全表泄漏)。 + // 标题如实写"客户列表"——非"添加人数",因 WA 无法按 add_time 精确筛新增。 + detailTitle.value = `客户列表 · ${row.user_name ?? row.account_id}` detailCols.value = baseCustomerCols detailFetcher.value = (p, s) => - getCustomers({ user_id: row.user_id!, channel: 'whatsapp', page: p, page_size: s }) + getCustomers({ owner_account_id: row.account_id, channel: row.channel, page: p, page_size: s }) detailOpen.value = true } function openTalkedModal(row: Account) { // 沟通人数: chatted within the last 7 days (last_chat_time exists on both - // channels). + // channels). 用 owner_account_id(始终存在)而非 user_id(可能 null)。 const since = Date.now() - 7 * 86400000 detailTitle.value = `沟通人数 · ${row.user_name ?? row.account_id}` detailCols.value = baseCustomerCols detailFetcher.value = (p, s) => getCustomers({ - user_id: row.user_id!, - channel: 'whatsapp', + owner_account_id: row.account_id, + channel: row.channel, last_chat_since: since, page: p, page_size: s, @@ -785,6 +792,7 @@ onMounted(() => { } .yk-staffinfo__nick { + display: block; font-weight: 600; font-size: 13px; color: #303133;