From 7a5bb9927e1959a4dde2ca1d3140cb57cb864db3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B5=85=E5=BF=B5?= Date: Fri, 7 Aug 2026 11:54:38 +0800 Subject: [PATCH] =?UTF-8?q?feat(calls):=20callStatusLabel=20channel-aware?= =?UTF-8?q?=20+=20callTypeLabel=20WA=20+=20=E8=A1=A5=20WA/=E5=BE=AE?= =?UTF-8?q?=E4=BF=A1=E8=AF=AD=E9=9F=B3=E5=AD=97=E6=AE=B5=20label?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit call_status 极性随 channel 不同(phone 0未接/2接通;voice/WA 1接通/2未接通), 仅值 2 按 channel 分支。 Co-Authored-By: Claude --- yunkes/src/utils/callFields.ts | 11 +++++++++++ yunkes/src/utils/format.ts | 25 ++++++++++++++++++------- yunkes/src/views/CallList.vue | 6 +++--- 3 files changed, 32 insertions(+), 10 deletions(-) diff --git a/yunkes/src/utils/callFields.ts b/yunkes/src/utils/callFields.ts index 9a0c111..2853d65 100644 --- a/yunkes/src/utils/callFields.ts +++ b/yunkes/src/utils/callFields.ts @@ -55,6 +55,17 @@ export const CALL_FIELD_LABELS: Record = { // 关联与版本 planCustomerName: '关联客户', version: '版本', + // 微信/WA 语音 + userWeChatNickName: '员工微信昵称', + userWeChatAlias: '员工微信号', + userPhone: '员工手机', + talker: '客户号', + talkerNickName: '客户昵称', + talkerAlias: '客户微信号', + weChatId: '员工微信ID', + callFileId: '录音文件ID', + from: '通话来源', + isRoom: '是否群通话', } /** diff --git a/yunkes/src/utils/format.ts b/yunkes/src/utils/format.ts index a701691..cfac857 100644 --- a/yunkes/src/utils/format.ts +++ b/yunkes/src/utils/format.ts @@ -82,13 +82,15 @@ export function wechatTypeLabel(typeRaw?: number | null): string { // Phone / voice call rendering // --------------------------------------------------------------------------- -/** Call-type (PhoneCall.channel) label — 电话 vs 语音通话. */ +/** Call-type (PhoneCall.channel) label — 电话 vs 语音通话 vs WA 语音通话. */ export function callTypeLabel(channel?: string | null): string { switch (channel) { case 'phone_call': return '电话' case 'voice_call': return '语音通话' + case 'wa_voice_call': + return 'WA 语音通话' default: return channel ?? '未知' } @@ -101,17 +103,26 @@ export function callDirectionLabel(incoming?: number | null): string { } /** - * Call status. The upstream schema uses 1 = 已接通 (answered/connected) and - * 0 = 未接通 (missed/failed); other codes fall back to the raw value so the UI - * never hides information. + * Call connected/missed label. The upstream ``call_status`` polarity differs by + * channel (verified against smoke.db recording correlation + scraper code): + * • phone_call: 0 = 未接通, 2 = 已接通. + * • voice_call / wa_voice_call: 1 = 已接通, 2 = 未接通. + * Value 2 is the only code that flips meaning across channels, so it alone + * branches on ``channel``; 0/1 are stable. Unknown codes pass through so the + * UI never hides information. */ -export function callStatusLabel(status?: number | null): string { +export function callStatusLabel( + status?: number | null, + channel?: string | null, +): string { if (status == null) return '--' switch (status) { - case 1: - return '已接通' case 0: return '未接通' + case 1: + return '已接通' + case 2: + return channel === 'phone_call' ? '已接通' : '未接通' default: return `状态 ${status}` } diff --git a/yunkes/src/views/CallList.vue b/yunkes/src/views/CallList.vue index 96e382a..6177988 100644 --- a/yunkes/src/views/CallList.vue +++ b/yunkes/src/views/CallList.vue @@ -160,7 +160,7 @@ onMounted(load)