diff --git a/yunkes/src/views/CallList.vue b/yunkes/src/views/CallList.vue index 5407444..a3a2774 100644 --- a/yunkes/src/views/CallList.vue +++ b/yunkes/src/views/CallList.vue @@ -72,6 +72,8 @@ const voiceClipStaffName = ref(null) // All-fields drawer state. const drawerOpen = ref(false) const drawerCall = ref(null) +const staffDrawerOpen = ref(false) +const staffDrawerCall = ref(null) const tabs: { value: CallChannel; label: string }[] = [ { value: 'voice_call', label: '微信语音' }, @@ -231,14 +233,25 @@ function openDrawer(row: PhoneCall): void { * 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) } }) + staffDrawerCall.value = row + staffDrawerOpen.value = true } +/** 员工信息抽屉的字段(从通话行的 raw_json 提取员工侧字段)。 */ +const staffDrawerSections = computed(() => { + const row = staffDrawerCall.value + if (!row) return [] + const fields: { label: string; text: string }[] = [ + { label: '姓名', text: String(cell(row, 'userName') ?? row.user_id_name ?? '--') }, + { label: '手机号', text: String(cell(row, 'userPhone') ?? '--') }, + { label: '工号', text: String(cell(row, 'jobNumber') ?? '--') }, + { label: '员工微信昵称', text: String(cell(row, 'weChatNickName') ?? '--') }, + { label: '员工微信', text: String(cell(row, 'weChatId') ?? '--') }, + { label: '部门', text: String(cell(row, 'departmentName') ?? '--') }, + ] + return [{ title: '员工信息', fields }] +}) + /** 把通话类型(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