修复智能气阀归属互斥选择
选择任一新归属时自动清空其他归属,保留提交防御校验和审计接口,并补充专项检查、中文操作日志及项目文档。
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
/**
|
||||
* 功能:检查智能气阀归属弹窗保留互斥选择和提交防御。
|
||||
* 版本:v1.0.0
|
||||
*/
|
||||
import { readFile } from 'node:fs/promises';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
|
||||
const componentUrl = new URL(
|
||||
'../src/views/resource/ResourceActionDialog.vue',
|
||||
import.meta.url,
|
||||
);
|
||||
const source = await readFile(fileURLToPath(componentUrl), 'utf8');
|
||||
const requiredFragments = [
|
||||
'@change-relation="changeRelation"',
|
||||
'ownershipKeys.includes(field.key)',
|
||||
'if (key !== field.key) form[key] = undefined',
|
||||
"Message.warning('智能气阀只能选择一个当前归属')",
|
||||
"payload[key] = String(form[key] ?? '')",
|
||||
];
|
||||
|
||||
for (const fragment of requiredFragments) {
|
||||
if (!source.includes(fragment)) {
|
||||
throw new Error(`智能气阀归属互斥检查缺少实现:${fragment}`);
|
||||
}
|
||||
}
|
||||
|
||||
console.log('智能气阀归属互斥检查通过:选择时自动清空,提交时保留防御校验。');
|
||||
Reference in New Issue
Block a user