|
@@ -64,7 +64,16 @@ const ProjectModal: React.FC<ProjectModalProps> = ({
|
|
|
})
|
|
|
|
|
|
const onMount = () => {
|
|
|
- form.setValues({ ...defaultFormData })
|
|
|
+ const currentFormData = { ...defaultFormData }
|
|
|
+ const keys = Object.keys(currentFormData)
|
|
|
+ keys.forEach(key => {
|
|
|
+ if (currentFormData[key] instanceof Object) {
|
|
|
+ const targetMap = currentFormData[key]
|
|
|
+ delete currentFormData[key]
|
|
|
+ currentFormData[`${key}ID`] = targetMap.ID
|
|
|
+ }
|
|
|
+ })
|
|
|
+ form.setValues(type === ModalType.ADD ? {} : { ...currentFormData })
|
|
|
delay(80).then(() => {
|
|
|
// console.log(pTypeList)
|
|
|
|