@guo514360255/antd-lib 1.4.17 → 1.4.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.
|
@@ -188,7 +188,7 @@ var CustomModal = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
188
188
|
}, descProps || {}), columns === null || columns === void 0 ? void 0 : columns.filter(function (item) {
|
|
189
189
|
return !item.hideInDetail;
|
|
190
190
|
}).map(function (item, index) {
|
|
191
|
-
var _item$fieldProps;
|
|
191
|
+
var _item$fieldProps, _item$fieldProps2;
|
|
192
192
|
return /*#__PURE__*/React.createElement(React.Fragment, {
|
|
193
193
|
key: item.dataIndex
|
|
194
194
|
}, /*#__PURE__*/React.createElement(Descriptions.Item, _extends({
|
|
@@ -196,7 +196,7 @@ var CustomModal = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
196
196
|
label: "".concat(item.title)
|
|
197
197
|
}, ((_item$fieldProps = item.fieldProps) === null || _item$fieldProps === void 0 ? void 0 : _item$fieldProps.descriptionsItemProps) || {}), item.type === 'upload' ? /*#__PURE__*/React.createElement(DescImage, {
|
|
198
198
|
data: detail[item.dataIndex]
|
|
199
|
-
}) : handleDetailValue(item, detail[item.dataIndex], index) || '-'));
|
|
199
|
+
}) : handleDetailValue(item, detail[item.dataIndex], index) || '-', /*#__PURE__*/React.createElement("span", null, ((_item$fieldProps2 = item.fieldProps) === null || _item$fieldProps2 === void 0 ? void 0 : _item$fieldProps2.suffix) || '')));
|
|
200
200
|
}))), /*#__PURE__*/React.createElement(Spin, {
|
|
201
201
|
spinning: loading,
|
|
202
202
|
fullscreen: true
|
|
@@ -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 =
|
|
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
|
-
|
|
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
|
|
117
|
-
_context.prev =
|
|
118
|
+
case 14:
|
|
119
|
+
_context.prev = 14;
|
|
118
120
|
_context.t0 = _context["catch"](3);
|
|
119
121
|
console.warn(_context.t0);
|
|
120
|
-
case
|
|
121
|
-
_context.prev =
|
|
122
|
+
case 17:
|
|
123
|
+
_context.prev = 17;
|
|
122
124
|
setDetailLoading(false);
|
|
123
|
-
return _context.finish(
|
|
124
|
-
case
|
|
125
|
+
return _context.finish(17);
|
|
126
|
+
case 20:
|
|
125
127
|
setTimeout(function () {
|
|
126
|
-
|
|
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
|
|
133
|
+
case 21:
|
|
129
134
|
case "end":
|
|
130
135
|
return _context.stop();
|
|
131
136
|
}
|
|
132
|
-
}, _callee, null, [[3,
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
216
|
+
var _formRef$current5;
|
|
212
217
|
setOpen(false);
|
|
213
|
-
(_formRef$
|
|
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$
|
|
236
|
-
(_formRef$
|
|
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 () {
|