@hw-component/form 1.9.57 → 1.9.58

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hw-component/form",
3
- "version": "1.9.57",
3
+ "version": "1.9.58",
4
4
  "description": "基于antd二次开发",
5
5
  "repository": {
6
6
  "type": "git",
@@ -44,7 +44,6 @@ const Index: React.FC<DialogFormProps> = ({
44
44
  modalFormData,
45
45
  setModalVisible,
46
46
  initValue,
47
- onAfterClose,
48
47
  formParams,
49
48
  title: modalTitle,
50
49
  } = useModifyProps({
@@ -100,7 +99,8 @@ const Index: React.FC<DialogFormProps> = ({
100
99
  onClose={cancel}
101
100
  afterVisibleChange={(changeVisible)=>{
102
101
  if (!changeVisible){
103
- onAfterClose()
102
+ dialogForm?.clear();
103
+ afterClose?.();
104
104
  }
105
105
  }}
106
106
  closable={false}
@@ -42,6 +42,7 @@ const Index: React.FC<DialogFormProps> = ({
42
42
  initValue,
43
43
  formParams,
44
44
  title: modalTitle,
45
+ saveOldParams,
45
46
  } = useModifyProps({
46
47
  configData,
47
48
  visible,
@@ -52,6 +53,7 @@ const Index: React.FC<DialogFormProps> = ({
52
53
  onCancel,
53
54
  });
54
55
  const cancel = () => {
56
+ saveOldParams();
55
57
  if (onCancel) {
56
58
  return onCancel?.();
57
59
  }
@@ -28,14 +28,9 @@ export const useModifyProps = ({
28
28
  old: {},
29
29
  };
30
30
  }, []);
31
- const onAfterClose = () => {
31
+ const saveOldParams=()=>{
32
32
  saveOldParamsObj.old = dialogForm.outputValues();
33
- setTimeout(() => {
34
- dialogForm.clear();
35
- afterClose?.();
36
- }, 100);
37
- };
38
-
33
+ }
39
34
  useEffect(() => {
40
35
  setModalVisible(visible);
41
36
  }, [visible]);
@@ -84,9 +79,9 @@ export const useModifyProps = ({
84
79
  setModalFormData,
85
80
  initValue,
86
81
  setInitValue,
87
- onAfterClose,
88
82
  formParams,
89
83
  title: modalTitle,
84
+ saveOldParams
90
85
  };
91
86
  };
92
87
  export const useHDialogForm = () => {