统一商品分类标识与评价关联展示
This commit is contained in:
43
docs/操作日志_商品分类系统唯一标识展示统一_20260816.md
Normal file
43
docs/操作日志_商品分类系统唯一标识展示统一_20260816.md
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
# 商品分类系统唯一标识展示统一操作日志
|
||||||
|
|
||||||
|
操作时间:2026-08-16
|
||||||
|
|
||||||
|
操作类型:修改
|
||||||
|
|
||||||
|
影响模块:平台总后台电商平台管理、商品分类树形表格
|
||||||
|
|
||||||
|
## 操作前状态
|
||||||
|
|
||||||
|
- 商品分类使用“系统标识”列名,单元格固定显示“复制标识”。
|
||||||
|
- 商城订单、商品评价等标准列表使用“系统唯一标识”列名并显示截断标识,电商模块内部不一致。
|
||||||
|
|
||||||
|
## 具体操作
|
||||||
|
|
||||||
|
1. 商品分类列名改为“系统唯一标识”。
|
||||||
|
2. 商品分类单元格显示截断系统唯一标识,并继续支持完整 UUID 悬浮查看和复制。
|
||||||
|
3. 商品分类标识列宽由 `120px` 调整为与标准列表一致的 `170px`。
|
||||||
|
4. 共享树页中的平台菜单维持“系统标识 / 复制标识”,避免扩大改动范围。
|
||||||
|
5. 更新静态展示契约检查,分别约束商品分类和其他树形资源。
|
||||||
|
|
||||||
|
## 行为变化
|
||||||
|
|
||||||
|
- 修改前:商品分类显示“系统标识 / 复制标识”。
|
||||||
|
- 修改后:商品分类显示“系统唯一标识 / 截断标识”,交互与其他电商列表一致。
|
||||||
|
- 分类新增、编辑、启停、归档及层级关系均未改变。
|
||||||
|
|
||||||
|
## 代码变更
|
||||||
|
|
||||||
|
- `frontend/platform_admin/src/views/shared/TreePage.vue`:增加商品分类专属标识列展示。
|
||||||
|
- `frontend/platform_admin/scripts/check-resource-display-contracts.mjs`:更新树形资源展示断言。
|
||||||
|
- `docs/项目文档_平台资源中文展示统一_v1.0.md`:记录 v1.6 变更。
|
||||||
|
|
||||||
|
## 验证结果
|
||||||
|
|
||||||
|
- `pnpm resource-display-contracts:check`:通过。
|
||||||
|
- `pnpm type:check`:通过。
|
||||||
|
- `pnpm build`:通过,Vite 成功完成 2621 个模块的生产构建。
|
||||||
|
|
||||||
|
## 风险评估
|
||||||
|
|
||||||
|
- 本次只改变商品分类的技术标识展示,不修改 UUID、接口或业务数据。
|
||||||
|
- 平台菜单继续保持原展示方式。
|
||||||
43
docs/操作日志_商品评价关联名称展示_20260816.md
Normal file
43
docs/操作日志_商品评价关联名称展示_20260816.md
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
# 商品评价关联名称展示操作日志
|
||||||
|
|
||||||
|
操作时间:2026-08-16
|
||||||
|
|
||||||
|
操作类型:修改
|
||||||
|
|
||||||
|
影响模块:平台总后台电商平台管理、商品评价只读列表与详情
|
||||||
|
|
||||||
|
## 操作前状态
|
||||||
|
|
||||||
|
- 商品评价列表直接显示商城订单、商品和用户 UUID。
|
||||||
|
- 管理员无法从列表直接识别评价对应的订单号、商品名称和用户名称。
|
||||||
|
|
||||||
|
## 具体操作
|
||||||
|
|
||||||
|
1. 商城订单关系统一展示订单号。
|
||||||
|
2. 商品关系统一展示商品名称。
|
||||||
|
3. 用户关系统一展示用户名称。
|
||||||
|
4. 三类关系继续保留 UUID 复制入口及已有详情跳转能力。
|
||||||
|
5. 增加静态展示契约检查,防止关系字段退回裸 UUID。
|
||||||
|
|
||||||
|
## 行为变化
|
||||||
|
|
||||||
|
- 修改前:三个关系字段以“唯一标识”为列名并直接显示 UUID。
|
||||||
|
- 修改后:列表以“商城订单”“商品”“用户”为列名并显示可读名称,UUID 降级为复制和排障信息。
|
||||||
|
- 商品评价仍为只读资源,接口、权限、评分和评价内容均未改变。
|
||||||
|
|
||||||
|
## 代码变更
|
||||||
|
|
||||||
|
- `frontend/platform_admin/src/api/resources.ts`:补齐 `ec_review` 三类关系的名称展示配置。
|
||||||
|
- `frontend/platform_admin/scripts/check-resource-display-contracts.mjs`:增加商品评价关系展示回归检查。
|
||||||
|
- `docs/项目文档_平台资源中文展示统一_v1.0.md`:记录 v1.5 变更。
|
||||||
|
|
||||||
|
## 验证结果
|
||||||
|
|
||||||
|
- `pnpm resource-display-contracts:check`:通过。
|
||||||
|
- `pnpm type:check`:通过。
|
||||||
|
- `pnpm build`:通过,Vite 成功完成 2621 个模块的生产构建。
|
||||||
|
|
||||||
|
## 风险评估
|
||||||
|
|
||||||
|
- 关联加载失败时显示“名称加载失败”,UUID 仍可用于排障。
|
||||||
|
- 本次仅修改展示契约,不改变业务数据。
|
||||||
@@ -24,6 +24,7 @@
|
|||||||
8. 待发货、未收货及无备注字段使用明确业务文案,不再统一显示短横线。
|
8. 待发货、未收货及无备注字段使用明确业务文案,不再统一显示短横线。
|
||||||
9. 增加独立幂等修复命令,只更新固定十条商城 Mock 订单及其用户、地址快照来源。
|
9. 增加独立幂等修复命令,只更新固定十条商城 Mock 订单及其用户、地址快照来源。
|
||||||
10. 增加前端展示契约与后端种子测试,防止跨领域状态再次混入商城订单。
|
10. 增加前端展示契约与后端种子测试,防止跨领域状态再次混入商城订单。
|
||||||
|
11. 补齐商品评价列表的商城订单、商品和用户关系名称展示,避免相邻电商页面继续直接显示 UUID。
|
||||||
|
|
||||||
## 行为变化
|
## 行为变化
|
||||||
|
|
||||||
|
|||||||
@@ -66,3 +66,5 @@ frontend/platform_admin/
|
|||||||
- v1.2.1:补齐 Arco 表格 `columns` 插槽,修复树形表格容器存在但列和数据不渲染的问题。
|
- v1.2.1:补齐 Arco 表格 `columns` 插槽,修复树形表格容器存在但列和数据不渲染的问题。
|
||||||
- v1.3:购物车列表的用户与商品关系列统一展示可读名称,UUID 降级为复制和排障信息。
|
- v1.3:购物车列表的用户与商品关系列统一展示可读名称,UUID 降级为复制和排障信息。
|
||||||
- v1.4:商城订单统一展示用户名称及空值业务文案;Mock 订单改用商城独立交易状态,并补齐金额、支付时间和下单快照。
|
- v1.4:商城订单统一展示用户名称及空值业务文案;Mock 订单改用商城独立交易状态,并补齐金额、支付时间和下单快照。
|
||||||
|
- v1.5:商品评价列表的商城订单、商品和用户关系统一展示可读业务名称,UUID 降级为复制信息。
|
||||||
|
- v1.6:商品分类的技术标识列与其他电商列表统一为“系统唯一标识”,显示截断值并保留复制能力。
|
||||||
|
|||||||
@@ -151,6 +151,30 @@ for (const displayContract of [
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 商品评价的订单、商品和用户关系必须以可读业务名称展示。
|
||||||
|
const reviewDefinition = resources.match(
|
||||||
|
/define\('ec_review',[\s\S]*?\n\s*\]\),/,
|
||||||
|
)?.[0];
|
||||||
|
if (!reviewDefinition) throw new Error('无法读取商品评价资源定义');
|
||||||
|
for (const [key, label] of [
|
||||||
|
['ec_order_identity', '商城订单'],
|
||||||
|
['ec_product_identity', '商品'],
|
||||||
|
['user_account_identity', '用户'],
|
||||||
|
]) {
|
||||||
|
const field = reviewDefinition.match(
|
||||||
|
new RegExp(`relation\\('${key}'[\\s\\S]*?\\}\\)`),
|
||||||
|
)?.[0];
|
||||||
|
if (
|
||||||
|
!field ||
|
||||||
|
!field.includes(`listLabel: '${label}'`) ||
|
||||||
|
!field.includes('listRelationNameOnly: true') ||
|
||||||
|
!field.includes('displayRelationLabel: true') ||
|
||||||
|
!field.includes('showIdentityCopy: true')
|
||||||
|
) {
|
||||||
|
throw new Error(`商品评价的${label}列必须展示业务名称并保留唯一标识复制入口`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (/title="ID"|data-index="id"/.test(listPage)) {
|
if (/title="ID"|data-index="id"/.test(listPage)) {
|
||||||
throw new Error('标准资源列表不得把数据库ID作为业务列展示');
|
throw new Error('标准资源列表不得把数据库ID作为业务列展示');
|
||||||
}
|
}
|
||||||
@@ -165,9 +189,19 @@ assertIncludes(
|
|||||||
'<template #columns>',
|
'<template #columns>',
|
||||||
'Arco 树形表格列必须放入 columns 插槽,避免运行时渲染为空白',
|
'Arco 树形表格列必须放入 columns 插槽,避免运行时渲染为空白',
|
||||||
);
|
);
|
||||||
for (const columnTitle of ['分类名称', '排序', '状态', '系统标识', '操作']) {
|
for (const columnTitle of ['分类名称', '排序', '状态', '操作']) {
|
||||||
assertIncludes(treePage, columnTitle, `树形表格缺少必要列:${columnTitle}`);
|
assertIncludes(treePage, columnTitle, `树形表格缺少必要列:${columnTitle}`);
|
||||||
}
|
}
|
||||||
|
assertIncludes(
|
||||||
|
treePage,
|
||||||
|
"definition.name === 'ec_category' ? '系统唯一标识' : '系统标识'",
|
||||||
|
'商品分类必须使用与标准列表一致的系统唯一标识列名',
|
||||||
|
);
|
||||||
|
assertIncludes(
|
||||||
|
treePage,
|
||||||
|
'v-if="definition.name === \'ec_category\'"',
|
||||||
|
'商品分类必须显示截断系统唯一标识而不是通用复制文案',
|
||||||
|
);
|
||||||
assertIncludes(
|
assertIncludes(
|
||||||
treePage,
|
treePage,
|
||||||
'{{ record.name }}',
|
'{{ record.name }}',
|
||||||
@@ -176,7 +210,7 @@ assertIncludes(
|
|||||||
assertIncludes(
|
assertIncludes(
|
||||||
treePage,
|
treePage,
|
||||||
'display-text="复制标识"',
|
'display-text="复制标识"',
|
||||||
'树形表格不得把截断唯一标识作为高优先级正文',
|
'非商品分类树形资源仍应保留低优先级复制文案',
|
||||||
);
|
);
|
||||||
assertIncludes(
|
assertIncludes(
|
||||||
identityText,
|
identityText,
|
||||||
|
|||||||
@@ -728,8 +728,18 @@ export const resources: ResourceUiDefinition[] = [
|
|||||||
f('product_snapshot'), f('quantity'), f('sale_amount'),
|
f('product_snapshot'), f('quantity'), f('sale_amount'),
|
||||||
]),
|
]),
|
||||||
define('ec_review', '商品评价', 'readonly', [
|
define('ec_review', '商品评价', 'readonly', [
|
||||||
relation('ec_order_identity', '/ec_order'), relation('ec_product_identity', '/ec_product'),
|
relation('ec_order_identity', '/ec_order', false, {
|
||||||
relation('user_account_identity', '/user_account'), f('score'), f('content'),
|
label: '商城订单', listLabel: '商城订单', listRelationNameOnly: true,
|
||||||
|
displayRelationLabel: true, showIdentityCopy: true,
|
||||||
|
}),
|
||||||
|
relation('ec_product_identity', '/ec_product', false, {
|
||||||
|
label: '商品', listLabel: '商品', listRelationNameOnly: true,
|
||||||
|
displayRelationLabel: true, showIdentityCopy: true,
|
||||||
|
}),
|
||||||
|
relation('user_account_identity', '/user_account', false, {
|
||||||
|
label: '用户', listLabel: '用户', listRelationNameOnly: true,
|
||||||
|
displayRelationLabel: true, showIdentityCopy: true,
|
||||||
|
}), f('score'), f('content'),
|
||||||
]),
|
]),
|
||||||
|
|
||||||
define('wallet_basic', '钱包', 'readonly', [f('owner_type'), f('owner_identity', {
|
define('wallet_basic', '钱包', 'readonly', [f('owner_type'), f('owner_identity', {
|
||||||
|
|||||||
@@ -37,9 +37,20 @@
|
|||||||
</a-tag>
|
</a-tag>
|
||||||
</template>
|
</template>
|
||||||
</a-table-column>
|
</a-table-column>
|
||||||
<a-table-column title="系统标识" :width="120">
|
<a-table-column
|
||||||
|
:title="definition.name === 'ec_category' ? '系统唯一标识' : '系统标识'"
|
||||||
|
:width="definition.name === 'ec_category' ? 170 : 120"
|
||||||
|
>
|
||||||
<template #cell="{ record }">
|
<template #cell="{ record }">
|
||||||
<IdentityText :value="String(record.identity)" display-text="复制标识" />
|
<IdentityText
|
||||||
|
v-if="definition.name === 'ec_category'"
|
||||||
|
:value="String(record.identity)"
|
||||||
|
/>
|
||||||
|
<IdentityText
|
||||||
|
v-else
|
||||||
|
:value="String(record.identity)"
|
||||||
|
display-text="复制标识"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
</a-table-column>
|
</a-table-column>
|
||||||
<a-table-column v-if="canEdit || canChangeStatus || canArchive" title="操作" :width="230" fixed="right">
|
<a-table-column v-if="canEdit || canChangeStatus || canArchive" title="操作" :width="230" fixed="right">
|
||||||
|
|||||||
Reference in New Issue
Block a user