修复合同详情字段中文显示
通用详情页复用中文字段字典,并为合同气瓶快照补充上下文名称。 合同状态按模型常量显示中文,数据库字段和 API 保持不变。 已通过资源页面检查、类型检查和生产构建。
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* 功能:静态检查平台总后台全部标准资源是否具备独立记录页配置。
|
||||
* 版本:v1.1.0
|
||||
* 版本:v1.2.0
|
||||
*/
|
||||
import { readFileSync, existsSync } from 'node:fs';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
@@ -15,6 +15,8 @@ const routeSource = [
|
||||
const routeBuilderSource = readFileSync(resolve(root, 'src/router/routes/modules/resource-route-builder.ts'), 'utf8');
|
||||
const ruleSource = readFileSync(resolve(root, 'src/api/resource-page-rules.ts'), 'utf8');
|
||||
const listSource = readFileSync(resolve(root, 'src/views/shared/CrudListPage.vue'), 'utf8');
|
||||
const detailSource = readFileSync(resolve(root, 'src/views/resource/ResourceDetailContent.vue'), 'utf8');
|
||||
const displaySource = readFileSync(resolve(root, 'src/api/resource-display.ts'), 'utf8');
|
||||
const treeResources = new Set(['ec_category', 'platform_menu']);
|
||||
const listResources = contract.resources.filter((item) => !treeResources.has(item.name));
|
||||
const createModes = new Set(['writable', 'editable', 'append_only', 'managed']);
|
||||
@@ -49,6 +51,17 @@ if (
|
||||
if (existsSync(resolve(root, 'src/views/account/AccountProfilePage.vue'))) {
|
||||
fail('旧账户资料组件仍存在,未统一到共享记录页');
|
||||
}
|
||||
if (!detailSource.includes('resourceFieldLabel(definition, column, collection.key)')) {
|
||||
fail('聚合详情表格未按集合上下文解析中文字段名称');
|
||||
}
|
||||
for (const marker of [
|
||||
"'gasorder_contract.products'",
|
||||
"product_info_identity: '气瓶唯一标识'",
|
||||
"product_code: '气瓶编码'",
|
||||
"if (key === 'contract_status') return contractStatusLabel(Number(value))",
|
||||
]) {
|
||||
if (!displaySource.includes(marker)) fail(`合同详情中文展示缺少 ${marker}`);
|
||||
}
|
||||
|
||||
const createCount = listResources.filter((item) => createModes.has(item.mode)).length;
|
||||
console.log(
|
||||
|
||||
Reference in New Issue
Block a user