修改文件
This commit is contained in:
@@ -20,6 +20,9 @@ const UserForm: React.FC = (props: any) => {
|
||||
|
||||
const { values } = props;
|
||||
|
||||
console.log(values, 'valuesvaluesvaluesvalues');
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
form.resetFields();
|
||||
form.setFieldsValue(values);
|
||||
@@ -89,6 +92,7 @@ const UserForm: React.FC = (props: any) => {
|
||||
label={'用户密码'}
|
||||
colProps={{ md: 12, xl: 12 }}
|
||||
placeholder="请输入用户密码"
|
||||
hidden={values?.id}
|
||||
rules={[
|
||||
{
|
||||
required: values?.id ? false : true,
|
||||
@@ -108,20 +112,12 @@ const UserForm: React.FC = (props: any) => {
|
||||
},
|
||||
]}
|
||||
/>
|
||||
</ProForm.Group>
|
||||
<ProForm.Group>
|
||||
<ProFormText
|
||||
name="email"
|
||||
label={'邮箱'}
|
||||
colProps={{ md: 12, xl: 12 }}
|
||||
placeholder="请输入邮箱"
|
||||
/>
|
||||
{/* <ProFormText
|
||||
name="loginIp"
|
||||
label={'登录IP'}
|
||||
colProps={{ md: 12, xl: 12 }}
|
||||
placeholder="登录IP"
|
||||
/> */}
|
||||
</ProForm.Group>
|
||||
<ProForm.Group>
|
||||
<ProFormSelect
|
||||
@@ -141,12 +137,6 @@ const UserForm: React.FC = (props: any) => {
|
||||
}
|
||||
}
|
||||
}
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: <FormattedMessage id="请选择角色!" defaultMessage="请选择角色!" />,
|
||||
},
|
||||
]}
|
||||
request={async () => {
|
||||
let { data } = await findAllSysRole()
|
||||
return data
|
||||
@@ -158,29 +148,33 @@ const UserForm: React.FC = (props: any) => {
|
||||
|
||||
<ProFormRadio.Group
|
||||
name="userType"
|
||||
valueEnum={{
|
||||
0: '系统用户',
|
||||
}}
|
||||
initialValue="1"
|
||||
options={[
|
||||
{
|
||||
label: '系统用户',
|
||||
value: 0,
|
||||
},
|
||||
]}
|
||||
label={'用户类型'}
|
||||
colProps={{ md: 12, xl: 12 }}
|
||||
fieldProps={{
|
||||
defaultValue: 0
|
||||
}}
|
||||
/>
|
||||
<ProFormRadio.Group
|
||||
name="sex"
|
||||
valueEnum={{
|
||||
0: '男',
|
||||
1: '女',
|
||||
2: '未知',
|
||||
}}
|
||||
initialValue="1"
|
||||
options={[
|
||||
{
|
||||
label: '男',
|
||||
value: 0,
|
||||
},
|
||||
{
|
||||
label: '女',
|
||||
value: 1,
|
||||
},
|
||||
{
|
||||
label: '未知',
|
||||
value: 2,
|
||||
},
|
||||
]}
|
||||
label={'性别'}
|
||||
colProps={{ md: 12, xl: 12 }}
|
||||
fieldProps={{
|
||||
defaultValue: 0
|
||||
}}
|
||||
/>
|
||||
</ProForm>
|
||||
</Modal>
|
||||
|
||||
Reference in New Issue
Block a user