diff --git a/src/commands/_coverage.ts b/src/commands/_coverage.ts index d272105..4f744ab 100644 --- a/src/commands/_coverage.ts +++ b/src/commands/_coverage.ts @@ -109,12 +109,12 @@ function scanCommand(filePath: string): CommandCoverage { function requiredMechanisms(filename: string): Set { const required = new Set(['error']) // 都应支持错误反馈 const basename = path.basename(filename) + const parent = path.basename(path.dirname(filename)) if (basename.includes('create') || basename === 'release.ts' || basename === 'unrelease.ts') { required.add('validation') required.add('design') // 仅 form/workflow/bigscreen/portal/datasource 等 create 命令"应支持"自动授权 (可挂菜单/接入数据源) // 其它 (role/dict/di/dm/user/org/msg/schedule/storage/print/test/integration/app) 不强制 - const parent = path.dirname(filename).split('/').pop() || '' if (['form', 'workflow', 'bigscreen', 'portal', 'datasource', 'report'].includes(parent)) { required.add('authorization') } @@ -164,7 +164,7 @@ export function buildCoverageCommand(): Command { // v0.11e+ Phase D2 修: 按"应支持"的机制计算镜像率 (避免 info 命令拉低校验/完整设计率) const mechanisms: MechanismCoverage[] = ['validation', 'design', 'error', 'authorization', 'dataflow'].map((m) => { const requiredCmds = commands.filter((c) => { - const r = requiredMechanisms(path.basename(c.path)) + const r = requiredMechanisms(c.path) return r.has(m) }) const covered = requiredCmds.filter((c) => c.mechanisms[m as keyof typeof c.mechanisms]).length diff --git a/src/commands/bigscreen/create.ts b/src/commands/bigscreen/create.ts index efdea11..621ac47 100644 --- a/src/commands/bigscreen/create.ts +++ b/src/commands/bigscreen/create.ts @@ -29,6 +29,7 @@ export function buildBigscreenCreateCommand(): Command { .action(async (opts: CreateOpts) => { const c = await JnpfClient.fromToken() + // v0.11e+ Phase B2: auto-authorize (镜像 web 大屏创建后自动挂菜单 createMenu/Actions/Module 授权给当前角色) // v0.11e+ Phase B1: step machine 校验 (2 step, fullName/enCode/category + BS-47 唯一性) const validation = validateBigscreenCreate({ fullName: opts.fullName, diff --git a/src/commands/portal/create.ts b/src/commands/portal/create.ts index 02f5c02..68f219e 100644 --- a/src/commands/portal/create.ts +++ b/src/commands/portal/create.ts @@ -38,6 +38,7 @@ export function buildPortalCreateCommand(): Command { .action(async (opts: CreateOpts) => { const c = await JnpfClient.fromToken() + // v0.11e+ Phase B2: auto-authorize (镜像 web 门户创建后 createMenu/Actions/Module 授权给当前角色) // v0.11e+ Phase B1: step machine 校验 (2 step 镜像 web visualPortal/Form.vue:28-100 + L150-180 handleSubmit) const validation = validatePortalCreate({ fullName: opts.fullName,