|
@@ -35,6 +35,37 @@ const AddClient = props => {
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
}, [])
|
|
}, [])
|
|
|
|
|
+ const handleChange = () => {
|
|
|
|
|
+ if (clientName !== '') {
|
|
|
|
|
+ const clientNameNum = clientName.value.split('')
|
|
|
|
|
+ const clientText = '工'
|
|
|
|
|
+ const symbolBefore = '('
|
|
|
|
|
+ const symbolAfter = ')'
|
|
|
|
|
+ if (clientNameNum?.length < 3) {
|
|
|
|
|
+ const clientNameTwo = clientNameNum[1]
|
|
|
|
|
+ const newClientName =
|
|
|
|
|
+ clientNameNum[0] + symbolBefore + clientNameTwo + symbolAfter + clientText
|
|
|
|
|
+ niceName.value = newClientName
|
|
|
|
|
+ } else if (clientNameNum?.length < 4) {
|
|
|
|
|
+ const clientNameTwo = clientNameNum[1] + clientNameNum[2]
|
|
|
|
|
+ const newClientName =
|
|
|
|
|
+ clientNameNum[0] + symbolBefore + clientNameTwo + symbolAfter + clientText
|
|
|
|
|
+ niceName.value = newClientName
|
|
|
|
|
+ } else if (clientNameNum?.length < 5) {
|
|
|
|
|
+ const clientNameTwo = clientNameNum[1] + clientNameNum[2] + clientNameNum[3]
|
|
|
|
|
+ const newClientName =
|
|
|
|
|
+ clientNameNum[0] + symbolBefore + clientNameTwo + symbolAfter + clientText
|
|
|
|
|
+ niceName.value = newClientName
|
|
|
|
|
+ } else {
|
|
|
|
|
+ niceName.value = ''
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ if (qq !== '') {
|
|
|
|
|
+ const emailText = 'qq.com'
|
|
|
|
|
+ const emailNew = qq.value + emailText
|
|
|
|
|
+ email.value = emailNew
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
return (
|
|
return (
|
|
|
<ModalDragForm
|
|
<ModalDragForm
|
|
|
{...layout}
|
|
{...layout}
|
|
@@ -73,6 +104,7 @@ const AddClient = props => {
|
|
|
) : null
|
|
) : null
|
|
|
]
|
|
]
|
|
|
}}
|
|
}}
|
|
|
|
|
+ onChange={handleChange}
|
|
|
onFinish={async values => {
|
|
onFinish={async values => {
|
|
|
await onConfirm(values)
|
|
await onConfirm(values)
|
|
|
formRef.current?.resetFields()
|
|
formRef.current?.resetFields()
|