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) { ...@@ -18,7 +18,7 @@ export function UModal(props: ModalProps) {
<Modal <Modal
centered={centered} centered={centered}
destroyOnHidden={destroyOnHidden} destroyOnHidden={destroyOnHidden}
mask={mask ?? (maskClosable === undefined ? undefined : { closable: maskClosable })} mask={mask ?? (maskClosable === undefined ? { closable: false } : { closable: maskClosable })}
okButtonProps={{ type: 'primary', ...okButtonProps }} okButtonProps={{ type: 'primary', ...okButtonProps }}
{...rest} {...rest}
/> />
......
...@@ -14,7 +14,6 @@ import { ...@@ -14,7 +14,6 @@ import {
} from '@/components'; } from '@/components';
import { P, PermButton } from '@/access'; import { P, PermButton } from '@/access';
import { role, type RolePageItem, type RolePageParams } from '@/api'; import { role, type RolePageItem, type RolePageParams } from '@/api';
import { getDataScopeLabel } from '@/constants/dataScope';
import { RoleModal } from './components/RoleModal'; import { RoleModal } from './components/RoleModal';
import { RoleDetailDrawer } from './components/RoleDetailDrawer'; import { RoleDetailDrawer } from './components/RoleDetailDrawer';
import { getBaseList } from './tools/constants'; import { getBaseList } from './tools/constants';
...@@ -23,7 +22,6 @@ interface Row { ...@@ -23,7 +22,6 @@ interface Row {
id: number; id: number;
name: string; name: string;
code: string; code: string;
scope: string;
userCount: number; userCount: number;
description: string; description: string;
type: string; type: string;
...@@ -41,8 +39,6 @@ function createRolePageParams( ...@@ -41,8 +39,6 @@ function createRolePageParams(
keyword: values.keyword as string | undefined, keyword: values.keyword as string | undefined,
isBuiltin: values.type === '' || values.type === undefined ? undefined : Number(values.type), isBuiltin: values.type === '' || values.type === undefined ? undefined : Number(values.type),
status: values.status === '' || values.status === undefined ? undefined : Number(values.status), 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() { ...@@ -52,7 +48,6 @@ export default function RoleManage() {
size: DEFAULT_PAGE_SIZE, size: DEFAULT_PAGE_SIZE,
isBuiltin: undefined, isBuiltin: undefined,
status: undefined, status: undefined,
defaultDataScope: undefined,
}); });
const [queryVersion, setQueryVersion] = useState(0); const [queryVersion, setQueryVersion] = useState(0);
const [roleModalOpen, setRoleModalOpen] = useState(false); const [roleModalOpen, setRoleModalOpen] = useState(false);
...@@ -79,7 +74,6 @@ export default function RoleManage() { ...@@ -79,7 +74,6 @@ export default function RoleManage() {
id: item.roleId, id: item.roleId,
name: item.roleName, name: item.roleName,
code: item.roleCode, code: item.roleCode,
scope: getDataScopeLabel(item.defaultDataScope),
userCount: item.userCount, userCount: item.userCount,
description: item.description ?? '—', description: item.description ?? '—',
type: item.isBuiltin === 1 ? '内置' : '自定义', type: item.isBuiltin === 1 ? '内置' : '自定义',
...@@ -102,34 +96,25 @@ export default function RoleManage() { ...@@ -102,34 +96,25 @@ export default function RoleManage() {
type: 'select', type: 'select',
options: getBaseList('roleStatus'), options: getBaseList('roleStatus'),
}, },
{
name: 'scope',
label: '默认数据域',
type: 'select',
options: getBaseList('dataScope'),
},
]; ];
const columns: DataTableColumnsType<Row> = [ const columns: DataTableColumnsType<Row> = [
{ title: '角色名称', dataIndex: 'name', width: 200, line: 1 }, { title: '角色名称', dataIndex: 'name', width: 220, line: 1 },
{ {
title: '角色编码', title: '角色编码',
dataIndex: 'code', dataIndex: 'code',
width: 200, width: 220,
line: 1, line: 1,
render: (v) => <UText style={{ color: '#315ce8', fontFamily: 'monospace' }}>{v}</UText>, render: (v) => <UText style={{ color: '#315ce8', fontFamily: 'monospace' }}>{v}</UText>,
}, },
{ title: '默认数据域', dataIndex: 'scope' }, { title: '账号数', dataIndex: 'userCount' },
{ title: '账号数', dataIndex: 'userCount', width: 90 }, { title: '角色描述', dataIndex: 'description', width: 450, line: 1 },
{ title: '角色描述', dataIndex: 'description', width: 400, line: 1 },
{ {
title: '类型', title: '类型',
dataIndex: 'type', dataIndex: 'type',
width: 90,
render: (v) => <UTag color={v === '内置' ? 'geekblue' : 'default'}>{v}</UTag>, render: (v) => <UTag color={v === '内置' ? 'geekblue' : 'default'}>{v}</UTag>,
}, },
{ {
title: '状态', title: '状态',
width: 90,
render: (_, r) => ( render: (_, r) => (
<UTag color={r.status === 1 ? 'green' : 'default'}> <UTag color={r.status === 1 ? 'green' : 'default'}>
● {r.status === 1 ? '启用' : '停用'} ● {r.status === 1 ? '启用' : '停用'}
...@@ -182,7 +167,7 @@ export default function RoleManage() { ...@@ -182,7 +167,7 @@ export default function RoleManage() {
<UCard size="small"> <UCard size="small">
<SearchForm <SearchForm
fields={fields} fields={fields}
initialValues={{ type: '', status: '', scope: '' }} initialValues={{ type: '', status: '' }}
onSearch={(values, pagination) => { onSearch={(values, pagination) => {
setParams(createRolePageParams(values, pagination)); setParams(createRolePageParams(values, pagination));
setQueryVersion((version) => version + 1); 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!