修复root平台账户编辑角色误提交

This commit is contained in:
czl231
2026-08-17 20:31:49 +08:00
parent 80013e8c55
commit 19dc5713d7
4 changed files with 78 additions and 2 deletions

View File

@@ -21,6 +21,7 @@ function assertIncludes(source, expected, message) {
const resources = read('src/api/resources.ts');
const display = read('src/api/resource-display.ts');
const detailContract = read('src/api/resource-detail-contract.ts');
const pageRules = read('src/api/resource-page-rules.ts');
const detailPage = read('src/views/resource/ResourceDetailContent.vue');
const listPage = read('src/views/shared/CrudListPage.vue');
const listFieldDisplay = read('src/views/shared/resource-list-field-display.ts');
@@ -388,6 +389,17 @@ assertIncludes(
"f('phone', { emptyText: '未填写' })",
'平台账户联系电话为空时必须显示业务文案',
);
for (const rootAccountContract of [
"String(row.platform_role_code ?? '') === 'root'",
"visibleKeys.add('platform_role_code')",
"isProtectedPlatformRootAccount(definition, row)",
]) {
assertIncludes(
pageRules,
rootAccountContract,
`root 平台账户缺少角色只读保护契约:${rootAccountContract}`,
);
}
assertIncludes(
detailPage,
'!hasResourceFieldLabel(props.definition, actualKey)',