wargerm 0.3.15 → 0.3.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.
- package/dist/index.esm.js +102 -96
- package/dist/index.js +100 -94
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
@@ -5,7 +5,7 @@ import _Dropdown from 'antd/es/dropdown';
|
|
5
5
|
import 'antd/es/menu/style';
|
6
6
|
import _Menu from 'antd/es/menu';
|
7
7
|
import React, { useState, useEffect, useMemo, useImperativeHandle, useRef } from 'react';
|
8
|
-
import { createFromIconfontCN, SearchOutlined, ReloadOutlined, CloseCircleOutlined, PlusOutlined,
|
8
|
+
import { createFromIconfontCN, SearchOutlined, ReloadOutlined, CloseCircleOutlined, PlusOutlined, EllipsisOutlined, ExclamationCircleOutlined, EyeOutlined, EditOutlined, DeleteOutlined } from '@ant-design/icons';
|
9
9
|
import 'antd/es/input/style';
|
10
10
|
import _Input from 'antd/es/input';
|
11
11
|
import 'antd/es/input-number/style';
|
@@ -46,7 +46,7 @@ import _Breadcrumb from 'antd/es/breadcrumb';
|
|
46
46
|
import ReactDOM from 'react-dom';
|
47
47
|
import 'antd/es/modal/style';
|
48
48
|
import _Modal from 'antd/es/modal';
|
49
|
-
import ProTable
|
49
|
+
import ProTable from '@ant-design/pro-table';
|
50
50
|
|
51
51
|
function ownKeys(object, enumerableOnly) {
|
52
52
|
var keys = Object.keys(object);
|
@@ -729,7 +729,12 @@ var WSelect = function WSelect(props) {
|
|
729
729
|
onLoad && onLoad(options);
|
730
730
|
setValueEnumList(valueEnumNode);
|
731
731
|
}, [JSON.stringify(resList), JSON.stringify(request), JSON.stringify(params || {})]);
|
732
|
-
return /*#__PURE__*/React.createElement(_Select, _objectSpread2({
|
732
|
+
return /*#__PURE__*/React.createElement(_Select, _objectSpread2({
|
733
|
+
showSearch: true,
|
734
|
+
filterOption: function filterOption(input, option) {
|
735
|
+
return option.children.toLowerCase().indexOf(input.toLowerCase()) >= 0;
|
736
|
+
}
|
737
|
+
}, extraProps), request ? childrenNode : valueEnum ? valueEnumList : children);
|
733
738
|
};
|
734
739
|
|
735
740
|
WSelect.defaultProps = {};
|
@@ -6622,6 +6627,8 @@ var TreeSelect = function TreeSelect(_ref) {
|
|
6622
6627
|
}))();
|
6623
6628
|
}, []);
|
6624
6629
|
return /*#__PURE__*/React.createElement(_TreeSelect, _objectSpread2({
|
6630
|
+
showSearch: true,
|
6631
|
+
treeNodeFilterProp: "title",
|
6625
6632
|
treeDefaultExpandAll: true
|
6626
6633
|
}, props), !props.children ? renderTree(treeData) : props.children);
|
6627
6634
|
};
|
@@ -10032,7 +10039,7 @@ var ModalForm = function ModalForm(props, ref) {
|
|
10032
10039
|
|
10033
10040
|
useImperativeHandle(ref, function () {
|
10034
10041
|
return {
|
10035
|
-
formRef: formRef,
|
10042
|
+
formRef: formRef.current,
|
10036
10043
|
onSubmit: onSubmit
|
10037
10044
|
};
|
10038
10045
|
});
|
@@ -10128,8 +10135,7 @@ var ModalForm = function ModalForm(props, ref) {
|
|
10128
10135
|
|
10129
10136
|
var ModalForm$1 = /*#__PURE__*/React.forwardRef(ModalForm);
|
10130
10137
|
|
10131
|
-
var _excluded$h = ["columns", "extraColumns", "request", "modalFormSearch", "search", "tableAction", "renderTableBar", "className", "style", "onFormChange", "modalConfig", "optionColumnConfig", "pagination"]
|
10132
|
-
_excluded2$3 = ["actionMethod"];
|
10138
|
+
var _excluded$h = ["columns", "extraColumns", "request", "modalFormSearch", "search", "tableAction", "renderTableBar", "className", "style", "onFormChange", "modalConfig", "optionColumnConfig", "pagination"];
|
10133
10139
|
|
10134
10140
|
var TabelCard = function TabelCard(props, ref) {
|
10135
10141
|
var columns = props.columns,
|
@@ -10148,7 +10154,8 @@ var TabelCard = function TabelCard(props, ref) {
|
|
10148
10154
|
extraProps = _objectWithoutProperties(props, _excluded$h);
|
10149
10155
|
|
10150
10156
|
var actionRef = useRef();
|
10151
|
-
var
|
10157
|
+
var modalFormRef = useRef(null);
|
10158
|
+
var searchFormRef = useRef(null);
|
10152
10159
|
|
10153
10160
|
var _useState = useState(false),
|
10154
10161
|
_useState2 = _slicedToArray(_useState, 2),
|
@@ -10168,7 +10175,8 @@ var TabelCard = function TabelCard(props, ref) {
|
|
10168
10175
|
useImperativeHandle(ref, function () {
|
10169
10176
|
return {
|
10170
10177
|
actionRef: actionRef.current,
|
10171
|
-
|
10178
|
+
modalFormRef: modalFormRef.current,
|
10179
|
+
searchFormRef: searchFormRef.current
|
10172
10180
|
};
|
10173
10181
|
});
|
10174
10182
|
|
@@ -10312,67 +10320,6 @@ var TabelCard = function TabelCard(props, ref) {
|
|
10312
10320
|
}
|
10313
10321
|
}, _callee4);
|
10314
10322
|
})), index);
|
10315
|
-
},
|
10316
|
-
more: function more(item, record, index) {
|
10317
|
-
var menus = !item.subMenus ? [] : item.subMenus.map(function (b) {
|
10318
|
-
var btn = actionConfig[b.key];
|
10319
|
-
|
10320
|
-
if (btn) {
|
10321
|
-
b.name = btn.title;
|
10322
|
-
b.icon = btn.icon;
|
10323
|
-
}
|
10324
|
-
|
10325
|
-
return b;
|
10326
|
-
});
|
10327
|
-
|
10328
|
-
var selectHandler = function selectHandler(key, item, record, index) {
|
10329
|
-
var _item$actionMethod;
|
10330
|
-
|
10331
|
-
if (key == 'more') {
|
10332
|
-
// No more recursion
|
10333
|
-
return;
|
10334
|
-
}
|
10335
|
-
|
10336
|
-
var customMenu = menus.find(function (m) {
|
10337
|
-
return m.key === key;
|
10338
|
-
});
|
10339
|
-
|
10340
|
-
var _item = _objectSpread2(_objectSpread2({}, customMenu), {}, {
|
10341
|
-
type: key
|
10342
|
-
});
|
10343
|
-
|
10344
|
-
var handler = actionHandler[key];
|
10345
|
-
|
10346
|
-
if (handler) {
|
10347
|
-
return handler(_item, record, index);
|
10348
|
-
}
|
10349
|
-
|
10350
|
-
return (_item$actionMethod = _item.actionMethod) === null || _item$actionMethod === void 0 ? void 0 : _item$actionMethod.call(_item, record, function () {
|
10351
|
-
var _actionRef$current4;
|
10352
|
-
|
10353
|
-
actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$current4 = actionRef.current) === null || _actionRef$current4 === void 0 ? void 0 : _actionRef$current4.reload();
|
10354
|
-
});
|
10355
|
-
};
|
10356
|
-
|
10357
|
-
var m = _toConsumableArray(menus).map(function (e) {
|
10358
|
-
if (!('actionMethod' in e)) {
|
10359
|
-
return e;
|
10360
|
-
}
|
10361
|
-
|
10362
|
-
var actionMethod = e.actionMethod,
|
10363
|
-
b = _objectWithoutProperties(e, _excluded2$3);
|
10364
|
-
|
10365
|
-
return _objectSpread2({}, b);
|
10366
|
-
});
|
10367
|
-
|
10368
|
-
return /*#__PURE__*/React.createElement(TableDropdown, {
|
10369
|
-
key: "actionGroup",
|
10370
|
-
children: /*#__PURE__*/React.createElement(MoreOutlined, null),
|
10371
|
-
menus: m,
|
10372
|
-
onSelect: function onSelect(key) {
|
10373
|
-
return selectHandler(key, item, record, index);
|
10374
|
-
}
|
10375
|
-
});
|
10376
10323
|
}
|
10377
10324
|
};
|
10378
10325
|
var actionConfig = {
|
@@ -10394,27 +10341,86 @@ var TabelCard = function TabelCard(props, ref) {
|
|
10394
10341
|
};
|
10395
10342
|
|
10396
10343
|
var tableActionDom = function tableActionDom(record, index) {
|
10397
|
-
|
10398
|
-
var _actionHandler$item$t2;
|
10344
|
+
var showMoreNum = (optionColumnConfig === null || optionColumnConfig === void 0 ? void 0 : optionColumnConfig.showMoreNum) || 0;
|
10399
10345
|
|
10400
|
-
|
10346
|
+
if (tableAction && showMoreNum > 0 && showMoreNum < tableAction.length) {
|
10347
|
+
var tableAction1 = tableAction.slice(0, showMoreNum);
|
10348
|
+
var tableAction2 = tableAction.slice(showMoreNum);
|
10349
|
+
var menu = /*#__PURE__*/React.createElement(_Menu, null, tableAction2.map(function (item, i) {
|
10350
|
+
var _actionHandler$item$t2;
|
10401
10351
|
|
10402
|
-
|
10403
|
-
return /*#__PURE__*/React.createElement(_Tooltip, {
|
10404
|
-
title: btn.title,
|
10405
|
-
key: btn.key
|
10406
|
-
}, /*#__PURE__*/React.createElement("a", {
|
10407
|
-
key: btn.key,
|
10408
|
-
onClick: function onClick() {
|
10409
|
-
var _actionHandler$item$t;
|
10352
|
+
var btn = actionConfig[item.type];
|
10410
10353
|
|
10411
|
-
|
10412
|
-
|
10413
|
-
|
10414
|
-
|
10354
|
+
if (btn) {
|
10355
|
+
return /*#__PURE__*/React.createElement(_Menu.Item, {
|
10356
|
+
key: i
|
10357
|
+
}, /*#__PURE__*/React.createElement("a", {
|
10358
|
+
key: btn.key,
|
10359
|
+
onClick: function onClick() {
|
10360
|
+
var _actionHandler$item$t;
|
10361
|
+
|
10362
|
+
return (_actionHandler$item$t = actionHandler[item.type]) === null || _actionHandler$item$t === void 0 ? void 0 : _actionHandler$item$t.call(actionHandler, item, record, index);
|
10363
|
+
}
|
10364
|
+
}, btn.icon, " ", btn.title));
|
10365
|
+
}
|
10415
10366
|
|
10416
|
-
|
10417
|
-
|
10367
|
+
return /*#__PURE__*/React.createElement(_Menu.Item, {
|
10368
|
+
key: i
|
10369
|
+
}, (_actionHandler$item$t2 = actionHandler[item.type]) === null || _actionHandler$item$t2 === void 0 ? void 0 : _actionHandler$item$t2.call(actionHandler, item, record, index));
|
10370
|
+
}));
|
10371
|
+
return [].concat(_toConsumableArray(tableAction1.map(function (item, i) {
|
10372
|
+
var _actionHandler$item$t4;
|
10373
|
+
|
10374
|
+
var btn = actionConfig[item.type];
|
10375
|
+
|
10376
|
+
if (btn) {
|
10377
|
+
return /*#__PURE__*/React.createElement(_Tooltip, {
|
10378
|
+
title: btn.title,
|
10379
|
+
key: i
|
10380
|
+
}, /*#__PURE__*/React.createElement("a", {
|
10381
|
+
key: btn.key,
|
10382
|
+
onClick: function onClick() {
|
10383
|
+
var _actionHandler$item$t3;
|
10384
|
+
|
10385
|
+
return (_actionHandler$item$t3 = actionHandler[item.type]) === null || _actionHandler$item$t3 === void 0 ? void 0 : _actionHandler$item$t3.call(actionHandler, item, record, index);
|
10386
|
+
}
|
10387
|
+
}, btn.icon, " ", btn.title));
|
10388
|
+
}
|
10389
|
+
|
10390
|
+
return /*#__PURE__*/React.createElement("span", {
|
10391
|
+
key: i
|
10392
|
+
}, (_actionHandler$item$t4 = actionHandler[item.type]) === null || _actionHandler$item$t4 === void 0 ? void 0 : _actionHandler$item$t4.call(actionHandler, item, record, index));
|
10393
|
+
})), [/*#__PURE__*/React.createElement(_Dropdown, {
|
10394
|
+
overlay: menu,
|
10395
|
+
key: 'more'
|
10396
|
+
}, /*#__PURE__*/React.createElement("a", {
|
10397
|
+
key: "more"
|
10398
|
+
}, /*#__PURE__*/React.createElement(EllipsisOutlined, null)))]);
|
10399
|
+
} else {
|
10400
|
+
return tableAction === null || tableAction === void 0 ? void 0 : tableAction.map(function (item, i) {
|
10401
|
+
var _actionHandler$item$t6;
|
10402
|
+
|
10403
|
+
var btn = actionConfig[item.type];
|
10404
|
+
|
10405
|
+
if (btn) {
|
10406
|
+
return /*#__PURE__*/React.createElement(_Tooltip, {
|
10407
|
+
title: btn.title,
|
10408
|
+
key: i
|
10409
|
+
}, /*#__PURE__*/React.createElement("a", {
|
10410
|
+
key: btn.key,
|
10411
|
+
onClick: function onClick() {
|
10412
|
+
var _actionHandler$item$t5;
|
10413
|
+
|
10414
|
+
return (_actionHandler$item$t5 = actionHandler[item.type]) === null || _actionHandler$item$t5 === void 0 ? void 0 : _actionHandler$item$t5.call(actionHandler, item, record, index);
|
10415
|
+
}
|
10416
|
+
}, btn.icon, " ", btn.title));
|
10417
|
+
}
|
10418
|
+
|
10419
|
+
return /*#__PURE__*/React.createElement("span", {
|
10420
|
+
key: i
|
10421
|
+
}, (_actionHandler$item$t6 = actionHandler[item.type]) === null || _actionHandler$item$t6 === void 0 ? void 0 : _actionHandler$item$t6.call(actionHandler, item, record, index));
|
10422
|
+
});
|
10423
|
+
}
|
10418
10424
|
};
|
10419
10425
|
|
10420
10426
|
var tableBarDom = useMemo(function () {
|
@@ -10443,10 +10449,10 @@ var TabelCard = function TabelCard(props, ref) {
|
|
10443
10449
|
|
10444
10450
|
_context5.next = 3;
|
10445
10451
|
return item.actionMethod(values, function () {
|
10446
|
-
var _actionRef$
|
10452
|
+
var _actionRef$current4;
|
10447
10453
|
|
10448
10454
|
loading();
|
10449
|
-
actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$
|
10455
|
+
actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$current4 = actionRef.current) === null || _actionRef$current4 === void 0 ? void 0 : _actionRef$current4.reload();
|
10450
10456
|
});
|
10451
10457
|
|
10452
10458
|
case 3:
|
@@ -10471,9 +10477,9 @@ var TabelCard = function TabelCard(props, ref) {
|
|
10471
10477
|
|
10472
10478
|
return (_item$actionRender2 = item.actionRender) === null || _item$actionRender2 === void 0 ? void 0 : _item$actionRender2.call(item, actionRef, function () {
|
10473
10479
|
item.actionMethod && item.actionMethod(actionRef, function () {
|
10474
|
-
var _actionRef$
|
10480
|
+
var _actionRef$current5;
|
10475
10481
|
|
10476
|
-
return actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$
|
10482
|
+
return actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$current5 = actionRef.current) === null || _actionRef$current5 === void 0 ? void 0 : _actionRef$current5.reload();
|
10477
10483
|
});
|
10478
10484
|
});
|
10479
10485
|
}
|
@@ -10481,22 +10487,22 @@ var TabelCard = function TabelCard(props, ref) {
|
|
10481
10487
|
}, [actionRef]);
|
10482
10488
|
|
10483
10489
|
var onSubmit = function onSubmit(values) {
|
10484
|
-
var _actionRef$
|
10490
|
+
var _actionRef$current6;
|
10485
10491
|
|
10486
10492
|
setFormSearch(values);
|
10487
|
-
actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$
|
10493
|
+
actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$current6 = actionRef.current) === null || _actionRef$current6 === void 0 ? void 0 : _actionRef$current6.reload();
|
10488
10494
|
};
|
10489
10495
|
|
10490
10496
|
var onReset = function onReset() {
|
10491
|
-
var _actionRef$
|
10497
|
+
var _actionRef$current7;
|
10492
10498
|
|
10493
10499
|
setFormSearch({});
|
10494
|
-
actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$
|
10500
|
+
actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$current7 = actionRef.current) === null || _actionRef$current7 === void 0 ? void 0 : _actionRef$current7.reload();
|
10495
10501
|
};
|
10496
10502
|
|
10497
10503
|
var formSearchColumn = columns || [];
|
10498
10504
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ModalForm$1, _objectSpread2(_objectSpread2({
|
10499
|
-
ref:
|
10505
|
+
ref: modalFormRef,
|
10500
10506
|
title: modalFormConfig.type || '新增',
|
10501
10507
|
visible: visible,
|
10502
10508
|
record: modalFormConfig.record,
|
@@ -10550,7 +10556,7 @@ var TabelCard = function TabelCard(props, ref) {
|
|
10550
10556
|
return true;
|
10551
10557
|
})
|
10552
10558
|
})), /*#__PURE__*/React.createElement(WForm$1, {
|
10553
|
-
ref:
|
10559
|
+
ref: searchFormRef,
|
10554
10560
|
search: _objectSpread2(_objectSpread2({
|
10555
10561
|
labelWidth: 'auto',
|
10556
10562
|
searchText: '查询',
|
package/dist/index.js
CHANGED
@@ -763,7 +763,12 @@ var WSelect = function WSelect(props) {
|
|
763
763
|
onLoad && onLoad(options);
|
764
764
|
setValueEnumList(valueEnumNode);
|
765
765
|
}, [JSON.stringify(resList), JSON.stringify(request), JSON.stringify(params || {})]);
|
766
|
-
return /*#__PURE__*/React__default['default'].createElement(_Select__default['default'], _objectSpread2({
|
766
|
+
return /*#__PURE__*/React__default['default'].createElement(_Select__default['default'], _objectSpread2({
|
767
|
+
showSearch: true,
|
768
|
+
filterOption: function filterOption(input, option) {
|
769
|
+
return option.children.toLowerCase().indexOf(input.toLowerCase()) >= 0;
|
770
|
+
}
|
771
|
+
}, extraProps), request ? childrenNode : valueEnum ? valueEnumList : children);
|
767
772
|
};
|
768
773
|
|
769
774
|
WSelect.defaultProps = {};
|
@@ -6656,6 +6661,8 @@ var TreeSelect = function TreeSelect(_ref) {
|
|
6656
6661
|
}))();
|
6657
6662
|
}, []);
|
6658
6663
|
return /*#__PURE__*/React__default['default'].createElement(_TreeSelect__default['default'], _objectSpread2({
|
6664
|
+
showSearch: true,
|
6665
|
+
treeNodeFilterProp: "title",
|
6659
6666
|
treeDefaultExpandAll: true
|
6660
6667
|
}, props), !props.children ? renderTree(treeData) : props.children);
|
6661
6668
|
};
|
@@ -10066,7 +10073,7 @@ var ModalForm = function ModalForm(props, ref) {
|
|
10066
10073
|
|
10067
10074
|
React.useImperativeHandle(ref, function () {
|
10068
10075
|
return {
|
10069
|
-
formRef: formRef,
|
10076
|
+
formRef: formRef.current,
|
10070
10077
|
onSubmit: onSubmit
|
10071
10078
|
};
|
10072
10079
|
});
|
@@ -10162,8 +10169,7 @@ var ModalForm = function ModalForm(props, ref) {
|
|
10162
10169
|
|
10163
10170
|
var ModalForm$1 = /*#__PURE__*/React__default['default'].forwardRef(ModalForm);
|
10164
10171
|
|
10165
|
-
var _excluded$h = ["columns", "extraColumns", "request", "modalFormSearch", "search", "tableAction", "renderTableBar", "className", "style", "onFormChange", "modalConfig", "optionColumnConfig", "pagination"]
|
10166
|
-
_excluded2$3 = ["actionMethod"];
|
10172
|
+
var _excluded$h = ["columns", "extraColumns", "request", "modalFormSearch", "search", "tableAction", "renderTableBar", "className", "style", "onFormChange", "modalConfig", "optionColumnConfig", "pagination"];
|
10167
10173
|
|
10168
10174
|
var TabelCard = function TabelCard(props, ref) {
|
10169
10175
|
var columns = props.columns,
|
@@ -10182,7 +10188,8 @@ var TabelCard = function TabelCard(props, ref) {
|
|
10182
10188
|
extraProps = _objectWithoutProperties(props, _excluded$h);
|
10183
10189
|
|
10184
10190
|
var actionRef = React.useRef();
|
10185
|
-
var
|
10191
|
+
var modalFormRef = React.useRef(null);
|
10192
|
+
var searchFormRef = React.useRef(null);
|
10186
10193
|
|
10187
10194
|
var _useState = React.useState(false),
|
10188
10195
|
_useState2 = _slicedToArray(_useState, 2),
|
@@ -10202,7 +10209,8 @@ var TabelCard = function TabelCard(props, ref) {
|
|
10202
10209
|
React.useImperativeHandle(ref, function () {
|
10203
10210
|
return {
|
10204
10211
|
actionRef: actionRef.current,
|
10205
|
-
|
10212
|
+
modalFormRef: modalFormRef.current,
|
10213
|
+
searchFormRef: searchFormRef.current
|
10206
10214
|
};
|
10207
10215
|
});
|
10208
10216
|
|
@@ -10346,67 +10354,6 @@ var TabelCard = function TabelCard(props, ref) {
|
|
10346
10354
|
}
|
10347
10355
|
}, _callee4);
|
10348
10356
|
})), index);
|
10349
|
-
},
|
10350
|
-
more: function more(item, record, index) {
|
10351
|
-
var menus = !item.subMenus ? [] : item.subMenus.map(function (b) {
|
10352
|
-
var btn = actionConfig[b.key];
|
10353
|
-
|
10354
|
-
if (btn) {
|
10355
|
-
b.name = btn.title;
|
10356
|
-
b.icon = btn.icon;
|
10357
|
-
}
|
10358
|
-
|
10359
|
-
return b;
|
10360
|
-
});
|
10361
|
-
|
10362
|
-
var selectHandler = function selectHandler(key, item, record, index) {
|
10363
|
-
var _item$actionMethod;
|
10364
|
-
|
10365
|
-
if (key == 'more') {
|
10366
|
-
// No more recursion
|
10367
|
-
return;
|
10368
|
-
}
|
10369
|
-
|
10370
|
-
var customMenu = menus.find(function (m) {
|
10371
|
-
return m.key === key;
|
10372
|
-
});
|
10373
|
-
|
10374
|
-
var _item = _objectSpread2(_objectSpread2({}, customMenu), {}, {
|
10375
|
-
type: key
|
10376
|
-
});
|
10377
|
-
|
10378
|
-
var handler = actionHandler[key];
|
10379
|
-
|
10380
|
-
if (handler) {
|
10381
|
-
return handler(_item, record, index);
|
10382
|
-
}
|
10383
|
-
|
10384
|
-
return (_item$actionMethod = _item.actionMethod) === null || _item$actionMethod === void 0 ? void 0 : _item$actionMethod.call(_item, record, function () {
|
10385
|
-
var _actionRef$current4;
|
10386
|
-
|
10387
|
-
actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$current4 = actionRef.current) === null || _actionRef$current4 === void 0 ? void 0 : _actionRef$current4.reload();
|
10388
|
-
});
|
10389
|
-
};
|
10390
|
-
|
10391
|
-
var m = _toConsumableArray(menus).map(function (e) {
|
10392
|
-
if (!('actionMethod' in e)) {
|
10393
|
-
return e;
|
10394
|
-
}
|
10395
|
-
|
10396
|
-
var actionMethod = e.actionMethod,
|
10397
|
-
b = _objectWithoutProperties(e, _excluded2$3);
|
10398
|
-
|
10399
|
-
return _objectSpread2({}, b);
|
10400
|
-
});
|
10401
|
-
|
10402
|
-
return /*#__PURE__*/React__default['default'].createElement(ProTable.TableDropdown, {
|
10403
|
-
key: "actionGroup",
|
10404
|
-
children: /*#__PURE__*/React__default['default'].createElement(icons.MoreOutlined, null),
|
10405
|
-
menus: m,
|
10406
|
-
onSelect: function onSelect(key) {
|
10407
|
-
return selectHandler(key, item, record, index);
|
10408
|
-
}
|
10409
|
-
});
|
10410
10357
|
}
|
10411
10358
|
};
|
10412
10359
|
var actionConfig = {
|
@@ -10428,27 +10375,86 @@ var TabelCard = function TabelCard(props, ref) {
|
|
10428
10375
|
};
|
10429
10376
|
|
10430
10377
|
var tableActionDom = function tableActionDom(record, index) {
|
10431
|
-
|
10432
|
-
var _actionHandler$item$t2;
|
10378
|
+
var showMoreNum = (optionColumnConfig === null || optionColumnConfig === void 0 ? void 0 : optionColumnConfig.showMoreNum) || 0;
|
10433
10379
|
|
10434
|
-
|
10380
|
+
if (tableAction && showMoreNum > 0 && showMoreNum < tableAction.length) {
|
10381
|
+
var tableAction1 = tableAction.slice(0, showMoreNum);
|
10382
|
+
var tableAction2 = tableAction.slice(showMoreNum);
|
10383
|
+
var menu = /*#__PURE__*/React__default['default'].createElement(_Menu__default['default'], null, tableAction2.map(function (item, i) {
|
10384
|
+
var _actionHandler$item$t2;
|
10435
10385
|
|
10436
|
-
|
10437
|
-
return /*#__PURE__*/React__default['default'].createElement(_Tooltip__default['default'], {
|
10438
|
-
title: btn.title,
|
10439
|
-
key: btn.key
|
10440
|
-
}, /*#__PURE__*/React__default['default'].createElement("a", {
|
10441
|
-
key: btn.key,
|
10442
|
-
onClick: function onClick() {
|
10443
|
-
var _actionHandler$item$t;
|
10386
|
+
var btn = actionConfig[item.type];
|
10444
10387
|
|
10445
|
-
|
10446
|
-
|
10447
|
-
|
10448
|
-
|
10388
|
+
if (btn) {
|
10389
|
+
return /*#__PURE__*/React__default['default'].createElement(_Menu__default['default'].Item, {
|
10390
|
+
key: i
|
10391
|
+
}, /*#__PURE__*/React__default['default'].createElement("a", {
|
10392
|
+
key: btn.key,
|
10393
|
+
onClick: function onClick() {
|
10394
|
+
var _actionHandler$item$t;
|
10395
|
+
|
10396
|
+
return (_actionHandler$item$t = actionHandler[item.type]) === null || _actionHandler$item$t === void 0 ? void 0 : _actionHandler$item$t.call(actionHandler, item, record, index);
|
10397
|
+
}
|
10398
|
+
}, btn.icon, " ", btn.title));
|
10399
|
+
}
|
10449
10400
|
|
10450
|
-
|
10451
|
-
|
10401
|
+
return /*#__PURE__*/React__default['default'].createElement(_Menu__default['default'].Item, {
|
10402
|
+
key: i
|
10403
|
+
}, (_actionHandler$item$t2 = actionHandler[item.type]) === null || _actionHandler$item$t2 === void 0 ? void 0 : _actionHandler$item$t2.call(actionHandler, item, record, index));
|
10404
|
+
}));
|
10405
|
+
return [].concat(_toConsumableArray(tableAction1.map(function (item, i) {
|
10406
|
+
var _actionHandler$item$t4;
|
10407
|
+
|
10408
|
+
var btn = actionConfig[item.type];
|
10409
|
+
|
10410
|
+
if (btn) {
|
10411
|
+
return /*#__PURE__*/React__default['default'].createElement(_Tooltip__default['default'], {
|
10412
|
+
title: btn.title,
|
10413
|
+
key: i
|
10414
|
+
}, /*#__PURE__*/React__default['default'].createElement("a", {
|
10415
|
+
key: btn.key,
|
10416
|
+
onClick: function onClick() {
|
10417
|
+
var _actionHandler$item$t3;
|
10418
|
+
|
10419
|
+
return (_actionHandler$item$t3 = actionHandler[item.type]) === null || _actionHandler$item$t3 === void 0 ? void 0 : _actionHandler$item$t3.call(actionHandler, item, record, index);
|
10420
|
+
}
|
10421
|
+
}, btn.icon, " ", btn.title));
|
10422
|
+
}
|
10423
|
+
|
10424
|
+
return /*#__PURE__*/React__default['default'].createElement("span", {
|
10425
|
+
key: i
|
10426
|
+
}, (_actionHandler$item$t4 = actionHandler[item.type]) === null || _actionHandler$item$t4 === void 0 ? void 0 : _actionHandler$item$t4.call(actionHandler, item, record, index));
|
10427
|
+
})), [/*#__PURE__*/React__default['default'].createElement(_Dropdown__default['default'], {
|
10428
|
+
overlay: menu,
|
10429
|
+
key: 'more'
|
10430
|
+
}, /*#__PURE__*/React__default['default'].createElement("a", {
|
10431
|
+
key: "more"
|
10432
|
+
}, /*#__PURE__*/React__default['default'].createElement(icons.EllipsisOutlined, null)))]);
|
10433
|
+
} else {
|
10434
|
+
return tableAction === null || tableAction === void 0 ? void 0 : tableAction.map(function (item, i) {
|
10435
|
+
var _actionHandler$item$t6;
|
10436
|
+
|
10437
|
+
var btn = actionConfig[item.type];
|
10438
|
+
|
10439
|
+
if (btn) {
|
10440
|
+
return /*#__PURE__*/React__default['default'].createElement(_Tooltip__default['default'], {
|
10441
|
+
title: btn.title,
|
10442
|
+
key: i
|
10443
|
+
}, /*#__PURE__*/React__default['default'].createElement("a", {
|
10444
|
+
key: btn.key,
|
10445
|
+
onClick: function onClick() {
|
10446
|
+
var _actionHandler$item$t5;
|
10447
|
+
|
10448
|
+
return (_actionHandler$item$t5 = actionHandler[item.type]) === null || _actionHandler$item$t5 === void 0 ? void 0 : _actionHandler$item$t5.call(actionHandler, item, record, index);
|
10449
|
+
}
|
10450
|
+
}, btn.icon, " ", btn.title));
|
10451
|
+
}
|
10452
|
+
|
10453
|
+
return /*#__PURE__*/React__default['default'].createElement("span", {
|
10454
|
+
key: i
|
10455
|
+
}, (_actionHandler$item$t6 = actionHandler[item.type]) === null || _actionHandler$item$t6 === void 0 ? void 0 : _actionHandler$item$t6.call(actionHandler, item, record, index));
|
10456
|
+
});
|
10457
|
+
}
|
10452
10458
|
};
|
10453
10459
|
|
10454
10460
|
var tableBarDom = React.useMemo(function () {
|
@@ -10477,10 +10483,10 @@ var TabelCard = function TabelCard(props, ref) {
|
|
10477
10483
|
|
10478
10484
|
_context5.next = 3;
|
10479
10485
|
return item.actionMethod(values, function () {
|
10480
|
-
var _actionRef$
|
10486
|
+
var _actionRef$current4;
|
10481
10487
|
|
10482
10488
|
loading();
|
10483
|
-
actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$
|
10489
|
+
actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$current4 = actionRef.current) === null || _actionRef$current4 === void 0 ? void 0 : _actionRef$current4.reload();
|
10484
10490
|
});
|
10485
10491
|
|
10486
10492
|
case 3:
|
@@ -10505,9 +10511,9 @@ var TabelCard = function TabelCard(props, ref) {
|
|
10505
10511
|
|
10506
10512
|
return (_item$actionRender2 = item.actionRender) === null || _item$actionRender2 === void 0 ? void 0 : _item$actionRender2.call(item, actionRef, function () {
|
10507
10513
|
item.actionMethod && item.actionMethod(actionRef, function () {
|
10508
|
-
var _actionRef$
|
10514
|
+
var _actionRef$current5;
|
10509
10515
|
|
10510
|
-
return actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$
|
10516
|
+
return actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$current5 = actionRef.current) === null || _actionRef$current5 === void 0 ? void 0 : _actionRef$current5.reload();
|
10511
10517
|
});
|
10512
10518
|
});
|
10513
10519
|
}
|
@@ -10515,22 +10521,22 @@ var TabelCard = function TabelCard(props, ref) {
|
|
10515
10521
|
}, [actionRef]);
|
10516
10522
|
|
10517
10523
|
var onSubmit = function onSubmit(values) {
|
10518
|
-
var _actionRef$
|
10524
|
+
var _actionRef$current6;
|
10519
10525
|
|
10520
10526
|
setFormSearch(values);
|
10521
|
-
actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$
|
10527
|
+
actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$current6 = actionRef.current) === null || _actionRef$current6 === void 0 ? void 0 : _actionRef$current6.reload();
|
10522
10528
|
};
|
10523
10529
|
|
10524
10530
|
var onReset = function onReset() {
|
10525
|
-
var _actionRef$
|
10531
|
+
var _actionRef$current7;
|
10526
10532
|
|
10527
10533
|
setFormSearch({});
|
10528
|
-
actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$
|
10534
|
+
actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$current7 = actionRef.current) === null || _actionRef$current7 === void 0 ? void 0 : _actionRef$current7.reload();
|
10529
10535
|
};
|
10530
10536
|
|
10531
10537
|
var formSearchColumn = columns || [];
|
10532
10538
|
return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(ModalForm$1, _objectSpread2(_objectSpread2({
|
10533
|
-
ref:
|
10539
|
+
ref: modalFormRef,
|
10534
10540
|
title: modalFormConfig.type || '新增',
|
10535
10541
|
visible: visible,
|
10536
10542
|
record: modalFormConfig.record,
|
@@ -10584,7 +10590,7 @@ var TabelCard = function TabelCard(props, ref) {
|
|
10584
10590
|
return true;
|
10585
10591
|
})
|
10586
10592
|
})), /*#__PURE__*/React__default['default'].createElement(WForm$1, {
|
10587
|
-
ref:
|
10593
|
+
ref: searchFormRef,
|
10588
10594
|
search: _objectSpread2(_objectSpread2({
|
10589
10595
|
labelWidth: 'auto',
|
10590
10596
|
searchText: '查询',
|