feat(customerFields): add fromTypeLabel helper

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
浅念
2026-08-06 10:13:40 +08:00
parent c31d79f1e2
commit 3507de55fa
+14
View File
@@ -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<string, string> = {
'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)