| | |
| | | ProFormDigit, |
| | | ProFormText, |
| | | ProFormSelect, |
| | | ProFormTreeSelect |
| | | ProFormTreeSelect, |
| | | ProFormTextArea, |
| | | ProFormRadio |
| | | } from '@ant-design/pro-components'; |
| | | import { Form, Modal } from 'antd'; |
| | | import moment from 'moment'; |
| | |
| | | useEffect(() => { |
| | | form.resetFields(); |
| | | form.setFieldsValue({ |
| | | ...props.values |
| | | ...props.values, |
| | | roleIds: props.values.userRoleIds |
| | | }) |
| | | }, [form, props]) |
| | | |
| | |
| | | rules={[{ required: true, message: "所属部门不能为空" }]} |
| | | /> |
| | | <ProFormText |
| | | name="nickname" |
| | | label="名称" |
| | | colProps={{ md: 12, xl: 12 }} |
| | | placeholder="请输入" |
| | | rules={[{ required: true, message: "名称不能为空!" }]} |
| | | /> |
| | | |
| | | </ProForm.Group> |
| | | <ProForm.Group> |
| | | <ProFormText |
| | | name="username" |
| | | label="登录账号" |
| | | colProps={{ md: 12, xl: 12 }} |
| | | placeholder="请输入" |
| | | rules={[{ required: true, message: "登录账号不能为空!" }]} |
| | | /> |
| | | </ProForm.Group> |
| | | <ProForm.Group> |
| | | <ProFormText |
| | | name="password" |
| | | label="登录密码" |
| | | name="nickname" |
| | | label="名称" |
| | | colProps={{ md: 12, xl: 12 }} |
| | | placeholder="请输入" |
| | | rules={[{ required: true, message: "名称不能为空!" }]} |
| | | /> |
| | | <ProFormSelect |
| | | name="sex" |
| | | label="性别" |
| | | colProps={{ md: 12, xl: 12 }} |
| | | placeholder="请选择" |
| | | options={[ |
| | | { label: '未知', value: 0 }, |
| | | { label: '男', value: 1 }, |
| | | { label: '女', value: 2 }, |
| | | ]} |
| | | /> |
| | | </ProForm.Group> |
| | | <ProForm.Group> |
| | |
| | | label="手机号" |
| | | colProps={{ md: 12, xl: 12 }} |
| | | placeholder="请输入" |
| | | ules={[ |
| | | rules={[ |
| | | { |
| | | pattern: /^1[3456789]\d{9}$/, |
| | | message: '请输入正确的手机号码!', |
| | | pattern: /^1[3456789]\d{9}$/, |
| | | message: '请输入正确的手机号码!', |
| | | }, |
| | | { |
| | | required: false, |
| | | message: '手机号码不能为空!', |
| | | required: false, |
| | | message: '手机号码不能为空!', |
| | | }, |
| | | ]} |
| | | |
| | | ]} |
| | | |
| | | /> |
| | | <ProFormText |
| | | name="email" |
| | |
| | | placeholder="请输入" |
| | | rules={[ |
| | | { |
| | | type: 'email', |
| | | message: '请输入正确的邮箱地址!', |
| | | type: 'email', |
| | | message: '请输入正确的邮箱地址!', |
| | | }, |
| | | { |
| | | required: false, |
| | | message: '邮箱不能为空!', |
| | | required: false, |
| | | message: '邮箱不能为空!', |
| | | }, |
| | | ]} |
| | | ]} |
| | | /> |
| | | </ProForm.Group> |
| | | <ProForm.Group> |
| | |
| | | /> |
| | | </ProForm.Group> |
| | | <ProForm.Group> |
| | | <ProFormSelect |
| | | name="sex" |
| | | label="性别" |
| | | colProps={{ md: 12, xl: 12 }} |
| | | placeholder="请选择" |
| | | options={[ |
| | | { label: '未知', value: 0 }, |
| | | { label: '男', value: 1 }, |
| | | { label: '女', value: 2 }, |
| | | ]} |
| | | /> |
| | | <ProFormSelect |
| | | <ProFormRadio.Group |
| | | name="status" |
| | | label="状态" |
| | | colProps={{ md: 12, xl: 12 }} |
| | |
| | | { label: '禁用', value: 0 }, |
| | | ]} |
| | | /> |
| | | <ProFormSelect |
| | | name="roleIds" |
| | | mode="multiple" |
| | | label="角色" |
| | | colProps={{ md: 12, xl: 12 }} |
| | | placeholder="请选择" |
| | | rules={[{ required: true, type: 'array', message: '角色不能为空!' }]} |
| | | request={async ({ keyWords }) => { |
| | | const resp = await Http.doPostForm('api/role/query', { condition: keyWords }); |
| | | return resp.data; |
| | | }} |
| | | /> |
| | | </ProForm.Group> |
| | | |
| | | <ProFormTextArea |
| | | name="memo" |
| | | label="备注" |
| | | colProps={{ md: 24, xl: 24 }} |
| | | placeholder="请输入" |
| | | /> |
| | | </ProForm> |
| | | </Modal> |
| | | </> |