feat:角色管理前端增加数据权限配置

This commit is contained in:
zlt2000
2023-02-13 22:11:02 +08:00
parent 0ee999a1fc
commit 26aac08df2
4 changed files with 47 additions and 3 deletions
@@ -1,6 +1,6 @@
import {
ModalForm,
ProForm,
ProForm, ProFormRadio,
ProFormText,
} from '@ant-design/pro-components';
import { Form } from 'antd';
@@ -59,6 +59,21 @@ const UpdateForm: React.FC<UpdateFormProps> = (props) => {
label="Code"
placeholder="输入Code"
/>
<ProFormRadio.Group
name="dataScope"
label="数据权限"
width="lg"
options={[
{
label: '全部',
value: 'ALL',
},
{
label: '本人',
value: 'CREATOR',
},
]}
/>
</ProForm.Group>
</ModalForm>
);
@@ -8,7 +8,7 @@ import {
ProFormText,
ProForm,
ProTable,
QueryFilter,
QueryFilter, ProFormRadio,
} from '@ant-design/pro-components';
import { Form, Popconfirm, Space, Typography } from 'antd';
import { Button, message } from 'antd';
@@ -122,6 +122,11 @@ const TableList: React.FC = () => {
title: 'CODE',
dataIndex: 'code',
},
{
title: '数据权限',
dataIndex: 'dataScope',
renderText: (value) => (value === 'ALL' ? '全部' : '本人'),
},
{
title: '创建时间',
dataIndex: 'createTime',
@@ -230,6 +235,7 @@ const TableList: React.FC = () => {
width={500}
visible={createModalVisible}
onVisibleChange={handleModalVisible}
initialValues={{ dataScope: 'ALL' }}
modalProps={{ destroyOnClose: true }}
onFinish={async (values) => {
const success = await handleAdd(values as SYSTEM.Role);
@@ -266,6 +272,21 @@ const TableList: React.FC = () => {
label="Code"
placeholder="输入Code"
/>
<ProFormRadio.Group
name="dataScope"
label="数据权限"
width="lg"
options={[
{
label: '全部',
value: 'ALL',
},
{
label: '本人',
value: 'CREATOR',
},
]}
/>
</ProForm.Group>
</ModalForm>
<UpdateForm