修复智能气阀类型关联展示
列表改为显示智能气阀类型名称,保留唯一标识复制功能,空关联统一显示未填写,并补充中文操作日志和项目文档。
This commit is contained in:
36
docs/操作日志_智能气阀类型关联展示_20260813.md
Normal file
36
docs/操作日志_智能气阀类型关联展示_20260813.md
Normal file
@@ -0,0 +1,36 @@
|
||||
# 智能气阀类型关联展示操作日志
|
||||
|
||||
操作时间:2026-08-13
|
||||
操作类型:修改
|
||||
影响模块:平台总后台智能气阀管理
|
||||
|
||||
## 操作前状态
|
||||
|
||||
智能气阀列表中的类型列标题为“智能气阀类型唯一标识”,单元格直接展示 identity,不便于管理员识别类型名称。
|
||||
|
||||
## 具体操作
|
||||
|
||||
1. 列标题改为“智能气阀类型”。
|
||||
2. 有关联时显示类型名称,并提供复制类型唯一标识的按钮。
|
||||
3. 无关联时显示“未填写”。
|
||||
4. 新建、编辑继续要求选择有效类型。
|
||||
|
||||
## 操作后状态
|
||||
|
||||
- 列表以类型名称为主要展示信息。
|
||||
- 可通过复制按钮获取稳定唯一标识。
|
||||
- 数据库、后端接口和历史数据均未修改。
|
||||
|
||||
## 代码变更
|
||||
|
||||
- `frontend/platform_admin/src/api/resources.ts`:调整智能气阀类型关联展示配置。
|
||||
|
||||
## 验证结果
|
||||
|
||||
- `npm.cmd run resource-pages:check`:通过,详情 46 类、新建 25 类、编辑 23 类。
|
||||
- `npm.cmd run build`:通过,TypeScript 类型检查与 Vite 生产构建均成功。
|
||||
- `git diff --check`:通过,未发现空白符错误。
|
||||
|
||||
## 风险评估
|
||||
|
||||
仅修改前端元数据并复用现有关联名称组件,不改变提交字段和接口契约。
|
||||
31
docs/项目文档_智能气阀类型关联展示_v1.0.md
Normal file
31
docs/项目文档_智能气阀类型关联展示_v1.0.md
Normal file
@@ -0,0 +1,31 @@
|
||||
# 项目文档:智能气阀类型关联展示 v1.0
|
||||
|
||||
## 1. 项目概述
|
||||
|
||||
智能气阀列表以类型名称展示关联,并保留唯一标识复制能力。无关联时显示“未填写”。本次修改不涉及数据库和后端接口。
|
||||
|
||||
## 2. 目录结构说明
|
||||
|
||||
```text
|
||||
platforms/
|
||||
├── frontend/platform_admin/src/api/
|
||||
│ └── resources.ts # 智能气阀类型关联展示配置
|
||||
└── docs/
|
||||
├── 项目文档_智能气阀类型关联展示_v1.0.md
|
||||
└── 操作日志_智能气阀类型关联展示_20260813.md
|
||||
```
|
||||
|
||||
## 3. 核心文件说明
|
||||
|
||||
`resources.ts` 为 `product_type_identity` 配置列表名称展示、identity 复制、中文列名及空值文案,并继续使用 `/product_type` 关系数据。
|
||||
|
||||
## 4. 变更记录
|
||||
|
||||
- “智能气阀类型唯一标识”改为“智能气阀类型”。
|
||||
- 正文显示类型名称。
|
||||
- 支持复制类型唯一标识。
|
||||
- 无关联时显示“未填写”。
|
||||
|
||||
## 5. 维护指南
|
||||
|
||||
类型关联继续通过 `product_type_identity` 提交,前端不得提交数据库内部 ID。关联展示应复用现有 `RelationNameText` 组件。
|
||||
@@ -447,7 +447,7 @@ export const resources: ResourceUiDefinition[] = [
|
||||
define('producer_account', '生产商管理', 'writable', [f('producer_code', { required: true }), f('name', { required: true }), f('credit_code'), f('principal'), f('phone'), f('address', { emptyText: '未填写', placeholder: '请输入地址' }), f('username', { required: true }), f('password', { required: true }), f('display_name'), producerAdminRole(), f('remark')]),
|
||||
define('product_type', '智能气阀类型', 'editable', [f('code', { required: true }), f('name', { required: true })]),
|
||||
define('product_warehouse', '智能气阀库房', 'editable', [f('code', { required: true }), f('name', { required: true }), f('address', { emptyText: '未填写', placeholder: '请输入地址' }), f('manager'), f('phone')]),
|
||||
define('product_info', '智能气阀', 'editable', [f('code', { required: true }), f('name', { required: true }), relation('producer_account_identity', '/producer_account', true, { label: '生产商', listLabel: '生产商', listRelationNameOnly: true, displayRelationLabel: true, showIdentityCopy: true, emptyText: '未填写', placeholder: '请选择生产商' }), relation('product_type_identity', '/product_type', true), f('params', { required: true }), relation('warehouse_identity', '/product_warehouse'), relation('gas_basic_identity', '/gas_basic'), relation('delivery_basic_identity', '/delivery_basic'), relation('user_account_identity', '/user_account'), f('produced_at', { required: true })], 'list', [
|
||||
define('product_info', '智能气阀', 'editable', [f('code', { required: true }), f('name', { required: true }), relation('producer_account_identity', '/producer_account', true, { label: '生产商', listLabel: '生产商', listRelationNameOnly: true, displayRelationLabel: true, showIdentityCopy: true, emptyText: '未填写', placeholder: '请选择生产商' }), relation('product_type_identity', '/product_type', true, { label: '智能气阀类型', listLabel: '智能气阀类型', listRelationNameOnly: true, displayRelationLabel: true, showIdentityCopy: true, emptyText: '未填写', placeholder: '请选择智能气阀类型' }), f('params', { required: true }), relation('warehouse_identity', '/product_warehouse'), relation('gas_basic_identity', '/gas_basic'), relation('delivery_basic_identity', '/delivery_basic'), relation('user_account_identity', '/user_account'), f('produced_at', { required: true })], 'list', [
|
||||
{ name: '修改智能气阀状态', resource: '/product_info/:identity/lifecycle', method: 'PATCH', fields: [f('product_status', { required: true, type: 'select', options: [{ label: '待处理', value: 10 }, { label: '在库', value: 28 }, { label: '运输中', value: 29 }, { label: '使用中', value: 30 }, { label: '维修中', value: 31 }, { label: '已报废', value: 27 }] })] },
|
||||
{ name: '变更智能气阀归属', resource: '/product_info/:identity', method: 'PUT', fields: [relation('warehouse_identity', '/product_warehouse'), relation('gas_basic_identity', '/gas_basic'), relation('delivery_basic_identity', '/delivery_basic'), relation('user_account_identity', '/user_account'), f('action', { required: true, type: 'select', options: [{ label: '入库', value: 'warehouse' }, { label: '分配', value: 'assigned' }, { label: '归还', value: 'returned' }, { label: '人工调整', value: 'manual' }] }), f('reason', { required: true }), f('remark')] },
|
||||
]),
|
||||
|
||||
Reference in New Issue
Block a user