|
|
@@ -37,15 +37,36 @@ const AddClient = props => {
|
|
|
}, [])
|
|
|
|
|
|
const handleChange = changedValues => {
|
|
|
+ // const clientName = formRef.current?.getFieldValue('clientName')
|
|
|
if (!changedValues) return
|
|
|
if ('clientName' in changedValues) {
|
|
|
+ if (!changedValues.clientName) {
|
|
|
+ formRef.current?.setFieldsValue({ niceName: '' })
|
|
|
+ return
|
|
|
+ }
|
|
|
const [lastName, ...firstName] = changedValues.clientName.split('')
|
|
|
const newClientName = `${lastName}(${firstName.join('')})工`
|
|
|
formRef.current?.setFieldsValue({ niceName: newClientName })
|
|
|
}
|
|
|
if ('qq' in changedValues) {
|
|
|
+ if (!changedValues.qq) {
|
|
|
+ formRef.current?.setFieldsValue({ email: '' })
|
|
|
+ return
|
|
|
+ }
|
|
|
formRef.current?.setFieldsValue({ email: `${changedValues.qq}@qq.com` })
|
|
|
}
|
|
|
+ // const clientName = formRef.current?.getFieldValue('clientName')
|
|
|
+ // if (clientName) {
|
|
|
+ // const clientNameNum = clientName.split('')
|
|
|
+ // const [firstName, ...lastName] = clientNameNum
|
|
|
+ // const nameAfter = `(${lastName.join('')})`
|
|
|
+ // const newClientName = `${firstName + nameAfter}工`
|
|
|
+ // formRef.current?.setFieldsValue({ niceName: newClientName })
|
|
|
+ // } else if (!formRef.current?.getFieldValue('qq')) {
|
|
|
+ // const emailNum = qq.value
|
|
|
+ // const newEmail = `${emailNum}@qq.com`
|
|
|
+ // formRef.current?.setFieldsValue({ email: newEmail })
|
|
|
+ // }
|
|
|
}
|
|
|
return (
|
|
|
<ModalDragForm
|