| import React, { useEffect } from 'react'; |
| import { Form, Modal } from 'antd'; |
| import { useIntl } from '@umijs/max'; |
| import { ProForm, ProFormSelect } from '@ant-design/pro-components'; |
| * @author whiteshader@163.com |
| export type FormValueType = any & Partial<API.System.Dept>; |
| export type AuthRoleFormProps = { |
| onCancel: (flag?: boolean, formVals?: FormValueType) => void; |
| onSubmit: (values: FormValueType) => Promise<void>; |
| const AuthRoleForm: React.FC<AuthRoleFormProps> = (props) => { |
| const [form] = Form.useForm(); |
| form.setFieldValue( 'roleIds', props.roleIds); |
| const handleCancel = () => { |
| const handleFinish = async (values: Record<string, any>) => { |
| props.onSubmit(values as FormValueType); |
| title={intl.formatMessage({ |
| id: 'system.user.auth.role', |
| label={intl.formatMessage({ |
| rules={[{ required: true, message: '请选择角色!' }]} |
| export default AuthRoleForm; |