修复气站用户详情主档与配送点回填

This commit is contained in:
czl231
2026-08-18 21:15:49 +08:00
parent 7c95971a45
commit 06b6f0ee62
3 changed files with 23 additions and 2 deletions

View File

@@ -1,6 +1,6 @@
/**
* 功能:静态检查气站管理端全部标准资源是否具备独立记录页配置。
* 版本v1.3.0
* 版本v1.4.0
*/
import { readFileSync, existsSync } from 'node:fs';
import { fileURLToPath } from 'node:url';
@@ -90,6 +90,12 @@ if (
) {
fail('用户账户列表未按文档以所属配送点名称为主展示');
}
if (
!displaySource.includes('detail.user') ||
!displaySource.includes('relation.delivery_basic_identity ?? user.delivery_basic_identity')
) {
fail('用户账户详情未恢复主档与配送点关系上下文');
}
const createCount = listResources.filter((item) => createModes.has(item.mode)).length;
console.log(

View File

@@ -1,6 +1,6 @@
/**
* 功能:统一资源列表与详情页面的字段名称、关系、金额、状态和时间展示。
* 版本v1.7.0
* 版本v1.8.0
*/
import dayjs from 'dayjs';
import type { RecordPageMode, ResourceRow } from './resource-page-rules';
@@ -174,6 +174,19 @@ export function primaryRecord(detail: ResourceRow): ResourceRow {
return detail.contract as ResourceRow;
if (detail.track && typeof detail.track === 'object')
return detail.track as ResourceRow;
if (detail.user && typeof detail.user === 'object') {
const user = detail.user as ResourceRow;
const relation =
detail.relation && typeof detail.relation === 'object'
? (detail.relation as ResourceRow)
: {};
// 用户详情由主档、服务关系和地址组成;编辑表单需同时恢复主档与配送点上下文。
return {
...user,
delivery_basic_identity:
relation.delivery_basic_identity ?? user.delivery_basic_identity,
};
}
return detail;
}