背景:A2 开卡前完成 H1 权限门,确认权限点目录、特殊权限、SoD 三对、六类数据范围与超管隐式全集口径(ADR-001)。 改动: - shared:30 权限点 / 10 模块目录与元数据、特殊权限 6 编码、SoD 三对、角色与权限树契约;/me 改 dataScopes 多角色并集。 - prisma:expand 迁移新增 permissions / data_scopes;种子按原型口径重写角色权限、数据范围与 8 项特殊授予。 - api:角色 CRUD / 复制 / 停用 / 删除、权限点启动同步、SoD 40304、系统角色保护、六类范围 ScopeContext 与 CustomerDirectory 端口、变更审计与 outbox。 - web:方案 B 主从分栏三角色页面(列表 / 编辑器 / 新建),权限树、范围选择、特殊权限二次确认、保存影响、SoD 冲突、只读态与模板预填。 - 测试:角色集成 13 条 + A2 e2e 1 条;A1 全量回归。 验证:format:check / lint / typecheck / test(306)/ test:int(27)/ A2 e2e(1,复跑通过)/ openapi:export 全绿。
49 lines
1.8 KiB
TypeScript
49 lines
1.8 KiB
TypeScript
import { ROUTES } from '@/routes';
|
|
|
|
import type { BreadcrumbEntry } from './nav-config';
|
|
|
|
/** 角色模块下的子路由(新建 / 编辑器)不在 nav-config 的菜单项里,这里补齐面包屑 */
|
|
export function getRoleSectionTrail(pathname: string): BreadcrumbEntry[] | null {
|
|
if (pathname === ROUTES.system.roleNew) {
|
|
return [
|
|
{ key: 'home', label: '工作台', path: ROUTES.home },
|
|
{ key: 'system', label: '管理中心' },
|
|
{ key: 'roles', label: '角色权限', path: ROUTES.system.roles },
|
|
{ key: 'role-new', label: '新建角色' },
|
|
];
|
|
}
|
|
if (/^\/system\/roles\/[^/]+$/.test(pathname)) {
|
|
return [
|
|
{ key: 'home', label: '工作台', path: ROUTES.home },
|
|
{ key: 'system', label: '管理中心' },
|
|
{ key: 'roles', label: '角色权限', path: ROUTES.system.roles },
|
|
{ key: 'role-detail', label: '角色编辑' },
|
|
];
|
|
}
|
|
return null;
|
|
}
|
|
|
|
/**
|
|
* 用户模块下的子路由(新建 / 详情)不在 nav-config 的菜单项里,
|
|
* 这里补齐面包屑:工作台 / 管理中心 / 用户与组织 / 当前页。
|
|
*/
|
|
export function getUserSectionTrail(pathname: string): BreadcrumbEntry[] | null {
|
|
if (pathname === ROUTES.system.userNew) {
|
|
return [
|
|
{ key: 'home', label: '工作台', path: ROUTES.home },
|
|
{ key: 'system', label: '管理中心' },
|
|
{ key: 'users', label: '用户与组织', path: ROUTES.system.users },
|
|
{ key: 'user-new', label: '新建用户' },
|
|
];
|
|
}
|
|
if (/^\/system\/users\/[^/]+$/.test(pathname)) {
|
|
return [
|
|
{ key: 'home', label: '工作台', path: ROUTES.home },
|
|
{ key: 'system', label: '管理中心' },
|
|
{ key: 'users', label: '用户与组织', path: ROUTES.system.users },
|
|
{ key: 'user-detail', label: '成员详情' },
|
|
];
|
|
}
|
|
return null;
|
|
}
|