|
@@ -1,7 +1,7 @@
|
|
|
import { PageContainer } from '@ant-design/pro-layout';
|
|
import { PageContainer } from '@ant-design/pro-layout';
|
|
|
import React, { useRef } from 'react';
|
|
import React, { useRef } from 'react';
|
|
|
import { EditOutlined, KeyOutlined, MinusOutlined, UserAddOutlined } from '@ant-design/icons';
|
|
import { EditOutlined, KeyOutlined, MinusOutlined, UserAddOutlined } from '@ant-design/icons';
|
|
|
-import { Drawer, Menu, message, Popconfirm, Tooltip } from 'antd';
|
|
|
|
|
|
|
+import { Drawer, message, Modal, Popconfirm, Tooltip } from 'antd';
|
|
|
import type { ProColumns, ActionType } from '@jetlinks/pro-table';
|
|
import type { ProColumns, ActionType } from '@jetlinks/pro-table';
|
|
|
import BaseCrud from '@/components/BaseCrud';
|
|
import BaseCrud from '@/components/BaseCrud';
|
|
|
import { CurdModel } from '@/components/BaseCrud/model';
|
|
import { CurdModel } from '@/components/BaseCrud/model';
|
|
@@ -10,14 +10,8 @@ import { useIntl } from '@@/plugin-locale/localeExports';
|
|
|
import { observer } from '@formily/react';
|
|
import { observer } from '@formily/react';
|
|
|
import autzModel from '@/components/Authorization/autz';
|
|
import autzModel from '@/components/Authorization/autz';
|
|
|
import Authorization from '@/components/Authorization';
|
|
import Authorization from '@/components/Authorization';
|
|
|
-
|
|
|
|
|
-const menu = (
|
|
|
|
|
- <Menu>
|
|
|
|
|
- <Menu.Item key="1">1st item</Menu.Item>
|
|
|
|
|
- <Menu.Item key="2">2nd item</Menu.Item>
|
|
|
|
|
- <Menu.Item key="3">3rd item</Menu.Item>
|
|
|
|
|
- </Menu>
|
|
|
|
|
-);
|
|
|
|
|
|
|
+import { BindModel } from '@/components/BindUser/model';
|
|
|
|
|
+import BindUser from '@/components/BindUser';
|
|
|
|
|
|
|
|
const service = new BaseService<RoleItem>('dimension');
|
|
const service = new BaseService<RoleItem>('dimension');
|
|
|
|
|
|
|
@@ -121,7 +115,12 @@ const Role: React.FC = observer(() => {
|
|
|
<a
|
|
<a
|
|
|
key="bind"
|
|
key="bind"
|
|
|
onClick={() => {
|
|
onClick={() => {
|
|
|
- console.log('绑定用户');
|
|
|
|
|
|
|
+ BindModel.dimension = {
|
|
|
|
|
+ id: record.id,
|
|
|
|
|
+ name: record.name,
|
|
|
|
|
+ type: 'role',
|
|
|
|
|
+ };
|
|
|
|
|
+ BindModel.visible = true;
|
|
|
actionRef.current?.reload();
|
|
actionRef.current?.reload();
|
|
|
}}
|
|
}}
|
|
|
>
|
|
>
|
|
@@ -232,10 +231,20 @@ const Role: React.FC = observer(() => {
|
|
|
id: 'pages.system.role',
|
|
id: 'pages.system.role',
|
|
|
defaultMessage: '角色管理',
|
|
defaultMessage: '角色管理',
|
|
|
})}
|
|
})}
|
|
|
- menu={menu}
|
|
|
|
|
schema={schema}
|
|
schema={schema}
|
|
|
defaultParams={{ typeId: 'role' }}
|
|
defaultParams={{ typeId: 'role' }}
|
|
|
/>
|
|
/>
|
|
|
|
|
+ <Modal
|
|
|
|
|
+ visible={BindModel.visible}
|
|
|
|
|
+ closable={false}
|
|
|
|
|
+ onCancel={() => {
|
|
|
|
|
+ BindModel.visible = false;
|
|
|
|
|
+ BindModel.bind = false;
|
|
|
|
|
+ }}
|
|
|
|
|
+ width={BindModel.bind ? '90vw' : '60vw'}
|
|
|
|
|
+ >
|
|
|
|
|
+ <BindUser />
|
|
|
|
|
+ </Modal>
|
|
|
<Drawer
|
|
<Drawer
|
|
|
title="授权"
|
|
title="授权"
|
|
|
width="70vw"
|
|
width="70vw"
|