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
@@ -44,6 +44,13 @@
lay-verify="required" required />
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">数据权限</label>
<div class="layui-input-block">
<input type="radio" name="dataScope" value="ALL" title="全部" checked/>
<input type="radio" name="dataScope" value="CREATOR" title="本人"/>
</div>
</div>
<div class="layui-form-item model-form-footer">
<button class="layui-btn layui-btn-primary" ew-event="closeDialog" type="button">取消</button>
<button class="layui-btn" lay-filter="role-form-submit" lay-submit>保存</button>
@@ -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