完善合同关联主体名称展示
This commit is contained in:
@@ -98,6 +98,15 @@ const collectionAliases: Record<string, Record<string, string>> = {
|
||||
},
|
||||
};
|
||||
|
||||
/** 主记录关系字段按资源覆盖全局技术名称,避免把内部关联键暴露为页面文案。 */
|
||||
const resourceAliases: Record<string, Record<string, string>> = {
|
||||
gasorder_contract: {
|
||||
user_account_identity: '用户账户',
|
||||
gas_basic_identity: '所属气站',
|
||||
delivery_basic_identity: '所属配送点',
|
||||
},
|
||||
};
|
||||
|
||||
const moneyKeys = new Set([
|
||||
'amount',
|
||||
'unit_price',
|
||||
@@ -128,6 +137,7 @@ export function detailFieldLabel(
|
||||
const normalized = key.endsWith('_masked') ? key.slice(0, -7) : key;
|
||||
return (
|
||||
collectionAliases[`${definition.name}.${collectionKey}`]?.[normalized] ??
|
||||
resourceAliases[definition.name]?.[normalized] ??
|
||||
definition.fields.find((field) => field.key === normalized)?.label ??
|
||||
aliases[normalized] ??
|
||||
defaultResourceFieldLabel(normalized)
|
||||
|
||||
Reference in New Issue
Block a user