diff --git a/yunkes/src/utils/callFields.ts b/yunkes/src/utils/callFields.ts index 2853d65..b8cbddc 100644 --- a/yunkes/src/utils/callFields.ts +++ b/yunkes/src/utils/callFields.ts @@ -95,18 +95,21 @@ const AUDIO_KEYS = new Set(['recordFile']) const TIMESTAMP_KEYS = new Set(['startCallTime', 'startTime', 'endTime']) /** Fields whose value is a boolean / 0|1 flag → render 是/否. */ -const BOOLEAN_KEYS = new Set(['isUpload']) +const BOOLEAN_KEYS = new Set(['isUpload', 'isRoom']) /** - * callStatus mapping used inside the drawer (per upstream call-log payload): - * 0 = 未接, 2 = 接通, other codes pass through so info isn't hidden. (The list - * column uses the format.ts helper which follows the 1=已接通/0=未接通 phone - * schema; the drawer surfaces the raw upstream value verbatim with this - * friendlier label.) + * callStatus mapping used inside the drawer. Polarity is channel-dependent + * (mirrors format.ts callStatusLabel, verified via smoke.db recording + * correlation): phone_call 0 = 未接 / 2 = 接通; voice_call / wa_voice_call + * 1 = 接通 / 2 = 未接. Value 2 flips meaning across channels, so it branches + * on channel. The drawer uses short 未接/接通 wording while the list column + * uses 未接通/已接通; both now agree on polarity per channel. Other codes pass + * through as raw text so info isn't hidden. */ -function callStatusLabel(v: unknown): string { +function callStatusLabel(v: unknown, channel?: string | null): string { if (v === 0 || v === '0') return '未接' - if (v === 2 || v === '2') return '接通' + if (v === 1 || v === '1') return '接通' + if (v === 2 || v === '2') return channel === 'phone_call' ? '接通' : '未接' return String(v) } @@ -215,7 +218,7 @@ export function toDisplayField(c: PhoneCall, camelKey: string): DisplayField { return { key: camelKey, label, value, render: 'time', text: formatTime(value) } } if (camelKey === 'callStatus') { - return { key: camelKey, label, value, render: 'status', text: callStatusLabel(value) } + return { key: camelKey, label, value, render: 'status', text: callStatusLabel(value, c.channel) } } if (camelKey === 'incomingCall') { return {