2026-08-13 21:17:57 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* 功能:检查智能气阀四类可选归属的空值文案保持一致。
|
|
|
|
|
|
* 版本: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 = [
|
2026-08-13 21:50:57 +08:00
|
|
|
|
"relation('warehouse_identity', '/product_warehouse', false, { label: '库房', emptyText: '未填写', placeholder: '请选择库房' })",
|
|
|
|
|
|
"relation('gas_basic_identity', '/gas_basic', false, { label: '气站', emptyText: '未填写', placeholder: '请选择气站' })",
|
|
|
|
|
|
"relation('delivery_basic_identity', '/delivery_basic', false, { label: '配送点', emptyText: '未填写', placeholder: '请选择配送点' })",
|
|
|
|
|
|
"relation('user_account_identity', '/user_account', false, { label: '用户', emptyText: '未填写', placeholder: '请选择用户' })",
|
2026-08-13 21:17:57 +08:00
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
|
|
for (const relation of ownershipRelations) {
|
|
|
|
|
|
if (!source.includes(relation)) {
|
|
|
|
|
|
throw new Error(`智能气阀归属空值文案配置缺失:${relation}`);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
console.log('智能气阀归属展示检查通过:四类空归属统一显示“未填写”。');
|