@hw-component/form 1.10.49 → 1.10.50

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.
@@ -90,6 +90,11 @@ var useModifyProps = function useModifyProps(_ref) {
90
90
  dialogForm.getParams = function () {
91
91
  return formParams || {};
92
92
  };
93
+ dialogForm.setParams = function (newParams) {
94
+ setFormParams(function (oldParams) {
95
+ return _objectSpread(_objectSpread({}, oldParams), newParams);
96
+ });
97
+ };
93
98
  return {
94
99
  modalFormData: modalFormData,
95
100
  modalVisible: modalVisible,
@@ -110,7 +115,8 @@ var useHDialogForm = function useHDialogForm() {
110
115
  hide: function hide() {},
111
116
  getParams: function getParams() {
112
117
  return {};
113
- }
118
+ },
119
+ setParams: function setParams() {}
114
120
  });
115
121
  }, []);
116
122
  };
@@ -26,6 +26,7 @@ export interface HDialogFormInstance<P = any, T = any> extends HFormInstance {
26
26
  show: (data?: ShowParamsModal<P, T>) => void;
27
27
  hide: VoidFunction;
28
28
  getParams: () => Record<string, any>;
29
+ setParams: (params: Record<string, any>) => void;
29
30
  }
30
31
  export type FooterRender = (dialogForm?: HDialogFormInstance, loading?: boolean, params?: Record<string, any>) => React.ReactNode;
31
32
  export interface DialogFormProps<P = any, T = any> extends Omit<RootProps, "onFinish" | "onCancel" | "onOk" | "infoRequest" | "title" | "footer" | "configData"> {
@@ -91,6 +91,11 @@ var useModifyProps = function useModifyProps(_ref) {
91
91
  dialogForm.getParams = function () {
92
92
  return formParams || {};
93
93
  };
94
+ dialogForm.setParams = function (newParams) {
95
+ setFormParams(function (oldParams) {
96
+ return _objectSpread(_objectSpread({}, oldParams), newParams);
97
+ });
98
+ };
94
99
  return {
95
100
  modalFormData: modalFormData,
96
101
  modalVisible: modalVisible,
@@ -111,7 +116,8 @@ var useHDialogForm = function useHDialogForm() {
111
116
  hide: function hide() {},
112
117
  getParams: function getParams() {
113
118
  return {};
114
- }
119
+ },
120
+ setParams: function setParams() {}
115
121
  });
116
122
  }, []);
117
123
  };
@@ -26,6 +26,7 @@ export interface HDialogFormInstance<P = any, T = any> extends HFormInstance {
26
26
  show: (data?: ShowParamsModal<P, T>) => void;
27
27
  hide: VoidFunction;
28
28
  getParams: () => Record<string, any>;
29
+ setParams: (params: Record<string, any>) => void;
29
30
  }
30
31
  export type FooterRender = (dialogForm?: HDialogFormInstance, loading?: boolean, params?: Record<string, any>) => React.ReactNode;
31
32
  export interface DialogFormProps<P = any, T = any> extends Omit<RootProps, "onFinish" | "onCancel" | "onOk" | "infoRequest" | "title" | "footer" | "configData"> {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hw-component/form",
3
- "version": "1.10.49",
3
+ "version": "1.10.50",
4
4
  "description": "基于antd二次开发",
5
5
  "repository": {
6
6
  "type": "git",
@@ -75,6 +75,14 @@ export const useModifyProps = ({
75
75
  dialogForm.getParams = () => {
76
76
  return (formParams as Record<string, any>) || {};
77
77
  };
78
+ dialogForm.setParams=(newParams)=>{
79
+ setFormParams((oldParams)=>{
80
+ return {
81
+ ...oldParams,
82
+ ...newParams,
83
+ }
84
+ });
85
+ }
78
86
  return {
79
87
  modalFormData,
80
88
  modalVisible,
@@ -97,6 +105,7 @@ export const useHDialogForm = () => {
97
105
  getParams: () => {
98
106
  return {};
99
107
  },
108
+ setParams: () => {}
100
109
  };
101
110
  }, []);
102
111
  };
@@ -29,6 +29,7 @@ export interface HDialogFormInstance<P = any, T = any> extends HFormInstance {
29
29
  show: (data?: ShowParamsModal<P, T>) => void;
30
30
  hide: VoidFunction;
31
31
  getParams: () => Record<string, any>;
32
+ setParams: (params: Record<string, any>) => void;
32
33
  }
33
34
  export type FooterRender = (
34
35
  dialogForm?: HDialogFormInstance,