feat(customerFields): add fromTypeLabel helper
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -215,6 +215,20 @@ export function yesNoLabel(v: unknown): string {
|
|||||||
return String(v)
|
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. */
|
/** Classify + format a single field for the drawer. */
|
||||||
export function toDisplayField(c: Customer, camelKey: string): DisplayField {
|
export function toDisplayField(c: Customer, camelKey: string): DisplayField {
|
||||||
const value = readField(c, camelKey)
|
const value = readField(c, camelKey)
|
||||||
|
|||||||
Reference in New Issue
Block a user