feat(公司tab): 接线 密钥管理与用量统计——分组∩公司取交集,空集不退化

两页都从 controller 这一个唯一出口算范围:收了 company_id 的 handler 自己调
dataReadScope.readScope(operator, companyId),把算好的 ReadScope 交给 service;
service 里 scopedUserIds() 只做 companyScope.userIdsOr(base),不再出现第二个判公司的 if。
readScope 落在 controller 而非计划原文写的 service,是因为 Task 8 补的 G2 尺子
CompanyIdParamGoesThroughReadScopeTest 逐 controller 断言"收参数就得自己调出口并把结果当实参交出去"。

空集一律早退(交给 in(...) 会渲染成 IN () → 500),且两条"筛空"日志按超管/主管分开,
排障时看得出是筛空还是查空;非超管空页仍返回带分组下拉的空页,下拉不缩水。

新增 6 条行为用例(超管 group_id∩公司成员集、交集空早退且不查库、不传公司保持不筛、
主管锁定集只被收窄不放大)。分母 3716 → 3722,Failures/Errors 均 0。
FE 侧两页带 company_id 并把 company-tab-wiring 缺口清单从 6 页收到 4 页。
This commit is contained in:
2026-10-05 12:18:18 +08:00
parent df03dce9c1
commit baf8baef0b
11 changed files with 216 additions and 37 deletions
@@ -51,10 +51,20 @@ const COMPANY_ID_SOURCE_PINS: Readonly<Record<string, readonly CompanyIdPin[]>>
{ file: 'src/pages/task-center/task-center-model.ts', shape: null, note: '同上:这一页有两个取数模块,两个都得登记' },
],
admin_user_secret_usage: [
{ file: 'src/api/user-secret-usage.ts', shape: null, note: 'Task 10 未接线(已在缺口清单里)' },
{
file: 'src/api/user-secret-usage.ts',
// fetchUserSecretUsage(params: UserSecretUsageQuery):唯一入参对象是 params(:45 那一行的形状)。
shape: /company_id\s*=\s*params\.companyId\b/,
note: 'query 由本函数自己从零构造,companyId 只能取自 params;api 模块不碰 Pinia store(node --test 直接 import 会抛 no active pinia)',
},
],
admin_user_secrets: [
{ file: 'src/api/user-secrets.ts', shape: null, note: 'Task 10 未接线(已在缺口清单里)' },
{
file: 'src/api/user-secrets.ts',
// fetchUserSecretList(params: UserSecretQuery):唯一入参对象是 params(:71 那一行的形状)。
shape: /company_id\s*=\s*params\.companyId\b/,
note: '同上:值由 UserSecretsPage.vue 传 companyTab.requestCompanyId,api 里不读任何归一化/构造出来的中间对象',
},
],
admin_device_logs: [
{ file: 'src/api/device-logs.ts', shape: null, note: 'Task 10 未接线(已在缺口清单里)' },