@hw-component/form 1.9.18 → 1.9.19
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/es/Form/hooks/index.js
CHANGED
|
@@ -58,7 +58,6 @@ var useInfoReq = function useInfoReq(_ref) {
|
|
|
58
58
|
var infoControl = useRequest(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
59
59
|
var reqParams,
|
|
60
60
|
result,
|
|
61
|
-
setValue,
|
|
62
61
|
_args2 = arguments;
|
|
63
62
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
64
63
|
while (1) switch (_context2.prev = _context2.next) {
|
|
@@ -76,10 +75,15 @@ var useInfoReq = function useInfoReq(_ref) {
|
|
|
76
75
|
form === null || form === void 0 || form.setFieldsValue(result);
|
|
77
76
|
return _context2.abrupt("return", result || {});
|
|
78
77
|
case 8:
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
78
|
+
if (!(typeof initialValues === "undefined")) {
|
|
79
|
+
_context2.next = 10;
|
|
80
|
+
break;
|
|
81
|
+
}
|
|
82
|
+
return _context2.abrupt("return", {});
|
|
83
|
+
case 10:
|
|
84
|
+
form === null || form === void 0 || form.setFieldsValue(initialValues);
|
|
85
|
+
return _context2.abrupt("return", initialValues);
|
|
86
|
+
case 12:
|
|
83
87
|
case "end":
|
|
84
88
|
return _context2.stop();
|
|
85
89
|
}
|
package/lib/Form/hooks/index.js
CHANGED
|
@@ -59,7 +59,6 @@ var useInfoReq = function useInfoReq(_ref) {
|
|
|
59
59
|
var infoControl = ahooks.useRequest(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
60
60
|
var reqParams,
|
|
61
61
|
result,
|
|
62
|
-
setValue,
|
|
63
62
|
_args2 = arguments;
|
|
64
63
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
65
64
|
while (1) switch (_context2.prev = _context2.next) {
|
|
@@ -77,10 +76,15 @@ var useInfoReq = function useInfoReq(_ref) {
|
|
|
77
76
|
form === null || form === void 0 || form.setFieldsValue(result);
|
|
78
77
|
return _context2.abrupt("return", result || {});
|
|
79
78
|
case 8:
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
79
|
+
if (!(typeof initialValues === "undefined")) {
|
|
80
|
+
_context2.next = 10;
|
|
81
|
+
break;
|
|
82
|
+
}
|
|
83
|
+
return _context2.abrupt("return", {});
|
|
84
|
+
case 10:
|
|
85
|
+
form === null || form === void 0 || form.setFieldsValue(initialValues);
|
|
86
|
+
return _context2.abrupt("return", initialValues);
|
|
87
|
+
case 12:
|
|
84
88
|
case "end":
|
|
85
89
|
return _context2.stop();
|
|
86
90
|
}
|
package/package.json
CHANGED
|
@@ -51,9 +51,11 @@ export const useInfoReq = ({
|
|
|
51
51
|
form?.setFieldsValue(result);
|
|
52
52
|
return result || {};
|
|
53
53
|
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
54
|
+
if (typeof initialValues==="undefined"){
|
|
55
|
+
return {};
|
|
56
|
+
}
|
|
57
|
+
form?.setFieldsValue(initialValues);
|
|
58
|
+
return initialValues;
|
|
57
59
|
});
|
|
58
60
|
const { run, mutate } = infoControl;
|
|
59
61
|
useEffect(() => {
|