|
@ -48,23 +48,23 @@ const UserModal = (props) => { |
|
|
placeholder="请输入姓名" |
|
|
placeholder="请输入姓名" |
|
|
rules={[{ required: true, message: '请输入姓名' }]} |
|
|
rules={[{ required: true, message: '请输入姓名' }]} |
|
|
/> |
|
|
/> |
|
|
<ProFormText |
|
|
< ProFormText |
|
|
name={['contract', 'username']} |
|
|
name={['contract', 'phone']} |
|
|
width="md" |
|
|
width="md" |
|
|
label="用户名" |
|
|
label="手机号(用户名)" |
|
|
maxLength={20} |
|
|
|
|
|
required |
|
|
required |
|
|
fieldProps={{ |
|
|
fieldProps={{ |
|
|
maxLength: 30, |
|
|
maxLength: 11, |
|
|
}} |
|
|
}} |
|
|
getValueFromEvent={(event) => { |
|
|
getValueFromEvent={(event) => { |
|
|
return event.target.value |
|
|
return event.target.value.replace(/\D/g, '') |
|
|
}} |
|
|
}} |
|
|
placeholder="请输入用户名" |
|
|
placeholder="请输入手机号(用户名)" |
|
|
rules={[ |
|
|
rules={[ |
|
|
{ required: true } |
|
|
{ required: true, valueType: Number, max: 11 }, { pattern: /^1([358][0-9]|4[579]|66|7[0135678]|9[89])[0-9]{8}$/, message: "请输入正确的手机号" } |
|
|
]} |
|
|
]} |
|
|
/> |
|
|
/> |
|
|
|
|
|
|
|
|
</ProForm.Group> |
|
|
</ProForm.Group> |
|
|
<ProForm.Group> |
|
|
<ProForm.Group> |
|
|
<ProFormTreeSelect |
|
|
<ProFormTreeSelect |
|
@ -97,24 +97,38 @@ const UserModal = (props) => { |
|
|
}} |
|
|
}} |
|
|
expandedKeys={["title"]} |
|
|
expandedKeys={["title"]} |
|
|
/> |
|
|
/> |
|
|
< ProFormText |
|
|
{modalType == 'edit' ? null : <ProFormText.Password |
|
|
name={['contract', 'phone']} |
|
|
name={['contract', 'password']} |
|
|
width="md" |
|
|
width="md" |
|
|
label="手机号" |
|
|
label="密码" |
|
|
required |
|
|
required |
|
|
|
|
|
placeholder="请输入密码" |
|
|
fieldProps={{ |
|
|
fieldProps={{ |
|
|
maxLength: 11, |
|
|
autocomplete: 'new-password' |
|
|
}} |
|
|
|
|
|
getValueFromEvent={(event) => { |
|
|
|
|
|
return event.target.value.replace(/\D/g, '') |
|
|
|
|
|
}} |
|
|
}} |
|
|
placeholder="请输入手机号" |
|
|
|
|
|
rules={[ |
|
|
rules={[ |
|
|
{ required: true, valueType: Number, max: 11 }, { pattern: /^1([358][0-9]|4[579]|66|7[0135678]|9[89])[0-9]{8}$/, message: "请输入正确的手机号" } |
|
|
{ required: true, message: '请填写密码' }, |
|
|
|
|
|
{ min: 6, message: '请填写至少6位密码' }, |
|
|
]} |
|
|
]} |
|
|
/> |
|
|
/>} |
|
|
|
|
|
{/* <ProFormText |
|
|
|
|
|
name={['contract', 'username']} |
|
|
|
|
|
width="md" |
|
|
|
|
|
label="职位" |
|
|
|
|
|
fieldProps={{ |
|
|
|
|
|
maxLength: 30, |
|
|
|
|
|
}} |
|
|
|
|
|
getValueFromEvent={(event) => { |
|
|
|
|
|
return event.target.value |
|
|
|
|
|
}} |
|
|
|
|
|
placeholder="请输入职位" |
|
|
|
|
|
// rules={[
|
|
|
|
|
|
// { required: true }
|
|
|
|
|
|
// ]}
|
|
|
|
|
|
/> */} |
|
|
</ProForm.Group> |
|
|
</ProForm.Group> |
|
|
<ProForm.Group> |
|
|
<ProForm.Group> |
|
|
|
|
|
|
|
|
<ProFormText |
|
|
<ProFormText |
|
|
name={['contract', 'email']} |
|
|
name={['contract', 'email']} |
|
|
width="md" |
|
|
width="md" |
|
@ -126,22 +140,6 @@ const UserModal = (props) => { |
|
|
{ type: 'email', message: '请输入正确格式的邮箱' }, |
|
|
{ type: 'email', message: '请输入正确格式的邮箱' }, |
|
|
]} |
|
|
]} |
|
|
/> |
|
|
/> |
|
|
{modalType == 'edit' ? null : <ProFormText.Password |
|
|
|
|
|
name={['contract', 'password']} |
|
|
|
|
|
width="md" |
|
|
|
|
|
label="密码" |
|
|
|
|
|
required |
|
|
|
|
|
placeholder="请输入密码" |
|
|
|
|
|
fieldProps={{ |
|
|
|
|
|
autocomplete: 'new-password' |
|
|
|
|
|
}} |
|
|
|
|
|
rules={[ |
|
|
|
|
|
{ required: true, message: '请填写密码' }, |
|
|
|
|
|
{ min: 6, message: '请填写至少6位密码' }, |
|
|
|
|
|
]} |
|
|
|
|
|
/>} |
|
|
|
|
|
</ProForm.Group> |
|
|
|
|
|
<ProForm.Group> |
|
|
|
|
|
<ProFormSwitch |
|
|
<ProFormSwitch |
|
|
name={['contract', 'enable']} |
|
|
name={['contract', 'enable']} |
|
|
width="md" |
|
|
width="md" |
|
@ -158,7 +156,7 @@ const UserModal = (props) => { |
|
|
|
|
|
|
|
|
function mapStateToProps(state) { |
|
|
function mapStateToProps(state) { |
|
|
const { depMessage } = state; |
|
|
const { depMessage } = state; |
|
|
console.log('depMessage:',depMessage); |
|
|
console.log('depMessage:', depMessage); |
|
|
const pakData = (dep) => { |
|
|
const pakData = (dep) => { |
|
|
// console.log(dep);
|
|
|
// console.log(dep);
|
|
|
return dep.map((d) => { |
|
|
return dep.map((d) => { |
|
@ -171,7 +169,6 @@ function mapStateToProps(state) { |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
let depData = pakData(depMessage.data || []) |
|
|
let depData = pakData(depMessage.data || []) |
|
|
|
|
|
|
|
|
return { |
|
|
return { |
|
|
loading: depMessage.isRequesting, |
|
|
loading: depMessage.isRequesting, |
|
|
depData, |
|
|
depData, |
|
|