Commit aa7f43b4 by chenwq

```

feat(ui): 更新Modal组件mask属性默认值逻辑

当maskClosable未定义时,默认将mask的closable设置为false,
而不是undefined,以确保遮罩层关闭行为的一致性

refactor(role): 移除角色管理页面中多余的数据域相关字段

移除了与数据域相关的scope字段、defaultDataScope参数以及
getDataScopeLabel函数引用,同时调整了搜索表单和表格列配置
以保持界面简洁性和功能一致性
```
1 parent 914ae07b
Pipeline #353 for aa7f43b4 failed in 0 seconds
......@@ -18,7 +18,7 @@ export function UModal(props: ModalProps) {
<Modal
centered={centered}
destroyOnHidden={destroyOnHidden}
mask={mask ?? (maskClosable === undefined ? undefined : { closable: maskClosable })}
mask={mask ?? (maskClosable === undefined ? { closable: false } : { closable: maskClosable })}
okButtonProps={{ type: 'primary', ...okButtonProps }}
{...rest}
/>
......
......@@ -14,7 +14,6 @@ import {
} from '@/components';
import { P, PermButton } from '@/access';
import { role, type RolePageItem, type RolePageParams } from '@/api';
import { getDataScopeLabel } from '@/constants/dataScope';
import { RoleModal } from './components/RoleModal';
import { RoleDetailDrawer } from './components/RoleDetailDrawer';
import { getBaseList } from './tools/constants';
......@@ -23,7 +22,6 @@ interface Row {
id: number;
name: string;
code: string;
scope: string;
userCount: number;
description: string;
type: string;
......@@ -41,8 +39,6 @@ function createRolePageParams(
keyword: values.keyword as string | undefined,
isBuiltin: values.type === '' || values.type === undefined ? undefined : Number(values.type),
status: values.status === '' || values.status === undefined ? undefined : Number(values.status),
defaultDataScope:
values.scope === '' || values.scope === undefined ? undefined : Number(values.scope),
};
}
......@@ -52,7 +48,6 @@ export default function RoleManage() {
size: DEFAULT_PAGE_SIZE,
isBuiltin: undefined,
status: undefined,
defaultDataScope: undefined,
});
const [queryVersion, setQueryVersion] = useState(0);
const [roleModalOpen, setRoleModalOpen] = useState(false);
......@@ -79,7 +74,6 @@ export default function RoleManage() {
id: item.roleId,
name: item.roleName,
code: item.roleCode,
scope: getDataScopeLabel(item.defaultDataScope),
userCount: item.userCount,
description: item.description ?? '—',
type: item.isBuiltin === 1 ? '内置' : '自定义',
......@@ -102,34 +96,25 @@ export default function RoleManage() {
type: 'select',
options: getBaseList('roleStatus'),
},
{
name: 'scope',
label: '默认数据域',
type: 'select',
options: getBaseList('dataScope'),
},
];
const columns: DataTableColumnsType<Row> = [
{ title: '角色名称', dataIndex: 'name', width: 200, line: 1 },
{ title: '角色名称', dataIndex: 'name', width: 220, line: 1 },
{
title: '角色编码',
dataIndex: 'code',
width: 200,
width: 220,
line: 1,
render: (v) => <UText style={{ color: '#315ce8', fontFamily: 'monospace' }}>{v}</UText>,
},
{ title: '默认数据域', dataIndex: 'scope' },
{ title: '账号数', dataIndex: 'userCount', width: 90 },
{ title: '角色描述', dataIndex: 'description', width: 400, line: 1 },
{ title: '账号数', dataIndex: 'userCount' },
{ title: '角色描述', dataIndex: 'description', width: 450, line: 1 },
{
title: '类型',
dataIndex: 'type',
width: 90,
render: (v) => <UTag color={v === '内置' ? 'geekblue' : 'default'}>{v}</UTag>,
},
{
title: '状态',
width: 90,
render: (_, r) => (
<UTag color={r.status === 1 ? 'green' : 'default'}>
● {r.status === 1 ? '启用' : '停用'}
......@@ -182,7 +167,7 @@ export default function RoleManage() {
<UCard size="small">
<SearchForm
fields={fields}
initialValues={{ type: '', status: '', scope: '' }}
initialValues={{ type: '', status: '' }}
onSearch={(values, pagination) => {
setParams(createRolePageParams(values, pagination));
setQueryVersion((version) => version + 1);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!