refactor(web): 收敛角色页权限点目录入口
ci / 质量门禁 (push) Canceled after 0s

背景:列表页页头「权限点目录」与详情面板「查看权限点目录」和编辑器权限点 Tab 信息重复,抽屉只读、无搜索、无操作,且页头出现两个并列动作。

改动:
- 移除列表页页头目录按钮与 PermissionCatalogDrawer 组件及对应样式;
- 详情面板删除「查看权限点目录」入口,保留「已选 n / 30」信息;
- 权限查看统一走编辑器「权限点」Tab(只读用户也可进入查看);
- 同步 A2 实施报告与设计说明。

验证:pnpm format:check / lint / typecheck / test 全绿;5173 实测页头仅保留「新建角色」,详情面板无目录入口。
This commit is contained in:
Stev_Wang committed 2026-11-03 13:56:35 +08:00
1 parent fe70a2bcee
commit a3419cf5da
6 files changed
+3 -263

No files matched your search

+1 -22
View File
@@ -2,7 +2,7 @@
import { Button, Input, Switch } from '@douyinfe/semi-ui-19';
import { Permission, type RoleDetail, type RoleListItem } from '@lingxi/shared';
import { notifySuccess } from '@lingxi/ui';
import { IconAdd, IconSearch, IconShield } from '@lingxi/ui/icons';
import { IconAdd, IconSearch } from '@lingxi/ui/icons';
import type { ReactNode } from 'react';
import { useMemo, useState } from 'react';
import { useNavigate } from 'react-router';
@@ -19,7 +19,6 @@ import {
import { usePermission } from '@/hooks/use-permission';
import { roleDetailPath, ROUTES } from '@/routes';
import { PermissionCatalogDrawer } from './PermissionCatalogDrawer';
import {
CopyRoleDialog,
DeleteRoleDialog,
@@ -129,7 +128,6 @@ export function RolesPage(): ReactNode {
const [filters, setFilters] = useState<RoleListFilters>(DEFAULT_ROLE_LIST_FILTERS);
const [selectedId, setSelectedId] = useState<string | null>(null);
const [dialog, setDialog] = useState<DialogState>(null);
const [catalogOpen, setCatalogOpen] = useState(false);
const filteredRoles = useMemo(() => filterRoles(roles, filters), [roles, filters]);
const stats = useMemo(() => summarizeRoles(roles), [roles]);
const effectiveSelectedId = filteredRoles.some((role) => role.id === selectedId)
@@ -176,14 +174,6 @@ export function RolesPage(): ReactNode {
<p>配置功能权限、数据范围与特殊权限,变更即时生效并留痕</p>
</div>
<div className="lx-roles__header-actions">
<Button
icon={<IconShield size={14} />}
onClick={() => {
setCatalogOpen(true);
}}
>
权限点目录
</Button>
<Can permission={Permission.ROLE_MANAGE}>
<Button
theme="solid"
@@ -265,9 +255,6 @@ export function RolesPage(): ReactNode {
},
);
}}
onOpenCatalog={() => {
setCatalogOpen(true);
}}
/>
</div>
@@ -383,14 +370,6 @@ export function RolesPage(): ReactNode {
);
}}
/>
<PermissionCatalogDrawer
visible={catalogOpen}
tree={tree.data}
role={selectedDetail ?? null}
onClose={() => {
setCatalogOpen(false);
}}
/>
</div>
);
}