Files
platforms/frontend/platform_admin/scripts/check-product-lifecycle-display.mjs
czl231 457bcfb450 优化智能气阀状态中文展示
列表和详情统一显示中文状态,状态弹窗区分当前状态与目标状态并排除原状态,同时保留服务端业务校验,补充专项检查和中文文档。
2026-08-13 22:17:16 +08:00

40 lines
1.3 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/**
* 功能:检查智能气阀状态的中文展示和目标状态选择规则。
* 版本v1.0.0
*/
import { readFile } from 'node:fs/promises';
import { fileURLToPath } from 'node:url';
const resources = await readFile(
fileURLToPath(new URL('../src/api/resources.ts', import.meta.url)),
'utf8',
);
const dialog = await readFile(
fileURLToPath(
new URL('../src/views/resource/ResourceActionDialog.vue', import.meta.url),
),
'utf8',
);
const rules = await readFile(
fileURLToPath(new URL('../src/api/resource-page-rules.ts', import.meta.url)),
'utf8',
);
const checks = [
[resources, "f('product_status', { type: 'select', options: productStatusOptions"],
[resources, "label: '目标状态'"],
[resources, "placeholder: '请选择目标状态'"],
[rules, "createHiddenKeys: ['product_status']"],
[dialog, '当前状态:{{ currentProductStatusLabel }}'],
[dialog, "option.value) !== String(props.record.product_status)"],
[dialog, ':fields="actionFields"'],
];
for (const [source, fragment] of checks) {
if (!source.includes(fragment)) {
throw new Error(`智能气阀状态展示检查缺少实现:${fragment}`);
}
}
console.log('智能气阀状态展示检查通过:中文展示当前状态,目标选项排除原状态。');