From 3507de55fa04805c11ea1009b15c06bcabf95a7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B5=85=E5=BF=B5?= Date: Thu, 6 Aug 2026 10:13:40 +0800 Subject: [PATCH] feat(customerFields): add fromTypeLabel helper Co-Authored-By: Claude --- yunkes/src/utils/customerFields.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/yunkes/src/utils/customerFields.ts b/yunkes/src/utils/customerFields.ts index 3baa40b..121f81f 100644 --- a/yunkes/src/utils/customerFields.ts +++ b/yunkes/src/utils/customerFields.ts @@ -215,6 +215,20 @@ export function yesNoLabel(v: unknown): string { return String(v) } +/** + * 云客 `fromType` 代码 → 中文文案(用于「数据来源」列)。 + * 已知:1000014→工作手机。其余代码(如 '14'/'15')返回原值,避免隐藏; + * 如需补全,从云客界面按来源筛选采集后追加进 FROM_TYPE_LABELS。 + */ +const FROM_TYPE_LABELS: Record = { + '1000014': '工作手机', +} +export function fromTypeLabel(v: unknown): string { + if (v === null || v === undefined || v === '') return '--' + const s = String(v).trim() + return FROM_TYPE_LABELS[s] ?? s +} + /** Classify + format a single field for the drawer. */ export function toDisplayField(c: Customer, camelKey: string): DisplayField { const value = readField(c, camelKey)