@guo514360255/antd-lib 1.4.1 → 1.4.2
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/dist/CustomTable/index.js +49 -23
- package/package.json +1 -1
|
@@ -173,12 +173,38 @@ var CustomTable = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
173
173
|
var totalWidth = columns === null || columns === void 0 ? void 0 : columns.reduce(function (sum, col) {
|
|
174
174
|
return sum + (col.width || 100);
|
|
175
175
|
}, 0);
|
|
176
|
-
var openModal = function
|
|
177
|
-
var
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
176
|
+
var openModal = /*#__PURE__*/function () {
|
|
177
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
178
|
+
var _formModalRef$current;
|
|
179
|
+
var record,
|
|
180
|
+
data,
|
|
181
|
+
_args3 = arguments;
|
|
182
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
183
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
184
|
+
case 0:
|
|
185
|
+
record = _args3.length > 0 && _args3[0] !== undefined ? _args3[0] : {};
|
|
186
|
+
data = record;
|
|
187
|
+
if (!(detailRequest && record.id)) {
|
|
188
|
+
_context3.next = 6;
|
|
189
|
+
break;
|
|
190
|
+
}
|
|
191
|
+
_context3.next = 5;
|
|
192
|
+
return detailRequest(record.id);
|
|
193
|
+
case 5:
|
|
194
|
+
data = _context3.sent;
|
|
195
|
+
case 6:
|
|
196
|
+
// @ts-ignore
|
|
197
|
+
(_formModalRef$current = formModalRef.current) === null || _formModalRef$current === void 0 || _formModalRef$current.open(handleModalData ? handleModalData(data) : data);
|
|
198
|
+
case 7:
|
|
199
|
+
case "end":
|
|
200
|
+
return _context3.stop();
|
|
201
|
+
}
|
|
202
|
+
}, _callee3);
|
|
203
|
+
}));
|
|
204
|
+
return function openModal() {
|
|
205
|
+
return _ref4.apply(this, arguments);
|
|
206
|
+
};
|
|
207
|
+
}();
|
|
182
208
|
var handleColumns = function handleColumns() {
|
|
183
209
|
var _newColumns$;
|
|
184
210
|
var newColumns = cloneDeep(columns);
|
|
@@ -328,52 +354,52 @@ var CustomTable = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
328
354
|
formRef: formRef,
|
|
329
355
|
columns: handleColumns() || [],
|
|
330
356
|
request: ( /*#__PURE__*/function () {
|
|
331
|
-
var
|
|
357
|
+
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(params, sort, filter) {
|
|
332
358
|
var pageNo, _yield$request, list, data;
|
|
333
|
-
return _regeneratorRuntime().wrap(function
|
|
334
|
-
while (1) switch (
|
|
359
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
360
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
335
361
|
case 0:
|
|
336
362
|
if (!(request && !dataSource)) {
|
|
337
|
-
|
|
363
|
+
_context4.next = 20;
|
|
338
364
|
break;
|
|
339
365
|
}
|
|
340
366
|
setLoading(true);
|
|
341
|
-
|
|
367
|
+
_context4.prev = 2;
|
|
342
368
|
pageNo = params.current;
|
|
343
369
|
delete params.current;
|
|
344
|
-
|
|
370
|
+
_context4.next = 7;
|
|
345
371
|
return request(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, params), {}, {
|
|
346
372
|
pageNo: pageNo
|
|
347
373
|
}, sort), filter), defaultQueryParams));
|
|
348
374
|
case 7:
|
|
349
|
-
_yield$request =
|
|
375
|
+
_yield$request = _context4.sent;
|
|
350
376
|
list = _yield$request.list;
|
|
351
377
|
data = _objectWithoutProperties(_yield$request, _excluded2);
|
|
352
378
|
getAntTableContainer();
|
|
353
|
-
return
|
|
379
|
+
return _context4.abrupt("return", _objectSpread({
|
|
354
380
|
data: list
|
|
355
381
|
}, data));
|
|
356
382
|
case 14:
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
console.log(
|
|
383
|
+
_context4.prev = 14;
|
|
384
|
+
_context4.t0 = _context4["catch"](2);
|
|
385
|
+
console.log(_context4.t0);
|
|
360
386
|
case 17:
|
|
361
|
-
|
|
387
|
+
_context4.prev = 17;
|
|
362
388
|
setLoading(false);
|
|
363
|
-
return
|
|
389
|
+
return _context4.finish(17);
|
|
364
390
|
case 20:
|
|
365
|
-
return
|
|
391
|
+
return _context4.abrupt("return", {
|
|
366
392
|
data: [],
|
|
367
393
|
total: 0
|
|
368
394
|
});
|
|
369
395
|
case 21:
|
|
370
396
|
case "end":
|
|
371
|
-
return
|
|
397
|
+
return _context4.stop();
|
|
372
398
|
}
|
|
373
|
-
},
|
|
399
|
+
}, _callee4, null, [[2, 14, 17, 20]]);
|
|
374
400
|
}));
|
|
375
401
|
return function (_x3, _x4, _x5) {
|
|
376
|
-
return
|
|
402
|
+
return _ref5.apply(this, arguments);
|
|
377
403
|
};
|
|
378
404
|
}()),
|
|
379
405
|
rowKey: rowKey || 'id',
|