Commit 21e62269 by chenwq

```

feat(role): 更新角色管理权限配置和API调用方式

- 修改权限常量名称:SYSTEM_ROLE_EDIT -> SYSTEM_ROLE_SAVE,
  更准确反映保存操作权限
- 为角色管理相关权限添加详细注释说明
- 将角色分页查询API从GET改为POST请求方式
- 在角色管理页面使用PermButton组件替代普通按钮,
  实现权限控制功能
- 更新表格行操作中的权限标识符引用
```
1 parent d006b3c7
...@@ -18,9 +18,12 @@ export const P = { ...@@ -18,9 +18,12 @@ export const P = {
STORE_LISTING: 'store.listing', STORE_LISTING: 'store.listing',
STORE_LISTING_EXPORT: 'store.listing:export', STORE_LISTING_EXPORT: 'store.listing:export',
STORE_LISTING_DELETE: 'store.listing:delete', STORE_LISTING_DELETE: 'store.listing:delete',
// 角色管理 /** 角色管理
* system:role:view - 查看角色详情
* system:role:save - 新增/编辑/删除角色
*/
SYSTEM_ROLE_VIEW: 'system:role:view', SYSTEM_ROLE_VIEW: 'system:role:view',
SYSTEM_ROLE_EDIT: 'system:role:save', SYSTEM_ROLE_SAVE: 'system:role:save',
// 复用片段 // 复用片段
VIEW: ':view', VIEW: ':view',
MANAGE: ':manage', MANAGE: ':manage',
......
...@@ -45,8 +45,8 @@ export interface PermissionMatrix { ...@@ -45,8 +45,8 @@ export interface PermissionMatrix {
} }
class Role extends ApiClient { class Role extends ApiClient {
page(params: RolePageParams) { page(payload: RolePageParams) {
return this.get<RolePageResult>('/system/role/page', params as Record<string, unknown>); return this.post<RolePageResult>('/system/role/page', payload as Record<string, unknown>);
} }
list(params: Record<string, unknown> = {}) { list(params: Record<string, unknown> = {}) {
return this.get<PageResult<RoleItem>>('/store/role/list', params); return this.get<PageResult<RoleItem>>('/store/role/list', params);
......
...@@ -4,7 +4,7 @@ import { PlusOutlined } from '@ant-design/icons'; ...@@ -4,7 +4,7 @@ import { PlusOutlined } from '@ant-design/icons';
import type { ColumnsType } from 'antd/es/table'; import type { ColumnsType } from 'antd/es/table';
import { UAlert, UButton, UCard, UTag, UText, UTitle } from '@uj/ui'; import { UAlert, UButton, UCard, UTag, UText, UTitle } from '@uj/ui';
import { DataTable, SearchForm, type FieldSchema, type RowActionSchema } from '@/components'; import { DataTable, SearchForm, type FieldSchema, type RowActionSchema } from '@/components';
import { P } from '@/access'; import { P, PermButton } from '@/access';
import { role, type RolePageParams } from '@/api'; import { role, type RolePageParams } from '@/api';
import { getBaseList } from './tools/constants'; import { getBaseList } from './tools/constants';
...@@ -100,10 +100,10 @@ export default function RoleManage() { ...@@ -100,10 +100,10 @@ export default function RoleManage() {
]; ];
const rowActions: RowActionSchema<Row>[] = [ const rowActions: RowActionSchema<Row>[] = [
{ label: '查看详情', permission: P.SYSTEM_ROLE_VIEW, onClick: () => undefined }, { label: '查看详情', permission: P.SYSTEM_ROLE_VIEW, onClick: () => undefined },
{ label: '编辑', permission: P.SYSTEM_ROLE_EDIT, onClick: () => undefined }, { label: '编辑', permission: P.SYSTEM_ROLE_SAVE, onClick: () => undefined },
{ {
label: '删除', label: '删除',
permission: P.SYSTEM_ROLE_EDIT, permission: P.SYSTEM_ROLE_SAVE,
danger: true, danger: true,
onClick: () => undefined, onClick: () => undefined,
}, },
...@@ -119,7 +119,7 @@ export default function RoleManage() { ...@@ -119,7 +119,7 @@ export default function RoleManage() {
维护角色清单与基本信息,支持按关键字筛选;角色的菜单可见范围在「查看详情」中配置。 维护角色清单与基本信息,支持按关键字筛选;角色的菜单可见范围在「查看详情」中配置。
</UText> </UText>
</div> </div>
<UButton icon={<PlusOutlined />}>新增角色</UButton> <PermButton permission={P.SYSTEM_ROLE_SAVE}>新增角色</PermButton>
</div> </div>
<UCard size="small"> <UCard size="small">
<SearchForm <SearchForm
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!