修复气站用户详情主档与配送点回填
This commit is contained in:
@@ -24,6 +24,7 @@
|
||||
- `/staff/add` 顶部显示账户摘要与头像选择区,布局和交互参考 5173。
|
||||
- 工作人员与用户列表显示 32 像素圆形头像;无头像或加载失败时回退默认头像。
|
||||
- 用户账户列表以“所属配送点”为列名并显示配送点业务名称,唯一标识仅用于悬停查看和复制。
|
||||
- 用户账户详情与编辑页从聚合响应中恢复用户主档和配送点关系,用户名、名称、电话、实名及所属配送点均可正确回填。
|
||||
- 工作人员与用户的详情、编辑页可安全读取现有头像。
|
||||
- 普通资料编辑不会误清空头像;主动恢复默认头像仍会提交空值。
|
||||
|
||||
@@ -33,6 +34,7 @@
|
||||
- `frontend/gas_admin/src/api/avatar.ts`:使用气站 API 前缀读取受保护头像。
|
||||
- `frontend/gas_admin/src/views/shared/protected-list-avatar-loader.ts`:开放工作人员与用户缩略图渲染。
|
||||
- `frontend/gas_admin/src/api/resources.ts`:用户账户的配送点关系列表以业务名称为主展示,并保留唯一标识复制能力。
|
||||
- `frontend/gas_admin/src/api/resource-display.ts`:识别用户聚合详情并合并配送点关系上下文。
|
||||
- `frontend/gas_admin/scripts/check-resource-pages.mjs`:新增用户账户配送点名称展示的静态回归检查。
|
||||
- `backend/api/internal/logic/gas/staff.go`、`user.go`:新增范围受限头像读取并保护头像更新语义。
|
||||
- `backend/api/internal/logic/gas/user_test.go`:校验用户列表携带配送点关系且保留气站范围。
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user