@guo514360255/antd-lib 1.4.17 → 1.4.18

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.
@@ -91,13 +91,13 @@ var CustomFormModal = /*#__PURE__*/forwardRef(function (props, ref) {
91
91
  return {
92
92
  open: function open(values) {
93
93
  return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
94
- var data;
94
+ var _formRef$current, data, newData;
95
95
  return _regeneratorRuntime().wrap(function _callee$(_context) {
96
96
  while (1) switch (_context.prev = _context.next) {
97
97
  case 0:
98
98
  setOpen(true);
99
99
  if (!(values !== null && values !== void 0 && values.id && detailRequest)) {
100
- _context.next = 18;
100
+ _context.next = 20;
101
101
  break;
102
102
  }
103
103
  setDetailLoading(true);
@@ -111,25 +111,30 @@ var CustomFormModal = /*#__PURE__*/forwardRef(function (props, ref) {
111
111
  data["".concat(item.dataIndex).concat(formKey)] = data[item.dataIndex];
112
112
  }
113
113
  });
114
- setFieldValues(handleModalData ? handleModalData(data || {}) : data || {});
114
+ newData = handleModalData ? handleModalData(data || {}) : data || {};
115
+ setFieldValues(newData);
116
+ (_formRef$current = formRef.current) === null || _formRef$current === void 0 || _formRef$current.setFieldsValue(formValues || {});
115
117
  return _context.abrupt("return");
116
- case 12:
117
- _context.prev = 12;
118
+ case 14:
119
+ _context.prev = 14;
118
120
  _context.t0 = _context["catch"](3);
119
121
  console.warn(_context.t0);
120
- case 15:
121
- _context.prev = 15;
122
+ case 17:
123
+ _context.prev = 17;
122
124
  setDetailLoading(false);
123
- return _context.finish(15);
124
- case 18:
125
+ return _context.finish(17);
126
+ case 20:
125
127
  setTimeout(function () {
126
- setFieldValues(handleModalData ? handleModalData(values || {}) : values || {});
128
+ var _formRef$current2;
129
+ var newData = handleModalData ? handleModalData(values || {}) : values || {};
130
+ setFieldValues(newData);
131
+ (_formRef$current2 = formRef.current) === null || _formRef$current2 === void 0 || _formRef$current2.setFieldsValue(formValues || {});
127
132
  }, 0);
128
- case 19:
133
+ case 21:
129
134
  case "end":
130
135
  return _context.stop();
131
136
  }
132
- }, _callee, null, [[3, 12, 15, 18]]);
137
+ }, _callee, null, [[3, 14, 17, 20]]);
133
138
  }))();
134
139
  },
135
140
  getFormRef: function getFormRef() {
@@ -139,14 +144,14 @@ var CustomFormModal = /*#__PURE__*/forwardRef(function (props, ref) {
139
144
  });
140
145
  var submitEvent = /*#__PURE__*/function () {
141
146
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
142
- var _formRef$current, _formRef$current2, _tableActionRef$curre, formData, data, result, _key2;
147
+ var _formRef$current3, _formRef$current4, _tableActionRef$curre, formData, data, result, _key2;
143
148
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
144
149
  while (1) switch (_context2.prev = _context2.next) {
145
150
  case 0:
146
151
  setLoading(true);
147
152
  _context2.prev = 1;
148
153
  _context2.next = 4;
149
- return (_formRef$current = formRef.current) === null || _formRef$current === void 0 ? void 0 : _formRef$current.validateFields();
154
+ return (_formRef$current3 = formRef.current) === null || _formRef$current3 === void 0 ? void 0 : _formRef$current3.validateFields();
150
155
  case 4:
151
156
  formData = _context2.sent;
152
157
  data = _objectSpread(_objectSpread({}, formValues), formData);
@@ -183,7 +188,7 @@ var CustomFormModal = /*#__PURE__*/forwardRef(function (props, ref) {
183
188
  return saveRequest(result);
184
189
  case 18:
185
190
  setOpen(false);
186
- (_formRef$current2 = formRef.current) === null || _formRef$current2 === void 0 || _formRef$current2.resetFields();
191
+ (_formRef$current4 = formRef.current) === null || _formRef$current4 === void 0 || _formRef$current4.resetFields();
187
192
  if (onSubmit) {
188
193
  onSubmit();
189
194
  }
@@ -208,9 +213,9 @@ var CustomFormModal = /*#__PURE__*/forwardRef(function (props, ref) {
208
213
  };
209
214
  }();
210
215
  var close = function close() {
211
- var _formRef$current3;
216
+ var _formRef$current5;
212
217
  setOpen(false);
213
- (_formRef$current3 = formRef.current) === null || _formRef$current3 === void 0 || _formRef$current3.resetFields();
218
+ (_formRef$current5 = formRef.current) === null || _formRef$current5 === void 0 || _formRef$current5.resetFields();
214
219
  if (onSubmit) {
215
220
  onSubmit();
216
221
  }
@@ -232,8 +237,8 @@ var CustomFormModal = /*#__PURE__*/forwardRef(function (props, ref) {
232
237
 
233
238
  // 深度监听form数据
234
239
  useDeepCompareEffect(function () {
235
- var _formRef$current4;
236
- (_formRef$current4 = formRef.current) === null || _formRef$current4 === void 0 || _formRef$current4.setFieldsValue(formValues || {});
240
+ var _formRef$current6;
241
+ (_formRef$current6 = formRef.current) === null || _formRef$current6 === void 0 || _formRef$current6.setFieldsValue(formValues || {});
237
242
  }, [formValues]);
238
243
  useEffect(function () {
239
244
  return function () {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@guo514360255/antd-lib",
3
- "version": "1.4.17",
3
+ "version": "1.4.18",
4
4
  "description": "react design 5 lib",
5
5
  "license": "MIT",
6
6
  "module": "dist/index.js",