diff --git a/yunkes/src/router/index.ts b/yunkes/src/router/index.ts index ae2257f..2632131 100644 --- a/yunkes/src/router/index.ts +++ b/yunkes/src/router/index.ts @@ -21,6 +21,17 @@ const routes: RouteRecordRaw[] = [ component: () => import('@/views/StaffList.vue'), meta: { title: '员工列表' }, }, + { + // Standalone 员工详情 page mirroring 云客's + // /cms/customer/userDetailNew?userId=... — replaces the all-fields drawer + // degradation for the 员工姓名 click. Row-click in StaffList still opens + // the drawer for a quick preview. + path: '/staff-detail/:userId', + name: 'staff-detail', + component: () => import('@/views/StaffDetail.vue'), + props: true, + meta: { title: '员工详情' }, + }, { path: '/accounts', redirect: { name: 'staff' }, diff --git a/yunkes/src/views/CallList.vue b/yunkes/src/views/CallList.vue index d834087..fc55a69 100644 --- a/yunkes/src/views/CallList.vue +++ b/yunkes/src/views/CallList.vue @@ -156,6 +156,21 @@ function openDrawer(row: PhoneCall): void { drawerOpen.value = true } +/** + * 员工姓名 click → standalone 员工详情 page (mirrors 云客 userDetailNew). + * Distinct from row-click which still opens the all-fields call drawer. + * Prefer the structured `user_id`; fall back to the raw_json `userId` cell so + * calls whose structured user_id is null still resolve. + */ +function goToStaffDetail(row: PhoneCall): void { + const id = row.user_id ?? (cell(row, 'userId') as string | undefined) + if (!id) { + ElMessage.info('该通话无员工 userId,无法查看员工详情') + return + } + router.push({ name: 'staff-detail', params: { userId: String(id) } }) +} + /** 把通话类型(voice_call/wa_voice_call)映射到聊天渠道(wechat/whatsapp)。电话返回 null。 */ function chatChannel(ch: CallChannel): 'wechat' | 'whatsapp' | null { return ch === 'voice_call' ? 'wechat' : ch === 'wa_voice_call' ? 'whatsapp' : null @@ -268,7 +283,7 @@ onMounted(load) @@ -303,7 +318,7 @@ onMounted(load)