diff --git a/yunkes/src/views/StaffList.vue b/yunkes/src/views/StaffList.vue index 6117d31..ee51155 100644 --- a/yunkes/src/views/StaffList.vue +++ b/yunkes/src/views/StaffList.vue @@ -3,7 +3,7 @@ import { computed, onMounted, reactive, ref } from 'vue' import { useRouter } from 'vue-router' import { ElMessage } from 'element-plus' import { getAccounts, getCustomers, getMessages } from '@/api' -import type { Account, Channel } from '@/api/types' +import type { Account, Channel, Customer } from '@/api/types' import YkStaffDetailModal from '@/components/YkStaffDetailModal.vue' import { useChannelStore } from '@/stores/channel' import { channelLabel, formatTime } from '@/utils/format' @@ -274,13 +274,26 @@ function openTalkedModal(row: Account) { /** 微信员工「沟通数」3 数字 → 明细 modal(数据源:该员工客户列表,度量精确区分见 plan 数据源说明)。 */ function openWechatCommModal(row: Account, title: string, withMsgCols: boolean): void { detailTitle.value = `${title} · ${row.user_name ?? row.account_id}` + // 客户微信列可点 → 跳该客户聊天记录(ChatTimeline,name:'chat' 路由同 CustomerList.viewChat)。 + // modal 列数据是 Customer,goChat 守卫 owner/friend 存在;缺失则静默 no-op(与 onClick?: 一致)。 + const goChat = (r: Customer) => { + if (!r.owner_account_id || !r.friend_id) return + router.push({ + name: 'chat', + params: { + channel: r.channel, + ownerId: r.owner_account_id, + talkerId: r.friend_id, + }, + }) + } detailCols.value = withMsgCols ? [ - { prop: 'friend_nickname', label: '客户微信', minWidth: 160 }, + { prop: 'friend_nickname', label: '客户微信', minWidth: 160, onClick: goChat }, { prop: 'send_num', label: '发送消息数', width: 110, align: 'center' }, { prop: 'receive_num', label: '接收消息数', width: 110, align: 'center' }, ] - : [{ prop: 'friend_nickname', label: '客户微信', minWidth: 160 }] + : [{ prop: 'friend_nickname', label: '客户微信', minWidth: 160, onClick: goChat }] detailFetcher.value = async (page: number, page_size: number) => getCustomers({ channel: 'wechat', owner_account_id: row.account_id, page, page_size }) detailOpen.value = true