Files
platforms/frontend/platform_admin/scripts/check-product-ownership-display.mjs
czl231 f8e91fb00a 统一智能气阀空归属展示
库房、气站、配送点和用户归属为空时统一显示未填写,保留归属互斥与接口规则,并补充专项检查、中文操作日志及项目文档。
2026-08-13 21:17:57 +08:00

24 lines
1003 B
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 resourcesUrl = new URL('../src/api/resources.ts', import.meta.url);
const source = await readFile(fileURLToPath(resourcesUrl), 'utf8');
const ownershipRelations = [
"relation('warehouse_identity', '/product_warehouse', false, { emptyText: '未填写' })",
"relation('gas_basic_identity', '/gas_basic', false, { emptyText: '未填写' })",
"relation('delivery_basic_identity', '/delivery_basic', false, { emptyText: '未填写' })",
"relation('user_account_identity', '/user_account', false, { emptyText: '未填写' })",
];
for (const relation of ownershipRelations) {
if (!source.includes(relation)) {
throw new Error(`智能气阀归属空值文案配置缺失:${relation}`);
}
}
console.log('智能气阀归属展示检查通过:四类空归属统一显示“未填写”。');