wargerm 0.7.52 → 0.7.55
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/components/TabelCard/example/demo9.d.ts +3 -0
- package/dist/index.esm.js +109 -149
- package/dist/index.js +109 -149
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
@@ -6978,7 +6978,7 @@ function DragBox(_ref) {
|
|
6978
6978
|
}, children)) : /*#__PURE__*/React.createElement(React.Fragment, null);
|
6979
6979
|
}
|
6980
6980
|
|
6981
|
-
var _excluded$k = ["columns", "extraColumns", "search", "open", "setOpen", "modalFormOpend", "disabled", "submitMethod", "onSubmitSuccess", "title", "record", "onFormChange", "formItemChild", "onCancel", "
|
6981
|
+
var _excluded$k = ["columns", "extraColumns", "search", "open", "setOpen", "modalFormOpend", "disabled", "submitMethod", "onSubmitSuccess", "title", "record", "onFormChange", "formItemChild", "onCancel", "modalHeaderSlot", "modalFooterSlot", "formProps"];
|
6982
6982
|
|
6983
6983
|
var ModalForm = function ModalForm(props, ref) {
|
6984
6984
|
var columns = props.columns,
|
@@ -6995,8 +6995,8 @@ var ModalForm = function ModalForm(props, ref) {
|
|
6995
6995
|
onFormChange = props.onFormChange,
|
6996
6996
|
formItemChild = props.formItemChild,
|
6997
6997
|
onCancel = props.onCancel,
|
6998
|
-
|
6999
|
-
|
6998
|
+
modalHeaderSlot = props.modalHeaderSlot,
|
6999
|
+
modalFooterSlot = props.modalFooterSlot,
|
7000
7000
|
formProps = props.formProps,
|
7001
7001
|
extraProps = _objectWithoutProperties(props, _excluded$k);
|
7002
7002
|
|
@@ -7130,7 +7130,7 @@ var ModalForm = function ModalForm(props, ref) {
|
|
7130
7130
|
onOk: handleOk,
|
7131
7131
|
confirmLoading: confirmLoading,
|
7132
7132
|
onCancel: handleCancel
|
7133
|
-
}, extraProps),
|
7133
|
+
}, extraProps), modalHeaderSlot, /*#__PURE__*/React.createElement(WForm$1, _objectSpread2({
|
7134
7134
|
ref: formRef,
|
7135
7135
|
disabled: disabled,
|
7136
7136
|
onSubmit: onSubmit,
|
@@ -7141,12 +7141,12 @@ var ModalForm = function ModalForm(props, ref) {
|
|
7141
7141
|
columns: columns,
|
7142
7142
|
disabledRuler: disabled,
|
7143
7143
|
extraColumns: extraColumns
|
7144
|
-
}, formProps || {})), title == '查看' && formItemChild ? formItemChild() : null,
|
7144
|
+
}, formProps || {})), title == '查看' && formItemChild ? formItemChild() : null, modalFooterSlot);
|
7145
7145
|
};
|
7146
7146
|
|
7147
7147
|
var ModalForm$1 = /*#__PURE__*/React.forwardRef(ModalForm);
|
7148
7148
|
|
7149
|
-
var _excluded$l = ["columns", "extraColumns", "request", "modalFormSearch", "search", "tableAction", "fliterAction", "renderTableBar", "renderTableBarDeps", "className", "style", "onFormChange", "modalConfig", "searchFormConfig", "optionColumnConfig", "pagination", "noBordered", "showIndex"];
|
7149
|
+
var _excluded$l = ["columns", "extraColumns", "request", "modalFormSearch", "search", "tableAction", "fliterAction", "renderTableBar", "renderTableBarDeps", "className", "style", "onFormChange", "modalConfig", "searchFormConfig", "optionColumnConfig", "pagination", "noBordered", "showIndex", "searchTableSlot"];
|
7150
7150
|
|
7151
7151
|
var TabelCard = function TabelCard(props, ref) {
|
7152
7152
|
var columns = props.columns,
|
@@ -7167,6 +7167,7 @@ var TabelCard = function TabelCard(props, ref) {
|
|
7167
7167
|
pagination = props.pagination,
|
7168
7168
|
noBordered = props.noBordered,
|
7169
7169
|
showIndex = props.showIndex,
|
7170
|
+
searchTableSlot = props.searchTableSlot,
|
7170
7171
|
extraProps = _objectWithoutProperties(props, _excluded$l);
|
7171
7172
|
|
7172
7173
|
var actionRef = useRef();
|
@@ -7314,10 +7315,8 @@ var TabelCard = function TabelCard(props, ref) {
|
|
7314
7315
|
}()
|
7315
7316
|
});
|
7316
7317
|
},
|
7317
|
-
|
7318
|
-
var
|
7319
|
-
|
7320
|
-
return (_item$actionRender = item.actionRender) === null || _item$actionRender === void 0 ? void 0 : _item$actionRender.call(item, record, actionRef, /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee4() {
|
7318
|
+
custom: function () {
|
7319
|
+
var _custom = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee4(item, record, index) {
|
7321
7320
|
return regeneratorRuntime.wrap(function _callee4$(_context4) {
|
7322
7321
|
while (1) {
|
7323
7322
|
switch (_context4.prev = _context4.next) {
|
@@ -7332,7 +7331,7 @@ var TabelCard = function TabelCard(props, ref) {
|
|
7332
7331
|
var _actionRef$current3;
|
7333
7332
|
|
7334
7333
|
actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$current3 = actionRef.current) === null || _actionRef$current3 === void 0 ? void 0 : _actionRef$current3.reload();
|
7335
|
-
});
|
7334
|
+
}, record);
|
7336
7335
|
|
7337
7336
|
case 3:
|
7338
7337
|
case "end":
|
@@ -7340,6 +7339,40 @@ var TabelCard = function TabelCard(props, ref) {
|
|
7340
7339
|
}
|
7341
7340
|
}
|
7342
7341
|
}, _callee4);
|
7342
|
+
}));
|
7343
|
+
|
7344
|
+
function custom(_x3, _x4, _x5) {
|
7345
|
+
return _custom.apply(this, arguments);
|
7346
|
+
}
|
7347
|
+
|
7348
|
+
return custom;
|
7349
|
+
}(),
|
7350
|
+
extraAction: function extraAction(item, record, index) {
|
7351
|
+
var _item$actionRender;
|
7352
|
+
|
7353
|
+
return (_item$actionRender = item.actionRender) === null || _item$actionRender === void 0 ? void 0 : _item$actionRender.call(item, record, actionRef, /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5() {
|
7354
|
+
return regeneratorRuntime.wrap(function _callee5$(_context5) {
|
7355
|
+
while (1) {
|
7356
|
+
switch (_context5.prev = _context5.next) {
|
7357
|
+
case 0:
|
7358
|
+
if (!item.actionMethod) {
|
7359
|
+
_context5.next = 3;
|
7360
|
+
break;
|
7361
|
+
}
|
7362
|
+
|
7363
|
+
_context5.next = 3;
|
7364
|
+
return item.actionMethod(record, function () {
|
7365
|
+
var _actionRef$current4;
|
7366
|
+
|
7367
|
+
actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$current4 = actionRef.current) === null || _actionRef$current4 === void 0 ? void 0 : _actionRef$current4.reload();
|
7368
|
+
});
|
7369
|
+
|
7370
|
+
case 3:
|
7371
|
+
case "end":
|
7372
|
+
return _context5.stop();
|
7373
|
+
}
|
7374
|
+
}
|
7375
|
+
}, _callee5);
|
7343
7376
|
})), index);
|
7344
7377
|
}
|
7345
7378
|
};
|
@@ -7358,7 +7391,9 @@ var TabelCard = function TabelCard(props, ref) {
|
|
7358
7391
|
title: '删除',
|
7359
7392
|
key: 'delete',
|
7360
7393
|
icon: /*#__PURE__*/React.createElement(DeleteOutlined, null)
|
7361
|
-
}
|
7394
|
+
},
|
7395
|
+
custom: {} // TODO: 遍历的时候赋值
|
7396
|
+
|
7362
7397
|
};
|
7363
7398
|
|
7364
7399
|
var tableActionDom = function tableActionDom(record, index) {
|
@@ -7369,42 +7404,19 @@ var TabelCard = function TabelCard(props, ref) {
|
|
7369
7404
|
|
7370
7405
|
if (tableAction && showMoreNum > 0 && showMoreNum < tableActionList.length) {
|
7371
7406
|
var tableAction1 = tableActionList === null || tableActionList === void 0 ? void 0 : tableActionList.slice(0, showMoreNum);
|
7372
|
-
var tableAction2 = tableActionList === null || tableActionList === void 0 ? void 0 : tableActionList.slice(showMoreNum);
|
7373
|
-
// <Menu>
|
7374
|
-
// {tableAction2.map((item: any, i: number) => {
|
7375
|
-
// let btn = actionConfig[item.type];
|
7376
|
-
// if (btn) {
|
7377
|
-
// return (
|
7378
|
-
// <Menu.Item key={i}>
|
7379
|
-
// <a
|
7380
|
-
// key={btn.key}
|
7381
|
-
// onClick={async e => {
|
7382
|
-
// e.stopPropagation();
|
7383
|
-
// let info = null;
|
7384
|
-
// if (item.fetchInfo) {
|
7385
|
-
// info = await item.fetchInfo(record);
|
7386
|
-
// }
|
7387
|
-
// actionHandler[item.type]?.(item, info || record, index);
|
7388
|
-
// }}
|
7389
|
-
// >
|
7390
|
-
// {btn.icon} {btn.title}
|
7391
|
-
// </a>
|
7392
|
-
// </Menu.Item>
|
7393
|
-
// );
|
7394
|
-
// }
|
7395
|
-
// return (
|
7396
|
-
// <Menu.Item key={i}>
|
7397
|
-
// {actionHandler[item.type]?.(item, record, index)}
|
7398
|
-
// </Menu.Item>
|
7399
|
-
// );
|
7400
|
-
// })}
|
7401
|
-
// </Menu>
|
7402
|
-
// );
|
7403
|
-
|
7407
|
+
var tableAction2 = tableActionList === null || tableActionList === void 0 ? void 0 : tableActionList.slice(showMoreNum);
|
7404
7408
|
var menu = {
|
7405
7409
|
items: tableAction2.map(function (item, i) {
|
7406
7410
|
var _actionHandler$item$t2;
|
7407
7411
|
|
7412
|
+
if (item.type == 'custom') {
|
7413
|
+
actionConfig[item.type] = {
|
7414
|
+
title: item.title,
|
7415
|
+
key: item.key,
|
7416
|
+
icon: item.icon
|
7417
|
+
};
|
7418
|
+
}
|
7419
|
+
|
7408
7420
|
var btn = actionConfig[item.type];
|
7409
7421
|
|
7410
7422
|
if (btn) {
|
@@ -7413,40 +7425,40 @@ var TabelCard = function TabelCard(props, ref) {
|
|
7413
7425
|
label: /*#__PURE__*/React.createElement("a", {
|
7414
7426
|
key: btn.key,
|
7415
7427
|
onClick: function () {
|
7416
|
-
var _onClick = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function
|
7428
|
+
var _onClick = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee6(e) {
|
7417
7429
|
var _actionHandler$item$t;
|
7418
7430
|
|
7419
7431
|
var info;
|
7420
|
-
return regeneratorRuntime.wrap(function
|
7432
|
+
return regeneratorRuntime.wrap(function _callee6$(_context6) {
|
7421
7433
|
while (1) {
|
7422
|
-
switch (
|
7434
|
+
switch (_context6.prev = _context6.next) {
|
7423
7435
|
case 0:
|
7424
7436
|
e.stopPropagation();
|
7425
7437
|
info = null;
|
7426
7438
|
|
7427
7439
|
if (!item.fetchInfo) {
|
7428
|
-
|
7440
|
+
_context6.next = 6;
|
7429
7441
|
break;
|
7430
7442
|
}
|
7431
7443
|
|
7432
|
-
|
7444
|
+
_context6.next = 5;
|
7433
7445
|
return item.fetchInfo(record);
|
7434
7446
|
|
7435
7447
|
case 5:
|
7436
|
-
info =
|
7448
|
+
info = _context6.sent;
|
7437
7449
|
|
7438
7450
|
case 6:
|
7439
7451
|
(_actionHandler$item$t = actionHandler[item.type]) === null || _actionHandler$item$t === void 0 ? void 0 : _actionHandler$item$t.call(actionHandler, item, info || record, index);
|
7440
7452
|
|
7441
7453
|
case 7:
|
7442
7454
|
case "end":
|
7443
|
-
return
|
7455
|
+
return _context6.stop();
|
7444
7456
|
}
|
7445
7457
|
}
|
7446
|
-
},
|
7458
|
+
}, _callee6);
|
7447
7459
|
}));
|
7448
7460
|
|
7449
|
-
function onClick(
|
7461
|
+
function onClick(_x6) {
|
7450
7462
|
return _onClick.apply(this, arguments);
|
7451
7463
|
}
|
7452
7464
|
|
@@ -7474,40 +7486,40 @@ var TabelCard = function TabelCard(props, ref) {
|
|
7474
7486
|
}, /*#__PURE__*/React.createElement("a", {
|
7475
7487
|
key: btn.key,
|
7476
7488
|
onClick: function () {
|
7477
|
-
var _onClick2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function
|
7489
|
+
var _onClick2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee7(e) {
|
7478
7490
|
var _actionHandler$item$t3;
|
7479
7491
|
|
7480
7492
|
var info;
|
7481
|
-
return regeneratorRuntime.wrap(function
|
7493
|
+
return regeneratorRuntime.wrap(function _callee7$(_context7) {
|
7482
7494
|
while (1) {
|
7483
|
-
switch (
|
7495
|
+
switch (_context7.prev = _context7.next) {
|
7484
7496
|
case 0:
|
7485
7497
|
e.stopPropagation();
|
7486
7498
|
info = null;
|
7487
7499
|
|
7488
7500
|
if (!item.fetchInfo) {
|
7489
|
-
|
7501
|
+
_context7.next = 6;
|
7490
7502
|
break;
|
7491
7503
|
}
|
7492
7504
|
|
7493
|
-
|
7505
|
+
_context7.next = 5;
|
7494
7506
|
return item.fetchInfo(record);
|
7495
7507
|
|
7496
7508
|
case 5:
|
7497
|
-
info =
|
7509
|
+
info = _context7.sent;
|
7498
7510
|
|
7499
7511
|
case 6:
|
7500
7512
|
(_actionHandler$item$t3 = actionHandler[item.type]) === null || _actionHandler$item$t3 === void 0 ? void 0 : _actionHandler$item$t3.call(actionHandler, item, info || record, index);
|
7501
7513
|
|
7502
7514
|
case 7:
|
7503
7515
|
case "end":
|
7504
|
-
return
|
7516
|
+
return _context7.stop();
|
7505
7517
|
}
|
7506
7518
|
}
|
7507
|
-
},
|
7519
|
+
}, _callee7);
|
7508
7520
|
}));
|
7509
7521
|
|
7510
|
-
function onClick(
|
7522
|
+
function onClick(_x7) {
|
7511
7523
|
return _onClick2.apply(this, arguments);
|
7512
7524
|
}
|
7513
7525
|
|
@@ -7561,33 +7573,33 @@ var TabelCard = function TabelCard(props, ref) {
|
|
7561
7573
|
type: '新增',
|
7562
7574
|
record: {},
|
7563
7575
|
modalOnOk: function () {
|
7564
|
-
var _modalOnOk3 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function
|
7565
|
-
return regeneratorRuntime.wrap(function
|
7576
|
+
var _modalOnOk3 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee8(values, loading) {
|
7577
|
+
return regeneratorRuntime.wrap(function _callee8$(_context8) {
|
7566
7578
|
while (1) {
|
7567
|
-
switch (
|
7579
|
+
switch (_context8.prev = _context8.next) {
|
7568
7580
|
case 0:
|
7569
7581
|
if (!item.actionMethod) {
|
7570
|
-
|
7582
|
+
_context8.next = 3;
|
7571
7583
|
break;
|
7572
7584
|
}
|
7573
7585
|
|
7574
|
-
|
7586
|
+
_context8.next = 3;
|
7575
7587
|
return item.actionMethod(values, function () {
|
7576
|
-
var _actionRef$
|
7588
|
+
var _actionRef$current5;
|
7577
7589
|
|
7578
7590
|
loading();
|
7579
|
-
actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$
|
7591
|
+
actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$current5 = actionRef.current) === null || _actionRef$current5 === void 0 ? void 0 : _actionRef$current5.reload();
|
7580
7592
|
});
|
7581
7593
|
|
7582
7594
|
case 3:
|
7583
7595
|
case "end":
|
7584
|
-
return
|
7596
|
+
return _context8.stop();
|
7585
7597
|
}
|
7586
7598
|
}
|
7587
|
-
},
|
7599
|
+
}, _callee8);
|
7588
7600
|
}));
|
7589
7601
|
|
7590
|
-
function modalOnOk(
|
7602
|
+
function modalOnOk(_x8, _x9) {
|
7591
7603
|
return _modalOnOk3.apply(this, arguments);
|
7592
7604
|
}
|
7593
7605
|
|
@@ -7617,9 +7629,9 @@ var TabelCard = function TabelCard(props, ref) {
|
|
7617
7629
|
children: (_item$actionRender2 = item.actionRender) === null || _item$actionRender2 === void 0 ? void 0 : _item$actionRender2.call(item, actionRef, function () {
|
7618
7630
|
searchFormRef.current;
|
7619
7631
|
item.actionMethod && item.actionMethod(tableRequestParmas.current, function () {
|
7620
|
-
var _actionRef$
|
7632
|
+
var _actionRef$current6;
|
7621
7633
|
|
7622
|
-
return actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$
|
7634
|
+
return actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$current6 = actionRef.current) === null || _actionRef$current6 === void 0 ? void 0 : _actionRef$current6.reload();
|
7623
7635
|
});
|
7624
7636
|
})
|
7625
7637
|
};
|
@@ -7628,29 +7640,29 @@ var TabelCard = function TabelCard(props, ref) {
|
|
7628
7640
|
}, [actionRef, renderTableBarDeps]);
|
7629
7641
|
|
7630
7642
|
var onSubmit = function onSubmit(values) {
|
7631
|
-
var _actionRef$
|
7643
|
+
var _actionRef$current7;
|
7632
7644
|
|
7633
7645
|
(searchFormConfig === null || searchFormConfig === void 0 ? void 0 : searchFormConfig.handleSubmit) && searchFormConfig.handleSubmit(values);
|
7634
7646
|
formSearchRef.current = values;
|
7635
|
-
actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$
|
7647
|
+
actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$current7 = actionRef.current) === null || _actionRef$current7 === void 0 ? void 0 : _actionRef$current7.reload(true);
|
7636
7648
|
};
|
7637
7649
|
|
7638
7650
|
var onKeyUpSubmit = function onKeyUpSubmit(values) {
|
7639
7651
|
if (values.keyCode === 13) {
|
7640
|
-
var _searchFormRef$curren, _searchFormRef$curren2, _actionRef$
|
7652
|
+
var _searchFormRef$curren, _searchFormRef$curren2, _actionRef$current8;
|
7641
7653
|
|
7642
7654
|
(searchFormConfig === null || searchFormConfig === void 0 ? void 0 : searchFormConfig.handleSubmit) && searchFormConfig.handleSubmit((_searchFormRef$curren = searchFormRef.current) === null || _searchFormRef$curren === void 0 ? void 0 : _searchFormRef$curren.getFormValues());
|
7643
7655
|
formSearchRef.current = (_searchFormRef$curren2 = searchFormRef.current) === null || _searchFormRef$curren2 === void 0 ? void 0 : _searchFormRef$curren2.getFormValues();
|
7644
|
-
actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$
|
7656
|
+
actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$current8 = actionRef.current) === null || _actionRef$current8 === void 0 ? void 0 : _actionRef$current8.reload(true);
|
7645
7657
|
}
|
7646
7658
|
};
|
7647
7659
|
|
7648
7660
|
var onReset = function onReset(values) {
|
7649
|
-
var _actionRef$
|
7661
|
+
var _actionRef$current9;
|
7650
7662
|
|
7651
7663
|
(searchFormConfig === null || searchFormConfig === void 0 ? void 0 : searchFormConfig.onReset) && searchFormConfig.onReset();
|
7652
7664
|
formSearchRef.current = _objectSpread2({}, values);
|
7653
|
-
actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$
|
7665
|
+
actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$current9 = actionRef.current) === null || _actionRef$current9 === void 0 ? void 0 : _actionRef$current9.reload(true);
|
7654
7666
|
};
|
7655
7667
|
|
7656
7668
|
useEffect(function () {
|
@@ -7678,28 +7690,28 @@ var TabelCard = function TabelCard(props, ref) {
|
|
7678
7690
|
disabled: modalFormConfig.type == '查看',
|
7679
7691
|
setOpen: setOpen,
|
7680
7692
|
submitMethod: function () {
|
7681
|
-
var _submitMethod = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function
|
7682
|
-
return regeneratorRuntime.wrap(function
|
7693
|
+
var _submitMethod = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee9(values, loading) {
|
7694
|
+
return regeneratorRuntime.wrap(function _callee9$(_context9) {
|
7683
7695
|
while (1) {
|
7684
|
-
switch (
|
7696
|
+
switch (_context9.prev = _context9.next) {
|
7685
7697
|
case 0:
|
7686
7698
|
if (!modalFormConfig.modalOnOk) {
|
7687
|
-
|
7699
|
+
_context9.next = 3;
|
7688
7700
|
break;
|
7689
7701
|
}
|
7690
7702
|
|
7691
|
-
|
7703
|
+
_context9.next = 3;
|
7692
7704
|
return modalFormConfig.modalOnOk(values, loading);
|
7693
7705
|
|
7694
7706
|
case 3:
|
7695
7707
|
case "end":
|
7696
|
-
return
|
7708
|
+
return _context9.stop();
|
7697
7709
|
}
|
7698
7710
|
}
|
7699
|
-
},
|
7711
|
+
}, _callee9);
|
7700
7712
|
}));
|
7701
7713
|
|
7702
|
-
function submitMethod(
|
7714
|
+
function submitMethod(_x10, _x11) {
|
7703
7715
|
return _submitMethod.apply(this, arguments);
|
7704
7716
|
}
|
7705
7717
|
|
@@ -7745,58 +7757,6 @@ var TabelCard = function TabelCard(props, ref) {
|
|
7745
7757
|
})), search !== false && /*#__PURE__*/React.createElement(WForm$1, _objectSpread2({
|
7746
7758
|
ref: searchFormRef,
|
7747
7759
|
disabledRuler: true,
|
7748
|
-
// search={
|
7749
|
-
// search == false
|
7750
|
-
// ? {
|
7751
|
-
// hideSubmit: true,
|
7752
|
-
// }
|
7753
|
-
// : {
|
7754
|
-
// labelWidth: 'auto',
|
7755
|
-
// searchText: '查询',
|
7756
|
-
// span: 6,
|
7757
|
-
// ...search,
|
7758
|
-
// optionRender: (searchConfig, formProps, dom) => {
|
7759
|
-
// // return [...dom.reverse(), tableBarDom];
|
7760
|
-
// // return [...(search?.optionDomReverse ? dom.reverse() : dom), tableBarDom];
|
7761
|
-
// const newDom = [
|
7762
|
-
// <Button
|
7763
|
-
// key="submit"
|
7764
|
-
// type="primary"
|
7765
|
-
// className="mr20"
|
7766
|
-
// icon={<SearchOutlined />}
|
7767
|
-
// onClick={() => {
|
7768
|
-
// searchFormRef?.current?.handleSubmit();
|
7769
|
-
// }}
|
7770
|
-
// >
|
7771
|
-
// {search?.searchText || '查询'}
|
7772
|
-
// </Button>,
|
7773
|
-
// ...(search?.hideResetBtn ? [] : [<Button
|
7774
|
-
// key="reset"
|
7775
|
-
// type="primary"
|
7776
|
-
// className="mr20"
|
7777
|
-
// icon={<RedoOutlined />}
|
7778
|
-
// onClick={() => {
|
7779
|
-
// searchFormRef?.current?.handleRest();
|
7780
|
-
// }}
|
7781
|
-
// >
|
7782
|
-
// {search?.submitText || '重置'}
|
7783
|
-
//
|
7784
|
-
// </Button>]),
|
7785
|
-
// ];
|
7786
|
-
// return [
|
7787
|
-
// ...(search?.optionDomReverse ? newDom.reverse() : newDom),
|
7788
|
-
// tableBarDom,
|
7789
|
-
// ];
|
7790
|
-
// },
|
7791
|
-
// // optionRender: (searchConfig, formProps, dom) => {
|
7792
|
-
// // // return [...dom.reverse(), tableBarDom];
|
7793
|
-
// // return [
|
7794
|
-
// // ...(search?.optionDomReverse ? dom.reverse() : dom),
|
7795
|
-
// // tableBarDom,
|
7796
|
-
// // ];
|
7797
|
-
// // },
|
7798
|
-
// }
|
7799
|
-
// }
|
7800
7760
|
search: _objectSpread2(_objectSpread2({
|
7801
7761
|
labelWidth: 'auto',
|
7802
7762
|
searchText: '查询',
|
@@ -7814,7 +7774,7 @@ var TabelCard = function TabelCard(props, ref) {
|
|
7814
7774
|
return [].concat(_toConsumableArray(pre), [column]);
|
7815
7775
|
}
|
7816
7776
|
}, [])
|
7817
|
-
}, searchFormConfig || {})), columns && columns.length && /*#__PURE__*/React.createElement(ProTable, _objectSpread2(_objectSpread2({
|
7777
|
+
}, searchFormConfig || {})), searchTableSlot && searchTableSlot, columns && columns.length && /*#__PURE__*/React.createElement(ProTable, _objectSpread2(_objectSpread2({
|
7818
7778
|
actionRef: actionRef,
|
7819
7779
|
rowKey: "id",
|
7820
7780
|
bordered: !noBordered,
|
@@ -7822,27 +7782,27 @@ var TabelCard = function TabelCard(props, ref) {
|
|
7822
7782
|
toolBarRender: false
|
7823
7783
|
}, _request ? {
|
7824
7784
|
request: function () {
|
7825
|
-
var _request2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function
|
7826
|
-
return regeneratorRuntime.wrap(function
|
7785
|
+
var _request2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee10(params) {
|
7786
|
+
return regeneratorRuntime.wrap(function _callee10$(_context10) {
|
7827
7787
|
while (1) {
|
7828
|
-
switch (
|
7788
|
+
switch (_context10.prev = _context10.next) {
|
7829
7789
|
case 0:
|
7830
7790
|
tableRequestParmas.current = _objectSpread2(_objectSpread2({}, params), formSearchRef.current);
|
7831
|
-
|
7791
|
+
_context10.next = 3;
|
7832
7792
|
return _request(tableRequestParmas.current);
|
7833
7793
|
|
7834
7794
|
case 3:
|
7835
|
-
return
|
7795
|
+
return _context10.abrupt("return", _context10.sent);
|
7836
7796
|
|
7837
7797
|
case 4:
|
7838
7798
|
case "end":
|
7839
|
-
return
|
7799
|
+
return _context10.stop();
|
7840
7800
|
}
|
7841
7801
|
}
|
7842
|
-
},
|
7802
|
+
}, _callee10);
|
7843
7803
|
}));
|
7844
7804
|
|
7845
|
-
function request(
|
7805
|
+
function request(_x12) {
|
7846
7806
|
return _request2.apply(this, arguments);
|
7847
7807
|
}
|
7848
7808
|
|
package/dist/index.js
CHANGED
@@ -7022,7 +7022,7 @@ function DragBox(_ref) {
|
|
7022
7022
|
}, children)) : /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null);
|
7023
7023
|
}
|
7024
7024
|
|
7025
|
-
var _excluded$k = ["columns", "extraColumns", "search", "open", "setOpen", "modalFormOpend", "disabled", "submitMethod", "onSubmitSuccess", "title", "record", "onFormChange", "formItemChild", "onCancel", "
|
7025
|
+
var _excluded$k = ["columns", "extraColumns", "search", "open", "setOpen", "modalFormOpend", "disabled", "submitMethod", "onSubmitSuccess", "title", "record", "onFormChange", "formItemChild", "onCancel", "modalHeaderSlot", "modalFooterSlot", "formProps"];
|
7026
7026
|
|
7027
7027
|
var ModalForm = function ModalForm(props, ref) {
|
7028
7028
|
var columns = props.columns,
|
@@ -7039,8 +7039,8 @@ var ModalForm = function ModalForm(props, ref) {
|
|
7039
7039
|
onFormChange = props.onFormChange,
|
7040
7040
|
formItemChild = props.formItemChild,
|
7041
7041
|
onCancel = props.onCancel,
|
7042
|
-
|
7043
|
-
|
7042
|
+
modalHeaderSlot = props.modalHeaderSlot,
|
7043
|
+
modalFooterSlot = props.modalFooterSlot,
|
7044
7044
|
formProps = props.formProps,
|
7045
7045
|
extraProps = _objectWithoutProperties(props, _excluded$k);
|
7046
7046
|
|
@@ -7174,7 +7174,7 @@ var ModalForm = function ModalForm(props, ref) {
|
|
7174
7174
|
onOk: handleOk,
|
7175
7175
|
confirmLoading: confirmLoading,
|
7176
7176
|
onCancel: handleCancel
|
7177
|
-
}, extraProps),
|
7177
|
+
}, extraProps), modalHeaderSlot, /*#__PURE__*/React__default['default'].createElement(WForm$1, _objectSpread2({
|
7178
7178
|
ref: formRef,
|
7179
7179
|
disabled: disabled,
|
7180
7180
|
onSubmit: onSubmit,
|
@@ -7185,12 +7185,12 @@ var ModalForm = function ModalForm(props, ref) {
|
|
7185
7185
|
columns: columns,
|
7186
7186
|
disabledRuler: disabled,
|
7187
7187
|
extraColumns: extraColumns
|
7188
|
-
}, formProps || {})), title == '查看' && formItemChild ? formItemChild() : null,
|
7188
|
+
}, formProps || {})), title == '查看' && formItemChild ? formItemChild() : null, modalFooterSlot);
|
7189
7189
|
};
|
7190
7190
|
|
7191
7191
|
var ModalForm$1 = /*#__PURE__*/React__default['default'].forwardRef(ModalForm);
|
7192
7192
|
|
7193
|
-
var _excluded$l = ["columns", "extraColumns", "request", "modalFormSearch", "search", "tableAction", "fliterAction", "renderTableBar", "renderTableBarDeps", "className", "style", "onFormChange", "modalConfig", "searchFormConfig", "optionColumnConfig", "pagination", "noBordered", "showIndex"];
|
7193
|
+
var _excluded$l = ["columns", "extraColumns", "request", "modalFormSearch", "search", "tableAction", "fliterAction", "renderTableBar", "renderTableBarDeps", "className", "style", "onFormChange", "modalConfig", "searchFormConfig", "optionColumnConfig", "pagination", "noBordered", "showIndex", "searchTableSlot"];
|
7194
7194
|
|
7195
7195
|
var TabelCard = function TabelCard(props, ref) {
|
7196
7196
|
var columns = props.columns,
|
@@ -7211,6 +7211,7 @@ var TabelCard = function TabelCard(props, ref) {
|
|
7211
7211
|
pagination = props.pagination,
|
7212
7212
|
noBordered = props.noBordered,
|
7213
7213
|
showIndex = props.showIndex,
|
7214
|
+
searchTableSlot = props.searchTableSlot,
|
7214
7215
|
extraProps = _objectWithoutProperties(props, _excluded$l);
|
7215
7216
|
|
7216
7217
|
var actionRef = React.useRef();
|
@@ -7358,10 +7359,8 @@ var TabelCard = function TabelCard(props, ref) {
|
|
7358
7359
|
}()
|
7359
7360
|
});
|
7360
7361
|
},
|
7361
|
-
|
7362
|
-
var
|
7363
|
-
|
7364
|
-
return (_item$actionRender = item.actionRender) === null || _item$actionRender === void 0 ? void 0 : _item$actionRender.call(item, record, actionRef, /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee4() {
|
7362
|
+
custom: function () {
|
7363
|
+
var _custom = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee4(item, record, index) {
|
7365
7364
|
return regeneratorRuntime.wrap(function _callee4$(_context4) {
|
7366
7365
|
while (1) {
|
7367
7366
|
switch (_context4.prev = _context4.next) {
|
@@ -7376,7 +7375,7 @@ var TabelCard = function TabelCard(props, ref) {
|
|
7376
7375
|
var _actionRef$current3;
|
7377
7376
|
|
7378
7377
|
actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$current3 = actionRef.current) === null || _actionRef$current3 === void 0 ? void 0 : _actionRef$current3.reload();
|
7379
|
-
});
|
7378
|
+
}, record);
|
7380
7379
|
|
7381
7380
|
case 3:
|
7382
7381
|
case "end":
|
@@ -7384,6 +7383,40 @@ var TabelCard = function TabelCard(props, ref) {
|
|
7384
7383
|
}
|
7385
7384
|
}
|
7386
7385
|
}, _callee4);
|
7386
|
+
}));
|
7387
|
+
|
7388
|
+
function custom(_x3, _x4, _x5) {
|
7389
|
+
return _custom.apply(this, arguments);
|
7390
|
+
}
|
7391
|
+
|
7392
|
+
return custom;
|
7393
|
+
}(),
|
7394
|
+
extraAction: function extraAction(item, record, index) {
|
7395
|
+
var _item$actionRender;
|
7396
|
+
|
7397
|
+
return (_item$actionRender = item.actionRender) === null || _item$actionRender === void 0 ? void 0 : _item$actionRender.call(item, record, actionRef, /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5() {
|
7398
|
+
return regeneratorRuntime.wrap(function _callee5$(_context5) {
|
7399
|
+
while (1) {
|
7400
|
+
switch (_context5.prev = _context5.next) {
|
7401
|
+
case 0:
|
7402
|
+
if (!item.actionMethod) {
|
7403
|
+
_context5.next = 3;
|
7404
|
+
break;
|
7405
|
+
}
|
7406
|
+
|
7407
|
+
_context5.next = 3;
|
7408
|
+
return item.actionMethod(record, function () {
|
7409
|
+
var _actionRef$current4;
|
7410
|
+
|
7411
|
+
actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$current4 = actionRef.current) === null || _actionRef$current4 === void 0 ? void 0 : _actionRef$current4.reload();
|
7412
|
+
});
|
7413
|
+
|
7414
|
+
case 3:
|
7415
|
+
case "end":
|
7416
|
+
return _context5.stop();
|
7417
|
+
}
|
7418
|
+
}
|
7419
|
+
}, _callee5);
|
7387
7420
|
})), index);
|
7388
7421
|
}
|
7389
7422
|
};
|
@@ -7402,7 +7435,9 @@ var TabelCard = function TabelCard(props, ref) {
|
|
7402
7435
|
title: '删除',
|
7403
7436
|
key: 'delete',
|
7404
7437
|
icon: /*#__PURE__*/React__default['default'].createElement(icons.DeleteOutlined, null)
|
7405
|
-
}
|
7438
|
+
},
|
7439
|
+
custom: {} // TODO: 遍历的时候赋值
|
7440
|
+
|
7406
7441
|
};
|
7407
7442
|
|
7408
7443
|
var tableActionDom = function tableActionDom(record, index) {
|
@@ -7413,42 +7448,19 @@ var TabelCard = function TabelCard(props, ref) {
|
|
7413
7448
|
|
7414
7449
|
if (tableAction && showMoreNum > 0 && showMoreNum < tableActionList.length) {
|
7415
7450
|
var tableAction1 = tableActionList === null || tableActionList === void 0 ? void 0 : tableActionList.slice(0, showMoreNum);
|
7416
|
-
var tableAction2 = tableActionList === null || tableActionList === void 0 ? void 0 : tableActionList.slice(showMoreNum);
|
7417
|
-
// <Menu>
|
7418
|
-
// {tableAction2.map((item: any, i: number) => {
|
7419
|
-
// let btn = actionConfig[item.type];
|
7420
|
-
// if (btn) {
|
7421
|
-
// return (
|
7422
|
-
// <Menu.Item key={i}>
|
7423
|
-
// <a
|
7424
|
-
// key={btn.key}
|
7425
|
-
// onClick={async e => {
|
7426
|
-
// e.stopPropagation();
|
7427
|
-
// let info = null;
|
7428
|
-
// if (item.fetchInfo) {
|
7429
|
-
// info = await item.fetchInfo(record);
|
7430
|
-
// }
|
7431
|
-
// actionHandler[item.type]?.(item, info || record, index);
|
7432
|
-
// }}
|
7433
|
-
// >
|
7434
|
-
// {btn.icon} {btn.title}
|
7435
|
-
// </a>
|
7436
|
-
// </Menu.Item>
|
7437
|
-
// );
|
7438
|
-
// }
|
7439
|
-
// return (
|
7440
|
-
// <Menu.Item key={i}>
|
7441
|
-
// {actionHandler[item.type]?.(item, record, index)}
|
7442
|
-
// </Menu.Item>
|
7443
|
-
// );
|
7444
|
-
// })}
|
7445
|
-
// </Menu>
|
7446
|
-
// );
|
7447
|
-
|
7451
|
+
var tableAction2 = tableActionList === null || tableActionList === void 0 ? void 0 : tableActionList.slice(showMoreNum);
|
7448
7452
|
var menu = {
|
7449
7453
|
items: tableAction2.map(function (item, i) {
|
7450
7454
|
var _actionHandler$item$t2;
|
7451
7455
|
|
7456
|
+
if (item.type == 'custom') {
|
7457
|
+
actionConfig[item.type] = {
|
7458
|
+
title: item.title,
|
7459
|
+
key: item.key,
|
7460
|
+
icon: item.icon
|
7461
|
+
};
|
7462
|
+
}
|
7463
|
+
|
7452
7464
|
var btn = actionConfig[item.type];
|
7453
7465
|
|
7454
7466
|
if (btn) {
|
@@ -7457,40 +7469,40 @@ var TabelCard = function TabelCard(props, ref) {
|
|
7457
7469
|
label: /*#__PURE__*/React__default['default'].createElement("a", {
|
7458
7470
|
key: btn.key,
|
7459
7471
|
onClick: function () {
|
7460
|
-
var _onClick = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function
|
7472
|
+
var _onClick = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee6(e) {
|
7461
7473
|
var _actionHandler$item$t;
|
7462
7474
|
|
7463
7475
|
var info;
|
7464
|
-
return regeneratorRuntime.wrap(function
|
7476
|
+
return regeneratorRuntime.wrap(function _callee6$(_context6) {
|
7465
7477
|
while (1) {
|
7466
|
-
switch (
|
7478
|
+
switch (_context6.prev = _context6.next) {
|
7467
7479
|
case 0:
|
7468
7480
|
e.stopPropagation();
|
7469
7481
|
info = null;
|
7470
7482
|
|
7471
7483
|
if (!item.fetchInfo) {
|
7472
|
-
|
7484
|
+
_context6.next = 6;
|
7473
7485
|
break;
|
7474
7486
|
}
|
7475
7487
|
|
7476
|
-
|
7488
|
+
_context6.next = 5;
|
7477
7489
|
return item.fetchInfo(record);
|
7478
7490
|
|
7479
7491
|
case 5:
|
7480
|
-
info =
|
7492
|
+
info = _context6.sent;
|
7481
7493
|
|
7482
7494
|
case 6:
|
7483
7495
|
(_actionHandler$item$t = actionHandler[item.type]) === null || _actionHandler$item$t === void 0 ? void 0 : _actionHandler$item$t.call(actionHandler, item, info || record, index);
|
7484
7496
|
|
7485
7497
|
case 7:
|
7486
7498
|
case "end":
|
7487
|
-
return
|
7499
|
+
return _context6.stop();
|
7488
7500
|
}
|
7489
7501
|
}
|
7490
|
-
},
|
7502
|
+
}, _callee6);
|
7491
7503
|
}));
|
7492
7504
|
|
7493
|
-
function onClick(
|
7505
|
+
function onClick(_x6) {
|
7494
7506
|
return _onClick.apply(this, arguments);
|
7495
7507
|
}
|
7496
7508
|
|
@@ -7518,40 +7530,40 @@ var TabelCard = function TabelCard(props, ref) {
|
|
7518
7530
|
}, /*#__PURE__*/React__default['default'].createElement("a", {
|
7519
7531
|
key: btn.key,
|
7520
7532
|
onClick: function () {
|
7521
|
-
var _onClick2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function
|
7533
|
+
var _onClick2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee7(e) {
|
7522
7534
|
var _actionHandler$item$t3;
|
7523
7535
|
|
7524
7536
|
var info;
|
7525
|
-
return regeneratorRuntime.wrap(function
|
7537
|
+
return regeneratorRuntime.wrap(function _callee7$(_context7) {
|
7526
7538
|
while (1) {
|
7527
|
-
switch (
|
7539
|
+
switch (_context7.prev = _context7.next) {
|
7528
7540
|
case 0:
|
7529
7541
|
e.stopPropagation();
|
7530
7542
|
info = null;
|
7531
7543
|
|
7532
7544
|
if (!item.fetchInfo) {
|
7533
|
-
|
7545
|
+
_context7.next = 6;
|
7534
7546
|
break;
|
7535
7547
|
}
|
7536
7548
|
|
7537
|
-
|
7549
|
+
_context7.next = 5;
|
7538
7550
|
return item.fetchInfo(record);
|
7539
7551
|
|
7540
7552
|
case 5:
|
7541
|
-
info =
|
7553
|
+
info = _context7.sent;
|
7542
7554
|
|
7543
7555
|
case 6:
|
7544
7556
|
(_actionHandler$item$t3 = actionHandler[item.type]) === null || _actionHandler$item$t3 === void 0 ? void 0 : _actionHandler$item$t3.call(actionHandler, item, info || record, index);
|
7545
7557
|
|
7546
7558
|
case 7:
|
7547
7559
|
case "end":
|
7548
|
-
return
|
7560
|
+
return _context7.stop();
|
7549
7561
|
}
|
7550
7562
|
}
|
7551
|
-
},
|
7563
|
+
}, _callee7);
|
7552
7564
|
}));
|
7553
7565
|
|
7554
|
-
function onClick(
|
7566
|
+
function onClick(_x7) {
|
7555
7567
|
return _onClick2.apply(this, arguments);
|
7556
7568
|
}
|
7557
7569
|
|
@@ -7605,33 +7617,33 @@ var TabelCard = function TabelCard(props, ref) {
|
|
7605
7617
|
type: '新增',
|
7606
7618
|
record: {},
|
7607
7619
|
modalOnOk: function () {
|
7608
|
-
var _modalOnOk3 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function
|
7609
|
-
return regeneratorRuntime.wrap(function
|
7620
|
+
var _modalOnOk3 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee8(values, loading) {
|
7621
|
+
return regeneratorRuntime.wrap(function _callee8$(_context8) {
|
7610
7622
|
while (1) {
|
7611
|
-
switch (
|
7623
|
+
switch (_context8.prev = _context8.next) {
|
7612
7624
|
case 0:
|
7613
7625
|
if (!item.actionMethod) {
|
7614
|
-
|
7626
|
+
_context8.next = 3;
|
7615
7627
|
break;
|
7616
7628
|
}
|
7617
7629
|
|
7618
|
-
|
7630
|
+
_context8.next = 3;
|
7619
7631
|
return item.actionMethod(values, function () {
|
7620
|
-
var _actionRef$
|
7632
|
+
var _actionRef$current5;
|
7621
7633
|
|
7622
7634
|
loading();
|
7623
|
-
actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$
|
7635
|
+
actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$current5 = actionRef.current) === null || _actionRef$current5 === void 0 ? void 0 : _actionRef$current5.reload();
|
7624
7636
|
});
|
7625
7637
|
|
7626
7638
|
case 3:
|
7627
7639
|
case "end":
|
7628
|
-
return
|
7640
|
+
return _context8.stop();
|
7629
7641
|
}
|
7630
7642
|
}
|
7631
|
-
},
|
7643
|
+
}, _callee8);
|
7632
7644
|
}));
|
7633
7645
|
|
7634
|
-
function modalOnOk(
|
7646
|
+
function modalOnOk(_x8, _x9) {
|
7635
7647
|
return _modalOnOk3.apply(this, arguments);
|
7636
7648
|
}
|
7637
7649
|
|
@@ -7661,9 +7673,9 @@ var TabelCard = function TabelCard(props, ref) {
|
|
7661
7673
|
children: (_item$actionRender2 = item.actionRender) === null || _item$actionRender2 === void 0 ? void 0 : _item$actionRender2.call(item, actionRef, function () {
|
7662
7674
|
searchFormRef.current;
|
7663
7675
|
item.actionMethod && item.actionMethod(tableRequestParmas.current, function () {
|
7664
|
-
var _actionRef$
|
7676
|
+
var _actionRef$current6;
|
7665
7677
|
|
7666
|
-
return actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$
|
7678
|
+
return actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$current6 = actionRef.current) === null || _actionRef$current6 === void 0 ? void 0 : _actionRef$current6.reload();
|
7667
7679
|
});
|
7668
7680
|
})
|
7669
7681
|
};
|
@@ -7672,29 +7684,29 @@ var TabelCard = function TabelCard(props, ref) {
|
|
7672
7684
|
}, [actionRef, renderTableBarDeps]);
|
7673
7685
|
|
7674
7686
|
var onSubmit = function onSubmit(values) {
|
7675
|
-
var _actionRef$
|
7687
|
+
var _actionRef$current7;
|
7676
7688
|
|
7677
7689
|
(searchFormConfig === null || searchFormConfig === void 0 ? void 0 : searchFormConfig.handleSubmit) && searchFormConfig.handleSubmit(values);
|
7678
7690
|
formSearchRef.current = values;
|
7679
|
-
actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$
|
7691
|
+
actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$current7 = actionRef.current) === null || _actionRef$current7 === void 0 ? void 0 : _actionRef$current7.reload(true);
|
7680
7692
|
};
|
7681
7693
|
|
7682
7694
|
var onKeyUpSubmit = function onKeyUpSubmit(values) {
|
7683
7695
|
if (values.keyCode === 13) {
|
7684
|
-
var _searchFormRef$curren, _searchFormRef$curren2, _actionRef$
|
7696
|
+
var _searchFormRef$curren, _searchFormRef$curren2, _actionRef$current8;
|
7685
7697
|
|
7686
7698
|
(searchFormConfig === null || searchFormConfig === void 0 ? void 0 : searchFormConfig.handleSubmit) && searchFormConfig.handleSubmit((_searchFormRef$curren = searchFormRef.current) === null || _searchFormRef$curren === void 0 ? void 0 : _searchFormRef$curren.getFormValues());
|
7687
7699
|
formSearchRef.current = (_searchFormRef$curren2 = searchFormRef.current) === null || _searchFormRef$curren2 === void 0 ? void 0 : _searchFormRef$curren2.getFormValues();
|
7688
|
-
actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$
|
7700
|
+
actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$current8 = actionRef.current) === null || _actionRef$current8 === void 0 ? void 0 : _actionRef$current8.reload(true);
|
7689
7701
|
}
|
7690
7702
|
};
|
7691
7703
|
|
7692
7704
|
var onReset = function onReset(values) {
|
7693
|
-
var _actionRef$
|
7705
|
+
var _actionRef$current9;
|
7694
7706
|
|
7695
7707
|
(searchFormConfig === null || searchFormConfig === void 0 ? void 0 : searchFormConfig.onReset) && searchFormConfig.onReset();
|
7696
7708
|
formSearchRef.current = _objectSpread2({}, values);
|
7697
|
-
actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$
|
7709
|
+
actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$current9 = actionRef.current) === null || _actionRef$current9 === void 0 ? void 0 : _actionRef$current9.reload(true);
|
7698
7710
|
};
|
7699
7711
|
|
7700
7712
|
React.useEffect(function () {
|
@@ -7722,28 +7734,28 @@ var TabelCard = function TabelCard(props, ref) {
|
|
7722
7734
|
disabled: modalFormConfig.type == '查看',
|
7723
7735
|
setOpen: setOpen,
|
7724
7736
|
submitMethod: function () {
|
7725
|
-
var _submitMethod = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function
|
7726
|
-
return regeneratorRuntime.wrap(function
|
7737
|
+
var _submitMethod = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee9(values, loading) {
|
7738
|
+
return regeneratorRuntime.wrap(function _callee9$(_context9) {
|
7727
7739
|
while (1) {
|
7728
|
-
switch (
|
7740
|
+
switch (_context9.prev = _context9.next) {
|
7729
7741
|
case 0:
|
7730
7742
|
if (!modalFormConfig.modalOnOk) {
|
7731
|
-
|
7743
|
+
_context9.next = 3;
|
7732
7744
|
break;
|
7733
7745
|
}
|
7734
7746
|
|
7735
|
-
|
7747
|
+
_context9.next = 3;
|
7736
7748
|
return modalFormConfig.modalOnOk(values, loading);
|
7737
7749
|
|
7738
7750
|
case 3:
|
7739
7751
|
case "end":
|
7740
|
-
return
|
7752
|
+
return _context9.stop();
|
7741
7753
|
}
|
7742
7754
|
}
|
7743
|
-
},
|
7755
|
+
}, _callee9);
|
7744
7756
|
}));
|
7745
7757
|
|
7746
|
-
function submitMethod(
|
7758
|
+
function submitMethod(_x10, _x11) {
|
7747
7759
|
return _submitMethod.apply(this, arguments);
|
7748
7760
|
}
|
7749
7761
|
|
@@ -7789,58 +7801,6 @@ var TabelCard = function TabelCard(props, ref) {
|
|
7789
7801
|
})), search !== false && /*#__PURE__*/React__default['default'].createElement(WForm$1, _objectSpread2({
|
7790
7802
|
ref: searchFormRef,
|
7791
7803
|
disabledRuler: true,
|
7792
|
-
// search={
|
7793
|
-
// search == false
|
7794
|
-
// ? {
|
7795
|
-
// hideSubmit: true,
|
7796
|
-
// }
|
7797
|
-
// : {
|
7798
|
-
// labelWidth: 'auto',
|
7799
|
-
// searchText: '查询',
|
7800
|
-
// span: 6,
|
7801
|
-
// ...search,
|
7802
|
-
// optionRender: (searchConfig, formProps, dom) => {
|
7803
|
-
// // return [...dom.reverse(), tableBarDom];
|
7804
|
-
// // return [...(search?.optionDomReverse ? dom.reverse() : dom), tableBarDom];
|
7805
|
-
// const newDom = [
|
7806
|
-
// <Button
|
7807
|
-
// key="submit"
|
7808
|
-
// type="primary"
|
7809
|
-
// className="mr20"
|
7810
|
-
// icon={<SearchOutlined />}
|
7811
|
-
// onClick={() => {
|
7812
|
-
// searchFormRef?.current?.handleSubmit();
|
7813
|
-
// }}
|
7814
|
-
// >
|
7815
|
-
// {search?.searchText || '查询'}
|
7816
|
-
// </Button>,
|
7817
|
-
// ...(search?.hideResetBtn ? [] : [<Button
|
7818
|
-
// key="reset"
|
7819
|
-
// type="primary"
|
7820
|
-
// className="mr20"
|
7821
|
-
// icon={<RedoOutlined />}
|
7822
|
-
// onClick={() => {
|
7823
|
-
// searchFormRef?.current?.handleRest();
|
7824
|
-
// }}
|
7825
|
-
// >
|
7826
|
-
// {search?.submitText || '重置'}
|
7827
|
-
//
|
7828
|
-
// </Button>]),
|
7829
|
-
// ];
|
7830
|
-
// return [
|
7831
|
-
// ...(search?.optionDomReverse ? newDom.reverse() : newDom),
|
7832
|
-
// tableBarDom,
|
7833
|
-
// ];
|
7834
|
-
// },
|
7835
|
-
// // optionRender: (searchConfig, formProps, dom) => {
|
7836
|
-
// // // return [...dom.reverse(), tableBarDom];
|
7837
|
-
// // return [
|
7838
|
-
// // ...(search?.optionDomReverse ? dom.reverse() : dom),
|
7839
|
-
// // tableBarDom,
|
7840
|
-
// // ];
|
7841
|
-
// // },
|
7842
|
-
// }
|
7843
|
-
// }
|
7844
7804
|
search: _objectSpread2(_objectSpread2({
|
7845
7805
|
labelWidth: 'auto',
|
7846
7806
|
searchText: '查询',
|
@@ -7858,7 +7818,7 @@ var TabelCard = function TabelCard(props, ref) {
|
|
7858
7818
|
return [].concat(_toConsumableArray(pre), [column]);
|
7859
7819
|
}
|
7860
7820
|
}, [])
|
7861
|
-
}, searchFormConfig || {})), columns && columns.length && /*#__PURE__*/React__default['default'].createElement(ProTable__default['default'], _objectSpread2(_objectSpread2({
|
7821
|
+
}, searchFormConfig || {})), searchTableSlot && searchTableSlot, columns && columns.length && /*#__PURE__*/React__default['default'].createElement(ProTable__default['default'], _objectSpread2(_objectSpread2({
|
7862
7822
|
actionRef: actionRef,
|
7863
7823
|
rowKey: "id",
|
7864
7824
|
bordered: !noBordered,
|
@@ -7866,27 +7826,27 @@ var TabelCard = function TabelCard(props, ref) {
|
|
7866
7826
|
toolBarRender: false
|
7867
7827
|
}, _request ? {
|
7868
7828
|
request: function () {
|
7869
|
-
var _request2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function
|
7870
|
-
return regeneratorRuntime.wrap(function
|
7829
|
+
var _request2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee10(params) {
|
7830
|
+
return regeneratorRuntime.wrap(function _callee10$(_context10) {
|
7871
7831
|
while (1) {
|
7872
|
-
switch (
|
7832
|
+
switch (_context10.prev = _context10.next) {
|
7873
7833
|
case 0:
|
7874
7834
|
tableRequestParmas.current = _objectSpread2(_objectSpread2({}, params), formSearchRef.current);
|
7875
|
-
|
7835
|
+
_context10.next = 3;
|
7876
7836
|
return _request(tableRequestParmas.current);
|
7877
7837
|
|
7878
7838
|
case 3:
|
7879
|
-
return
|
7839
|
+
return _context10.abrupt("return", _context10.sent);
|
7880
7840
|
|
7881
7841
|
case 4:
|
7882
7842
|
case "end":
|
7883
|
-
return
|
7843
|
+
return _context10.stop();
|
7884
7844
|
}
|
7885
7845
|
}
|
7886
|
-
},
|
7846
|
+
}, _callee10);
|
7887
7847
|
}));
|
7888
7848
|
|
7889
|
-
function request(
|
7849
|
+
function request(_x12) {
|
7890
7850
|
return _request2.apply(this, arguments);
|
7891
7851
|
}
|
7892
7852
|
|