@zat-design/sisyphus-react 4.5.10-beta.1 → 4.5.10-beta.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/es/FormsProvider/index.js +14 -21
- package/es/ProAction/components/CheckModalContent/index.js +12 -26
- package/es/ProAction/index.js +79 -83
- package/es/ProAction/propsType.js +0 -1
- package/es/ProConfigProvider/index.js +63 -110
- package/es/ProConfigProvider/propsType.js +0 -1
- package/es/ProDownload/index.js +55 -65
- package/es/ProDownload/propsType.js +0 -1
- package/es/ProDownload/utils.js +61 -95
- package/es/ProDrawerForm/components/ProDrawer/index.js +83 -113
- package/es/ProDrawerForm/components/ProModal/index.js +77 -108
- package/es/ProDrawerForm/components/index.js +6 -2
- package/es/ProDrawerForm/hooks/useConfirmClose.js +20 -39
- package/es/ProDrawerForm/index.js +29 -38
- package/es/ProDrawerForm/propsType.js +0 -1
- package/es/ProDrawerForm/utils/index.js +18 -36
- package/es/ProEditLabel/components/RenderProForm.js +45 -49
- package/es/ProEditLabel/index.js +126 -163
- package/es/ProEditLabel/propsType.js +0 -1
- package/es/ProEditLabel/utils/index.js +5 -8
- package/es/ProEditTable/components/ActionButton/index.js +111 -119
- package/es/ProEditTable/components/RcTable/BaseTable.js +38 -51
- package/es/ProEditTable/components/RcTable/DraggableTable.js +97 -129
- package/es/ProEditTable/components/RcTable/index.js +6 -4
- package/es/ProEditTable/components/RenderField/ListChangedWrapper.js +77 -95
- package/es/ProEditTable/components/RenderField/index.js +490 -587
- package/es/ProEditTable/components/RenderField/propsType.js +0 -1
- package/es/ProEditTable/components/RenderField/tools.js +115 -112
- package/es/ProEditTable/components/RenderToolbar/index.js +47 -73
- package/es/ProEditTable/components/Summary/index.js +38 -64
- package/es/ProEditTable/components/Validator/index.js +46 -46
- package/es/ProEditTable/components/index.js +12 -5
- package/es/ProEditTable/index.js +456 -378
- package/es/ProEditTable/propsType.js +0 -1
- package/es/ProEditTable/utils/config.js +60 -122
- package/es/ProEditTable/utils/diffOriginal.js +45 -82
- package/es/ProEditTable/utils/getDefaultProps.js +19 -24
- package/es/ProEditTable/utils/index.js +150 -236
- package/es/ProEditTable/utils/tools.js +149 -286
- package/es/ProEditTable/utils/transform.js +25 -30
- package/es/ProEditTable/utils/useEditTableError.js +30 -43
- package/es/ProEditTable/utils/useShouldUpdateForTable.js +42 -72
- package/es/ProEditTable/utils/validateAll.js +87 -154
- package/es/ProEnum/components/Group.js +38 -30
- package/es/ProEnum/components/Tag.js +22 -26
- package/es/ProEnum/hooks/useEnum.js +48 -116
- package/es/ProEnum/hooks/useEnumRequest.js +128 -179
- package/es/ProEnum/hooks/useFrequentEnumRequest.js +40 -48
- package/es/ProEnum/index.js +162 -172
- package/es/ProEnum/propsType.js +0 -1
- package/es/ProEnum/utils/eventCenter.js +10 -12
- package/es/ProEnum/utils/frequentEnum.js +35 -92
- package/es/ProEnum/utils/getEnum.js +32 -90
- package/es/ProEnum/utils/getEnumLabel.js +44 -49
- package/es/ProEnum/utils/index.js +93 -207
- package/es/ProForm/components/Container.js +13 -28
- package/es/ProForm/components/FormFooter/index.js +36 -44
- package/es/ProForm/components/FormFooter/propsType.js +0 -1
- package/es/ProForm/components/base/Checkbox/index.js +32 -59
- package/es/ProForm/components/base/DatePicker/index.js +49 -71
- package/es/ProForm/components/base/Input/index.js +63 -97
- package/es/ProForm/components/base/Input/propsType.js +0 -1
- package/es/ProForm/components/base/InputNumber/index.js +118 -172
- package/es/ProForm/components/base/Radio/index.js +39 -52
- package/es/ProForm/components/base/RangePicker/index.js +109 -127
- package/es/ProForm/components/base/RangePicker/useDateRange.js +20 -17
- package/es/ProForm/components/base/Select/index.js +63 -89
- package/es/ProForm/components/base/Switch/index.js +27 -35
- package/es/ProForm/components/base/SwitchCheckbox/index.js +36 -54
- package/es/ProForm/components/base/TextArea/index.js +30 -41
- package/es/ProForm/components/base/TimePicker/index.js +27 -37
- package/es/ProForm/components/combination/Container/index.js +37 -47
- package/es/ProForm/components/combination/Container/propsType.js +0 -1
- package/es/ProForm/components/combination/FormList/components/ActionButton.js +165 -237
- package/es/ProForm/components/combination/FormList/components/BlockFields.js +98 -103
- package/es/ProForm/components/combination/FormList/components/Empty.js +27 -54
- package/es/ProForm/components/combination/FormList/components/LineFields.js +57 -54
- package/es/ProForm/components/combination/FormList/components/ToolbarButton.js +61 -109
- package/es/ProForm/components/combination/FormList/index.js +151 -161
- package/es/ProForm/components/combination/FormList/propsType.js +0 -1
- package/es/ProForm/components/combination/FormList/utils.js +22 -38
- package/es/ProForm/components/combination/Group/component/AddonWrapper/index.js +12 -28
- package/es/ProForm/components/combination/Group/component/ComRender.js +50 -111
- package/es/ProForm/components/combination/Group/component/FlexibleGroup.js +105 -206
- package/es/ProForm/components/combination/Group/hooks/index.js +68 -128
- package/es/ProForm/components/combination/Group/index.js +87 -126
- package/es/ProForm/components/combination/Group/propsType.js +0 -1
- package/es/ProForm/components/combination/Group/utils/index.js +124 -239
- package/es/ProForm/components/combination/ProCascader/index.js +156 -199
- package/es/ProForm/components/combination/ProCascader/propsType.js +0 -1
- package/es/ProForm/components/combination/ProCascader/utils/index.js +12 -21
- package/es/ProForm/components/combination/ProModalSelect/hooks/useRequestList.js +63 -75
- package/es/ProForm/components/combination/ProModalSelect/index.js +290 -348
- package/es/ProForm/components/combination/ProModalSelect/propsType.js +0 -1
- package/es/ProForm/components/combination/ProModalSelect/utils/index.js +32 -39
- package/es/ProForm/components/combination/ProNumberRange/index.js +100 -156
- package/es/ProForm/components/combination/ProNumberRange/propsType.js +0 -1
- package/es/ProForm/components/combination/ProRangeLimit/index.js +104 -115
- package/es/ProForm/components/combination/ProRangeLimit/propsType.js +0 -1
- package/es/ProForm/components/combination/ProTimeLimit/hooks/useControlled.js +16 -16
- package/es/ProForm/components/combination/ProTimeLimit/index.js +75 -109
- package/es/ProForm/components/index.js +56 -34
- package/es/ProForm/components/render/ChangedWrapper.js +85 -94
- package/es/ProForm/components/render/ConfirmWrapper.js +27 -39
- package/es/ProForm/components/render/CustomComponentViewWrapper.js +65 -82
- package/es/ProForm/components/render/Render.js +223 -329
- package/es/ProForm/components/render/RenderFields.js +76 -113
- package/es/ProForm/components/render/propsType.js +0 -1
- package/es/ProForm/hooks/useControlled.js +8 -10
- package/es/ProForm/hooks/useDeepCompareMemo.js +11 -11
- package/es/ProForm/hooks/useFieldProps.js +8 -4
- package/es/ProForm/hooks/useForm.js +50 -110
- package/es/ProForm/hooks/useRules.js +17 -33
- package/es/ProForm/hooks/useShouldUpdate.js +77 -152
- package/es/ProForm/hooks/useWatch.js +58 -129
- package/es/ProForm/index.js +157 -194
- package/es/ProForm/propsType.js +15 -7
- package/es/ProForm/utils/buildFormItemProps.js +51 -58
- package/es/ProForm/utils/diffOriginal.js +43 -73
- package/es/ProForm/utils/getDefaultProps.js +18 -24
- package/es/ProForm/utils/index.js +159 -234
- package/es/ProForm/utils/processDependencies.js +21 -60
- package/es/ProForm/utils/reactiveValues.js +20 -34
- package/es/ProForm/utils/rulesCreator.js +42 -40
- package/es/ProForm/utils/transformNames.js +10 -13
- package/es/ProForm/utils/transformValue.js +16 -29
- package/es/ProForm/utils/valueType.js +96 -178
- package/es/ProIcon/config/index.js +340 -274
- package/es/ProIcon/index.js +135 -209
- package/es/ProIcon/propsTypes.js +0 -1
- package/es/ProIcon/utils/index.js +24 -39
- package/es/ProLayout/components/Layout/Header/index.js +108 -141
- package/es/ProLayout/components/Layout/Menu/FoldMenu/index.js +134 -190
- package/es/ProLayout/components/Layout/Menu/OpenMenu/index.js +111 -137
- package/es/ProLayout/components/Layout/Menu/OpenMenu/propsType.js +0 -1
- package/es/ProLayout/components/Layout/Menu/SideMenu/index.js +23 -31
- package/es/ProLayout/components/Layout/Menu/index.js +92 -89
- package/es/ProLayout/components/Layout/Notice/index.js +13 -27
- package/es/ProLayout/components/Layout/index.js +8 -3
- package/es/ProLayout/components/ProCollapse/PropTypes.js +0 -1
- package/es/ProLayout/components/ProCollapse/index.js +89 -111
- package/es/ProLayout/components/ProFooter/PropTypes.js +0 -1
- package/es/ProLayout/components/ProFooter/index.js +27 -25
- package/es/ProLayout/components/ProHeader/PropTypes.js +0 -1
- package/es/ProLayout/components/ProHeader/components/Copy/index.js +23 -21
- package/es/ProLayout/components/ProHeader/components/Describe/index.js +67 -86
- package/es/ProLayout/components/ProHeader/components/ProBackBtn/index.js +18 -21
- package/es/ProLayout/components/ProHeader/components/ProBackBtn/propsType.js +0 -1
- package/es/ProLayout/components/ProHeader/components/index.js +6 -2
- package/es/ProLayout/components/ProHeader/index.js +216 -356
- package/es/ProLayout/components/ProHeader/utils/index.js +19 -26
- package/es/ProLayout/components/TabsManager/components/TabContextMenu.js +92 -85
- package/es/ProLayout/components/TabsManager/components/TabItem.js +53 -64
- package/es/ProLayout/components/TabsManager/components/TabsContext.js +5 -5
- package/es/ProLayout/components/TabsManager/components/TabsHeader.js +42 -52
- package/es/ProLayout/components/TabsManager/hooks/useActiveTab.js +8 -9
- package/es/ProLayout/components/TabsManager/hooks/useIframeRoute.js +19 -32
- package/es/ProLayout/components/TabsManager/hooks/useProLayoutTabs.js +6 -20
- package/es/ProLayout/components/TabsManager/hooks/useTabsCache.js +25 -42
- package/es/ProLayout/components/TabsManager/hooks/useTabsState.js +290 -408
- package/es/ProLayout/components/TabsManager/hooks/useTabsUrlSync.js +132 -95
- package/es/ProLayout/components/TabsManager/index.js +406 -390
- package/es/ProLayout/components/TabsManager/propTypes.js +7 -15
- package/es/ProLayout/components/TabsManager/utils/historyObserver.js +26 -23
- package/es/ProLayout/components/TabsManager/utils/index.js +127 -184
- package/es/ProLayout/components/index.js +8 -3
- package/es/ProLayout/index.js +171 -229
- package/es/ProLayout/propTypes.js +12 -52
- package/es/ProLayout/utils/index.js +48 -128
- package/es/ProSelect/components/AdaptiveTooltip.js +26 -25
- package/es/ProSelect/index.js +184 -229
- package/es/ProSelect/propsType.js +0 -1
- package/es/ProSelect/utils/index.js +100 -146
- package/es/ProStep/components/Anchor/index.js +71 -82
- package/es/ProStep/components/Item/index.js +49 -56
- package/es/ProStep/components/LazyLoad/index.js +23 -29
- package/es/ProStep/components/Listener/index.js +20 -33
- package/es/ProStep/components/Step/index.js +31 -38
- package/es/ProStep/constants.js +4 -1
- package/es/ProStep/index.js +166 -153
- package/es/ProStep/propsType.js +0 -1
- package/es/ProStep/utils/index.js +29 -55
- package/es/ProStepTab/index.js +83 -138
- package/es/ProStepTab/propsType.js +0 -1
- package/es/ProTable/components/EditableCell/EditIcon.js +10 -14
- package/es/ProTable/components/EditableCell/index.js +37 -71
- package/es/ProTable/components/EditableCell/propsType.js +0 -1
- package/es/ProTable/components/FormatColumn/index.js +209 -340
- package/es/ProTable/components/FormatColumn/propsType.js +0 -1
- package/es/ProTable/components/RcTable/components/BaseTable/index.js +35 -39
- package/es/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/index.js +80 -107
- package/es/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/utils/index.js +54 -48
- package/es/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/utils/propsType.js +0 -1
- package/es/ProTable/components/RcTable/components/DraggableTable/index.js +47 -54
- package/es/ProTable/components/RcTable/index.js +6 -4
- package/es/ProTable/components/RenderColumn/index.js +158 -186
- package/es/ProTable/components/RenderEmptyText/index.js +12 -21
- package/es/ProTable/components/RenderFooter/index.js +15 -15
- package/es/ProTable/components/RenderSummary/index.js +33 -50
- package/es/ProTable/components/RenderTableHeader/index.js +44 -46
- package/es/ProTable/components/RenderTabs/index.js +47 -51
- package/es/ProTable/components/TableResizable/index.js +56 -72
- package/es/ProTable/components/TooltipTitle/index.js +13 -21
- package/es/ProTable/components/index.js +16 -36
- package/es/ProTable/hooks/useAntdTable.js +185 -219
- package/es/ProTable/index.js +232 -249
- package/es/ProTable/propsType.js +0 -1
- package/es/ProTable/utils/columnStorage.js +63 -88
- package/es/ProTable/utils/index.js +57 -90
- package/es/ProTabs/components/Card/index.js +20 -48
- package/es/ProTabs/components/index.js +4 -1
- package/es/ProTabs/index.js +39 -56
- package/es/ProTabs/propType.js +0 -1
- package/es/ProThemeTools/component/ProTools/index.js +106 -158
- package/es/ProThemeTools/component/index.js +4 -1
- package/es/ProThemeTools/context/ThemeContext.js +67 -146
- package/es/ProThemeTools/index.js +103 -156
- package/es/ProThemeTools/propsType.js +0 -1
- package/es/ProThemeTools/utils/index.js +60 -109
- package/es/ProTooltip/index.js +132 -165
- package/es/ProTooltip/propsType.js +0 -1
- package/es/ProTree/components/AdaptiveTooltip.js +15 -17
- package/es/ProTree/components/CloseIcon.js +18 -26
- package/es/ProTree/components/List.js +28 -47
- package/es/ProTree/components/ProTree.js +152 -211
- package/es/ProTree/components/ProTreeSelect/index.js +254 -458
- package/es/ProTree/components/ProTreeSelect/propsType.js +0 -1
- package/es/ProTree/components/SearchTitle.js +23 -42
- package/es/ProTree/components/Tree.js +147 -195
- package/es/ProTree/components/index.js +10 -5
- package/es/ProTree/index.js +12 -16
- package/es/ProTree/propsType.js +0 -1
- package/es/ProTree/utils.js +46 -118
- package/es/ProTreeModal/components/Cascader.js +56 -64
- package/es/ProTreeModal/components/CloseIcon.js +18 -26
- package/es/ProTreeModal/components/List.js +114 -180
- package/es/ProTreeModal/components/SearchTitle.js +15 -18
- package/es/ProTreeModal/components/SortableItem.js +29 -58
- package/es/ProTreeModal/components/Tree.js +99 -113
- package/es/ProTreeModal/components/Trigger.js +87 -121
- package/es/ProTreeModal/components/index.js +14 -6
- package/es/ProTreeModal/index.js +397 -435
- package/es/ProTreeModal/propsType.js +0 -1
- package/es/ProTreeModal/utils.js +52 -95
- package/es/ProUpload/components/ButtonRender.js +44 -54
- package/es/ProUpload/components/DragRender.js +94 -134
- package/es/ProUpload/components/DraggableUploadListItem.js +12 -25
- package/es/ProUpload/components/Example.js +27 -31
- package/es/ProUpload/components/FileItem.js +69 -163
- package/es/ProUpload/components/ImageRender.js +134 -170
- package/es/ProUpload/index.js +68 -100
- package/es/ProUpload/propsType.js +0 -1
- package/es/ProUpload/uitls.js +8 -4
- package/es/ProUtils/utils/index.js +17 -13
- package/es/ProViewer/index.js +154 -175
- package/es/ProViewer/propsType.js +0 -5
- package/es/ProWaterMark/index.js +9 -16
- package/es/ProWaterMark/propsType.js +0 -1
- package/es/hooks/useDraggableRow.js +25 -53
- package/es/index.js +57 -77
- package/es/locale/en_US.js +153 -142
- package/es/locale/index.js +23 -36
- package/es/locale/zh_CN.js +145 -142
- package/es/tokens.js +84 -83
- package/es/utils/index.js +24 -51
- package/package.json +4 -3
|
@@ -1,44 +1,40 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import { Form, message } from
|
|
1
|
+
import { useEffect, useMemo, useState } from "react";
|
|
2
|
+
import { useRequest, useSetState, useDeepCompareEffect, usePrevious } from "ahooks";
|
|
3
|
+
import pickBy from "lodash/pickBy";
|
|
4
|
+
import isObject from "lodash/isObject";
|
|
5
|
+
import merge from "lodash/merge";
|
|
6
|
+
import isEqual from "lodash/isEqual";
|
|
7
|
+
import omit from "lodash/omit";
|
|
8
|
+
import { Form, message } from "antd";
|
|
9
9
|
import { defaultPage } from "../index";
|
|
10
10
|
import { isListResult, removeEmptyKeys, isNonEmptyObject } from "../utils";
|
|
11
11
|
import locale, { formatMessage } from "../../locale";
|
|
12
|
-
const useDefaultOptions = options => {
|
|
13
|
-
const [page, onPageChange] = useState(options
|
|
12
|
+
const useDefaultOptions = (options) => {
|
|
13
|
+
const [page, onPageChange] = useState((options == null ? void 0 : options.page) || defaultPage);
|
|
14
14
|
return {
|
|
15
15
|
...options,
|
|
16
|
-
rowSelectType: options
|
|
16
|
+
rowSelectType: (options == null ? void 0 : options.rowSelectType) || "checkbox",
|
|
17
17
|
page,
|
|
18
|
-
onPageChange: options
|
|
18
|
+
onPageChange: (options == null ? void 0 : options.onPageChange) || onPageChange
|
|
19
19
|
};
|
|
20
20
|
};
|
|
21
21
|
let previousSearchValues = null;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
const SELECTION_ALL = "SELECTION_ALL";
|
|
23
|
+
const CURRENT_PAGE = "CURRENT_PAGE";
|
|
24
|
+
const UNCHECK_ALL = "UNCHECK_ALL";
|
|
25
25
|
function useAntdTable(service, options, useRequestOptions) {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
total,
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
extraFilter,
|
|
32
|
-
allSelected,
|
|
33
|
-
searchValues
|
|
34
|
-
}, setState] = useSetState({
|
|
26
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
27
|
+
const [
|
|
28
|
+
{ data, total, selectedRecords, selectedRowKeys, extraFilter, allSelected, searchValues },
|
|
29
|
+
setState
|
|
30
|
+
] = useSetState({
|
|
35
31
|
data: [],
|
|
36
32
|
total: 0,
|
|
37
33
|
selectedRecords: [],
|
|
38
34
|
selectedRowKeys: [],
|
|
39
35
|
extraFilter: {
|
|
40
|
-
filters:
|
|
41
|
-
sorter:
|
|
36
|
+
filters: void 0,
|
|
37
|
+
sorter: void 0
|
|
42
38
|
},
|
|
43
39
|
allSelected: false,
|
|
44
40
|
searchValues: {}
|
|
@@ -59,32 +55,25 @@ function useAntdTable(service, options, useRequestOptions) {
|
|
|
59
55
|
disabled
|
|
60
56
|
} = useDefaultOptions(options);
|
|
61
57
|
const [form] = Form.useForm(_form);
|
|
62
|
-
const {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
const defaultParam = Array.isArray(defaultParams) ? defaultParams?.[0] : defaultParams || {};
|
|
66
|
-
const initPage = options?.page || defaultPage;
|
|
58
|
+
const { defaultParams } = useRequestOptions || {};
|
|
59
|
+
const defaultParam = Array.isArray(defaultParams) ? defaultParams == null ? void 0 : defaultParams[0] : defaultParams || {};
|
|
60
|
+
const initPage = (options == null ? void 0 : options.page) || defaultPage;
|
|
67
61
|
const previousPage = usePrevious(page || defaultPage);
|
|
68
|
-
const getTransformParams = params => {
|
|
62
|
+
const getTransformParams = (params) => {
|
|
69
63
|
const realParams = {
|
|
70
64
|
...defaultParam,
|
|
71
65
|
...extraParams,
|
|
72
66
|
...params
|
|
73
67
|
};
|
|
74
|
-
const {
|
|
75
|
-
page = initPage,
|
|
76
|
-
filters,
|
|
77
|
-
sorter,
|
|
78
|
-
...otherParams
|
|
79
|
-
} = realParams;
|
|
68
|
+
const { page: page2 = initPage, filters, sorter, ...otherParams } = realParams;
|
|
80
69
|
const queryBean = {
|
|
81
|
-
filters: JSON.stringify(filters) ===
|
|
82
|
-
sorter: JSON.stringify(sorter) ===
|
|
70
|
+
filters: JSON.stringify(filters) === "{}" ? void 0 : filters,
|
|
71
|
+
sorter: JSON.stringify(sorter) === "{}" ? void 0 : sorter,
|
|
83
72
|
...otherParams
|
|
84
73
|
};
|
|
85
74
|
const requestParams = {
|
|
86
|
-
...
|
|
87
|
-
queryBean:
|
|
75
|
+
...page2,
|
|
76
|
+
queryBean: pickBy(queryBean, (item) => item !== void 0) ?? {}
|
|
88
77
|
};
|
|
89
78
|
if (transformParams) {
|
|
90
79
|
const mergedParams = {
|
|
@@ -95,9 +84,7 @@ function useAntdTable(service, options, useRequestOptions) {
|
|
|
95
84
|
}
|
|
96
85
|
return requestParams;
|
|
97
86
|
};
|
|
98
|
-
|
|
99
|
-
// 仅清数据源相关,查询相关
|
|
100
|
-
const handleSetStateCallback = values => {
|
|
87
|
+
const handleSetStateCallback = (values) => {
|
|
101
88
|
setState({
|
|
102
89
|
data: [],
|
|
103
90
|
total: 0,
|
|
@@ -111,37 +98,27 @@ function useAntdTable(service, options, useRequestOptions) {
|
|
|
111
98
|
const curExtraParams = useMemo(() => {
|
|
112
99
|
return extraParams ? JSON.stringify(extraParams) : extraParams;
|
|
113
100
|
}, [extraParams]);
|
|
114
|
-
|
|
115
|
-
// 调接口
|
|
116
101
|
const result = useRequest(service, {
|
|
117
102
|
debounceWait: 300,
|
|
118
103
|
...useRequestOptions,
|
|
119
104
|
defaultParams: [getTransformParams()],
|
|
120
105
|
onSuccess: (res, params) => {
|
|
106
|
+
var _a2, _b2;
|
|
121
107
|
const transformResult = transformResponse ? transformResponse(res) : res || {};
|
|
122
|
-
const {
|
|
123
|
-
list = [],
|
|
124
|
-
total = 0
|
|
125
|
-
} = isListResult(transformResult) ? transformResult : transformResult?.data || {};
|
|
108
|
+
const { list = [], total: total2 = 0 } = isListResult(transformResult) ? transformResult : (transformResult == null ? void 0 : transformResult.data) || {};
|
|
126
109
|
if (list !== null && !Array.isArray(list)) {
|
|
127
|
-
return message.error(locale
|
|
110
|
+
return message.error((_b2 = (_a2 = locale) == null ? void 0 : _a2.ProTable) == null ? void 0 : _b2.transformResponseMsg);
|
|
128
111
|
}
|
|
129
112
|
setState({
|
|
130
|
-
total,
|
|
113
|
+
total: total2,
|
|
131
114
|
data: list || []
|
|
132
115
|
});
|
|
133
|
-
if (useRequestOptions
|
|
116
|
+
if (useRequestOptions == null ? void 0 : useRequestOptions.onSuccess) {
|
|
134
117
|
useRequestOptions.onSuccess(res, params);
|
|
135
118
|
}
|
|
136
119
|
}
|
|
137
120
|
});
|
|
138
|
-
const {
|
|
139
|
-
run,
|
|
140
|
-
refreshAsync
|
|
141
|
-
} = result;
|
|
142
|
-
|
|
143
|
-
// service变化时触发 (禁止掉防止service变更时导致的死循环)
|
|
144
|
-
|
|
121
|
+
const { run, refreshAsync } = result;
|
|
145
122
|
const clearSelected = () => {
|
|
146
123
|
setState({
|
|
147
124
|
allSelected: false,
|
|
@@ -156,15 +133,13 @@ function useAntdTable(service, options, useRequestOptions) {
|
|
|
156
133
|
selectedRecords: [],
|
|
157
134
|
selectedRowKeys: [],
|
|
158
135
|
extraFilter: {
|
|
159
|
-
filters:
|
|
160
|
-
sorter:
|
|
136
|
+
filters: void 0,
|
|
137
|
+
sorter: void 0
|
|
161
138
|
}
|
|
162
139
|
});
|
|
163
140
|
};
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
const onReset = refresh => {
|
|
167
|
-
form?.resetFields();
|
|
141
|
+
const onReset = (refresh) => {
|
|
142
|
+
form == null ? void 0 : form.resetFields();
|
|
168
143
|
const newPage = {
|
|
169
144
|
pageNum: 1,
|
|
170
145
|
pageSize: page.pageSize
|
|
@@ -172,27 +147,20 @@ function useAntdTable(service, options, useRequestOptions) {
|
|
|
172
147
|
resetParams();
|
|
173
148
|
if (isResetQuery || refresh) {
|
|
174
149
|
onPageChange(newPage);
|
|
175
|
-
run(
|
|
176
|
-
|
|
177
|
-
|
|
150
|
+
run(
|
|
151
|
+
getTransformParams({
|
|
152
|
+
page: newPage
|
|
153
|
+
})
|
|
154
|
+
);
|
|
178
155
|
}
|
|
179
156
|
};
|
|
180
|
-
|
|
181
|
-
/**
|
|
182
|
-
* 手动触发时,手动调用run
|
|
183
|
-
*/
|
|
184
157
|
useEffect(() => {
|
|
185
|
-
if (!useRequestOptions
|
|
158
|
+
if (!(useRequestOptions == null ? void 0 : useRequestOptions.manual)) {
|
|
186
159
|
onReset(true);
|
|
187
160
|
}
|
|
188
|
-
}, [useRequestOptions
|
|
189
|
-
|
|
190
|
-
/**
|
|
191
|
-
* 手动触发时,手动调用run
|
|
192
|
-
*/
|
|
161
|
+
}, [useRequestOptions == null ? void 0 : useRequestOptions.manual, curExtraParams, curService]);
|
|
193
162
|
useEffect(() => {
|
|
194
|
-
if (!useRequestOptions
|
|
195
|
-
// 当 extraParams 变化时,重置分页和选中状态
|
|
163
|
+
if (!(useRequestOptions == null ? void 0 : useRequestOptions.manual)) {
|
|
196
164
|
onPageChange(initPage);
|
|
197
165
|
setState({
|
|
198
166
|
searchValues: {},
|
|
@@ -200,56 +168,47 @@ function useAntdTable(service, options, useRequestOptions) {
|
|
|
200
168
|
selectedRecords: [],
|
|
201
169
|
selectedRowKeys: [],
|
|
202
170
|
extraFilter: {
|
|
203
|
-
filters:
|
|
204
|
-
sorter:
|
|
171
|
+
filters: void 0,
|
|
172
|
+
sorter: void 0
|
|
205
173
|
}
|
|
206
174
|
});
|
|
207
|
-
run(getTransformParams({
|
|
208
|
-
page: initPage
|
|
209
|
-
}));
|
|
175
|
+
run(getTransformParams({ page: initPage }));
|
|
210
176
|
}
|
|
211
|
-
}, [useRequestOptions
|
|
177
|
+
}, [useRequestOptions == null ? void 0 : useRequestOptions.manual, curExtraParams, curService]);
|
|
212
178
|
useDeepCompareEffect(() => {
|
|
213
179
|
if (allSelected) {
|
|
214
|
-
const filterList = data.filter(item => !selectedRowKeys.includes(item
|
|
180
|
+
const filterList = data.filter((item) => !selectedRowKeys.includes(item == null ? void 0 : item[rowKey]));
|
|
215
181
|
let nextObject = {
|
|
216
182
|
selectedRecords: [...selectedRecords, ...filterList],
|
|
217
|
-
selectedRowKeys: [
|
|
183
|
+
selectedRowKeys: [
|
|
184
|
+
...selectedRowKeys,
|
|
185
|
+
...filterList == null ? void 0 : filterList.map((item) => item == null ? void 0 : item[rowKey])
|
|
186
|
+
]
|
|
218
187
|
};
|
|
219
|
-
if (typeof disabled ===
|
|
220
|
-
const {
|
|
221
|
-
|
|
222
|
-
} = nextObject;
|
|
223
|
-
const nextSelectRecords = selectedRecords.filter(item => {
|
|
224
|
-
// 去掉禁用的
|
|
188
|
+
if (typeof disabled === "function") {
|
|
189
|
+
const { selectedRecords: selectedRecords2 } = nextObject;
|
|
190
|
+
const nextSelectRecords = selectedRecords2.filter((item) => {
|
|
225
191
|
return !disabled(item);
|
|
226
192
|
}) ?? [];
|
|
227
|
-
const nextSelectedRowKeys = nextSelectRecords.map(item => {
|
|
228
|
-
return item
|
|
193
|
+
const nextSelectedRowKeys = nextSelectRecords.map((item) => {
|
|
194
|
+
return item == null ? void 0 : item[rowKey];
|
|
229
195
|
}) ?? [];
|
|
230
|
-
nextObject = {
|
|
231
|
-
selectedRecords: nextSelectRecords,
|
|
232
|
-
selectedRowKeys: nextSelectedRowKeys
|
|
233
|
-
};
|
|
196
|
+
nextObject = { selectedRecords: nextSelectRecords, selectedRowKeys: nextSelectedRowKeys };
|
|
234
197
|
}
|
|
235
198
|
setState(nextObject);
|
|
236
199
|
}
|
|
237
200
|
}, [allSelected, data]);
|
|
238
|
-
|
|
239
|
-
// 释放
|
|
240
201
|
useEffect(() => {
|
|
241
202
|
return () => {
|
|
242
203
|
previousSearchValues = null;
|
|
243
204
|
};
|
|
244
205
|
}, []);
|
|
245
|
-
|
|
246
|
-
// 分页变更
|
|
247
206
|
const handlePageChange = (current, pageSize) => {
|
|
248
|
-
const
|
|
207
|
+
const page2 = {
|
|
249
208
|
pageNum: current,
|
|
250
209
|
pageSize
|
|
251
210
|
};
|
|
252
|
-
onPageChange(
|
|
211
|
+
onPageChange(page2);
|
|
253
212
|
if (!rowSelections && !crossPageSelect) {
|
|
254
213
|
setState({
|
|
255
214
|
selectedRecords: [],
|
|
@@ -258,22 +217,23 @@ function useAntdTable(service, options, useRequestOptions) {
|
|
|
258
217
|
}
|
|
259
218
|
const newValues = form.getFieldsValue() ?? {};
|
|
260
219
|
const nextValues = removeEmptyKeys(newValues);
|
|
261
|
-
run(
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
220
|
+
run(
|
|
221
|
+
getTransformParams({
|
|
222
|
+
page: page2,
|
|
223
|
+
...nextValues,
|
|
224
|
+
...extraFilter
|
|
225
|
+
})
|
|
226
|
+
);
|
|
266
227
|
};
|
|
267
|
-
const handleTableChange = (
|
|
268
|
-
|
|
269
|
-
if (extra.action === 'paginate') {
|
|
228
|
+
const handleTableChange = (pagination2, filters, sorter, extra) => {
|
|
229
|
+
if (extra.action === "paginate") {
|
|
270
230
|
return;
|
|
271
231
|
}
|
|
272
|
-
const
|
|
273
|
-
pageNum:
|
|
274
|
-
pageSize:
|
|
232
|
+
const page2 = {
|
|
233
|
+
pageNum: pagination2.current,
|
|
234
|
+
pageSize: pagination2.pageSize
|
|
275
235
|
};
|
|
276
|
-
onPageChange(
|
|
236
|
+
onPageChange(page2);
|
|
277
237
|
setState({
|
|
278
238
|
selectedRecords: [],
|
|
279
239
|
selectedRowKeys: [],
|
|
@@ -282,28 +242,26 @@ function useAntdTable(service, options, useRequestOptions) {
|
|
|
282
242
|
sorter
|
|
283
243
|
}
|
|
284
244
|
});
|
|
285
|
-
const _values = form
|
|
286
|
-
run(
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
245
|
+
const _values = (form == null ? void 0 : form.getFieldsValue()) ?? {};
|
|
246
|
+
run(
|
|
247
|
+
getTransformParams({
|
|
248
|
+
page: page2,
|
|
249
|
+
..._values,
|
|
250
|
+
filters,
|
|
251
|
+
sorter
|
|
252
|
+
})
|
|
253
|
+
);
|
|
292
254
|
};
|
|
293
|
-
const onSearch = values => {
|
|
255
|
+
const onSearch = (values) => {
|
|
294
256
|
const newPage = {
|
|
295
257
|
pageNum: 1,
|
|
296
258
|
pageSize: page.pageSize
|
|
297
259
|
};
|
|
298
260
|
const _values = removeEmptyKeys(values);
|
|
299
|
-
|
|
300
|
-
// 如果 previousPage 存在且与 page 不相等,则触发页面变化
|
|
301
|
-
if (previousPage && !_isEqual(previousPage, page)) {
|
|
261
|
+
if (previousPage && !isEqual(previousPage, page)) {
|
|
302
262
|
onPageChange(newPage);
|
|
303
263
|
}
|
|
304
|
-
|
|
305
|
-
// 减少查询按钮的渲染,只有需要重置值时才需要调用
|
|
306
|
-
if (selectedRecords?.length || isNonEmptyObject(_values) || !_isEqual(previousSearchValues, _values)) {
|
|
264
|
+
if ((selectedRecords == null ? void 0 : selectedRecords.length) || isNonEmptyObject(_values) || !isEqual(previousSearchValues, _values)) {
|
|
307
265
|
previousSearchValues = _values;
|
|
308
266
|
setState({
|
|
309
267
|
searchValues: _values,
|
|
@@ -312,27 +270,29 @@ function useAntdTable(service, options, useRequestOptions) {
|
|
|
312
270
|
selectedRowKeys: []
|
|
313
271
|
});
|
|
314
272
|
}
|
|
315
|
-
run(
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
273
|
+
run(
|
|
274
|
+
getTransformParams({
|
|
275
|
+
page: newPage,
|
|
276
|
+
...extraFilter,
|
|
277
|
+
..._values
|
|
278
|
+
})
|
|
279
|
+
);
|
|
320
280
|
};
|
|
321
|
-
const refreshPage = res => {
|
|
281
|
+
const refreshPage = (res) => {
|
|
322
282
|
const transformResult = transformResponse ? transformResponse(res) : res || {};
|
|
323
|
-
const {
|
|
324
|
-
|
|
325
|
-
} = isListResult(transformResult) ? transformResult : transformResult?.data || {};
|
|
326
|
-
const totalPage = Math.floor((total + page.pageSize - 1) / page.pageSize) || 1;
|
|
283
|
+
const { total: total2 = 0 } = isListResult(transformResult) ? transformResult : (transformResult == null ? void 0 : transformResult.data) || {};
|
|
284
|
+
const totalPage = Math.floor((total2 + page.pageSize - 1) / page.pageSize) || 1;
|
|
327
285
|
if (page.pageNum > totalPage) {
|
|
328
286
|
const newPage = {
|
|
329
287
|
pageNum: totalPage,
|
|
330
288
|
pageSize: page.pageSize
|
|
331
289
|
};
|
|
332
290
|
onPageChange(newPage);
|
|
333
|
-
run(
|
|
334
|
-
|
|
335
|
-
|
|
291
|
+
run(
|
|
292
|
+
getTransformParams({
|
|
293
|
+
page: newPage
|
|
294
|
+
})
|
|
295
|
+
);
|
|
336
296
|
}
|
|
337
297
|
};
|
|
338
298
|
const handleRefresh = async () => {
|
|
@@ -344,50 +304,48 @@ function useAntdTable(service, options, useRequestOptions) {
|
|
|
344
304
|
const res = await refreshAsync();
|
|
345
305
|
refreshPage(res);
|
|
346
306
|
};
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
selectedRowKeys: []
|
|
381
|
-
});
|
|
307
|
+
const defaultSelections = [
|
|
308
|
+
{
|
|
309
|
+
key: "currentPage",
|
|
310
|
+
text: formatMessage((_b = (_a = locale) == null ? void 0 : _a.ProTable) == null ? void 0 : _b.selectCurPage, { total: (data == null ? void 0 : data.length) || 0 }),
|
|
311
|
+
onSelect: (changeableRowKeys) => {
|
|
312
|
+
setState({
|
|
313
|
+
allSelected: false,
|
|
314
|
+
selectedRecords: [...data],
|
|
315
|
+
selectedRowKeys: changeableRowKeys
|
|
316
|
+
});
|
|
317
|
+
}
|
|
318
|
+
},
|
|
319
|
+
{
|
|
320
|
+
key: "all",
|
|
321
|
+
text: formatMessage((_d = (_c = locale) == null ? void 0 : _c.ProTable) == null ? void 0 : _d.selectAll, { total }),
|
|
322
|
+
onSelect: async (changeableRowKeys) => {
|
|
323
|
+
setState({
|
|
324
|
+
allSelected: true,
|
|
325
|
+
selectedRecords: [...data],
|
|
326
|
+
selectedRowKeys: changeableRowKeys
|
|
327
|
+
});
|
|
328
|
+
}
|
|
329
|
+
},
|
|
330
|
+
{
|
|
331
|
+
key: "uncheckAll",
|
|
332
|
+
text: (_f = (_e = locale) == null ? void 0 : _e.ProTable) == null ? void 0 : _f.deselect,
|
|
333
|
+
onSelect: async () => {
|
|
334
|
+
setState({
|
|
335
|
+
allSelected: false,
|
|
336
|
+
selectedRecords: [],
|
|
337
|
+
selectedRowKeys: []
|
|
338
|
+
});
|
|
339
|
+
}
|
|
382
340
|
}
|
|
383
|
-
|
|
341
|
+
];
|
|
384
342
|
const selections = useMemo(() => {
|
|
385
343
|
if (rowSelections === true) {
|
|
386
344
|
return defaultSelections;
|
|
387
345
|
}
|
|
388
346
|
if (Array.isArray(rowSelections)) {
|
|
389
|
-
return rowSelections.map(item => {
|
|
390
|
-
if (typeof item ===
|
|
347
|
+
return rowSelections.map((item) => {
|
|
348
|
+
if (typeof item === "string") {
|
|
391
349
|
if (item === CURRENT_PAGE) {
|
|
392
350
|
return defaultSelections[0];
|
|
393
351
|
}
|
|
@@ -406,18 +364,24 @@ function useAntdTable(service, options, useRequestOptions) {
|
|
|
406
364
|
const _rowSelection = {
|
|
407
365
|
fixed: true,
|
|
408
366
|
type: rowSelectType,
|
|
409
|
-
columnWidth: rowSelections ? 64 :
|
|
367
|
+
columnWidth: rowSelections ? 64 : void 0,
|
|
410
368
|
selectedRowKeys,
|
|
411
369
|
onChange(rowKeys, rows) {
|
|
370
|
+
var _a2, _b2, _c2;
|
|
412
371
|
if (crossPageSelect) {
|
|
413
|
-
const removeKeys = data
|
|
414
|
-
const newSelectedKeys = Array.from(new Set([...selectedRowKeys, ...rowKeys]))
|
|
415
|
-
|
|
416
|
-
|
|
372
|
+
const removeKeys = (_a2 = data == null ? void 0 : data.map((item) => item == null ? void 0 : item[rowKey])) == null ? void 0 : _a2.filter((key) => !rowKeys.includes(key));
|
|
373
|
+
const newSelectedKeys = (_b2 = Array.from(/* @__PURE__ */ new Set([...selectedRowKeys, ...rowKeys]))) == null ? void 0 : _b2.filter(
|
|
374
|
+
(item) => !removeKeys.includes(item)
|
|
375
|
+
);
|
|
376
|
+
const selectedRecordObj = (_c2 = [
|
|
377
|
+
...selectedRecords,
|
|
378
|
+
...rows
|
|
379
|
+
]) == null ? void 0 : _c2.reduce((acc, cur) => {
|
|
380
|
+
acc[cur == null ? void 0 : cur[rowKey]] = cur;
|
|
417
381
|
return acc;
|
|
418
382
|
}, {});
|
|
419
383
|
setState({
|
|
420
|
-
selectedRecords: newSelectedKeys
|
|
384
|
+
selectedRecords: newSelectedKeys == null ? void 0 : newSelectedKeys.map((item) => selectedRecordObj == null ? void 0 : selectedRecordObj[String(item)]),
|
|
421
385
|
selectedRowKeys: newSelectedKeys
|
|
422
386
|
});
|
|
423
387
|
} else {
|
|
@@ -427,7 +391,7 @@ function useAntdTable(service, options, useRequestOptions) {
|
|
|
427
391
|
});
|
|
428
392
|
}
|
|
429
393
|
},
|
|
430
|
-
onSelectAll: selected => {
|
|
394
|
+
onSelectAll: (selected) => {
|
|
431
395
|
if (rowSelections && allSelected && !selected) {
|
|
432
396
|
setState({
|
|
433
397
|
allSelected: false,
|
|
@@ -436,29 +400,28 @@ function useAntdTable(service, options, useRequestOptions) {
|
|
|
436
400
|
});
|
|
437
401
|
}
|
|
438
402
|
},
|
|
439
|
-
getCheckboxProps: record => ({
|
|
440
|
-
className: allSelected && rowSelections ?
|
|
403
|
+
getCheckboxProps: (record) => ({
|
|
404
|
+
className: allSelected && rowSelections ? "checkbox-disabled" : ""
|
|
441
405
|
}),
|
|
442
406
|
selections
|
|
443
407
|
};
|
|
444
|
-
const rowSelection =
|
|
445
|
-
if (
|
|
446
|
-
// getCheckboxProps需要特殊兼容原有的逻辑,特殊处理
|
|
408
|
+
const rowSelection = isObject(returnRowSelection) ? merge({}, _rowSelection, returnRowSelection) : _rowSelection;
|
|
409
|
+
if (isObject(returnRowSelection)) {
|
|
447
410
|
const customGetCheckboxProps = returnRowSelection.getCheckboxProps;
|
|
448
|
-
if (typeof customGetCheckboxProps ===
|
|
449
|
-
rowSelection.getCheckboxProps = record => {
|
|
411
|
+
if (typeof customGetCheckboxProps === "function") {
|
|
412
|
+
rowSelection.getCheckboxProps = (record) => {
|
|
450
413
|
const internalProps = _rowSelection.getCheckboxProps(record);
|
|
451
414
|
const customProps = customGetCheckboxProps(record) ?? {};
|
|
452
415
|
return {
|
|
453
416
|
...internalProps,
|
|
454
417
|
...customProps,
|
|
455
|
-
className: [customProps.className, internalProps.className].filter(Boolean).join(
|
|
418
|
+
className: [customProps.className, internalProps.className].filter(Boolean).join(" ")
|
|
456
419
|
};
|
|
457
420
|
};
|
|
458
421
|
}
|
|
459
422
|
}
|
|
460
|
-
const selectedTip = allSelected && selectedRowKeys.length ? formatMessage(locale
|
|
461
|
-
total: allSelected ? total : selectedRowKeys
|
|
423
|
+
const selectedTip = allSelected && selectedRowKeys.length ? formatMessage((_h = (_g = locale) == null ? void 0 : _g.ProTable) == null ? void 0 : _h.selectAll, {
|
|
424
|
+
total: allSelected ? total : selectedRowKeys == null ? void 0 : selectedRowKeys.length
|
|
462
425
|
}) : null;
|
|
463
426
|
const pagination = {
|
|
464
427
|
current: page.pageNum,
|
|
@@ -467,11 +430,11 @@ function useAntdTable(service, options, useRequestOptions) {
|
|
|
467
430
|
showQuickJumper: true,
|
|
468
431
|
onPaginationChange: true,
|
|
469
432
|
total,
|
|
470
|
-
showTotal:
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
});
|
|
433
|
+
showTotal: (total2) => {
|
|
434
|
+
var _a2, _b2;
|
|
435
|
+
if (!total2)
|
|
436
|
+
return;
|
|
437
|
+
return formatMessage((_b2 = (_a2 = locale) == null ? void 0 : _a2.ProTable) == null ? void 0 : _b2.total, { total: total2 });
|
|
475
438
|
},
|
|
476
439
|
onShowSizeChange: handlePageChange,
|
|
477
440
|
onChange: handlePageChange
|
|
@@ -480,22 +443,22 @@ function useAntdTable(service, options, useRequestOptions) {
|
|
|
480
443
|
...result,
|
|
481
444
|
form,
|
|
482
445
|
data,
|
|
483
|
-
params: result
|
|
446
|
+
params: ((_i = result == null ? void 0 : result.params) == null ? void 0 : _i[0]) || {},
|
|
484
447
|
rowSelection,
|
|
485
|
-
searchValues: form
|
|
448
|
+
searchValues: (form == null ? void 0 : form.getFieldsValue()) ?? {},
|
|
486
449
|
allSelected,
|
|
487
450
|
selectedTip,
|
|
488
451
|
selectedRowKeys,
|
|
489
452
|
selectedRecords,
|
|
490
453
|
clearSelected,
|
|
491
|
-
setSelectedRowKeys:
|
|
454
|
+
setSelectedRowKeys: (selectedRowKeys2) => {
|
|
492
455
|
setState({
|
|
493
|
-
selectedRowKeys
|
|
456
|
+
selectedRowKeys: selectedRowKeys2
|
|
494
457
|
});
|
|
495
458
|
},
|
|
496
|
-
setSelectedRecords:
|
|
459
|
+
setSelectedRecords: (selectedRecords2) => {
|
|
497
460
|
setState({
|
|
498
|
-
selectedRecords
|
|
461
|
+
selectedRecords: selectedRecords2
|
|
499
462
|
});
|
|
500
463
|
},
|
|
501
464
|
pagination,
|
|
@@ -506,16 +469,19 @@ function useAntdTable(service, options, useRequestOptions) {
|
|
|
506
469
|
rowKey,
|
|
507
470
|
loading: result.loading,
|
|
508
471
|
dataSource: data,
|
|
509
|
-
rowSelection: returnRowSelection || rowSelections ? rowSelection :
|
|
472
|
+
rowSelection: returnRowSelection || rowSelections ? rowSelection : void 0,
|
|
510
473
|
pagination,
|
|
511
474
|
onChange: handleTableChange
|
|
512
475
|
},
|
|
513
476
|
handleSetStateCallback
|
|
514
477
|
};
|
|
515
|
-
useAntdTableProps.tableProps.formTableProps = {
|
|
516
|
-
..._omit(useAntdTableProps, 'tableProps'),
|
|
517
|
-
form
|
|
518
|
-
};
|
|
478
|
+
useAntdTableProps.tableProps.formTableProps = { ...omit(useAntdTableProps, "tableProps"), form };
|
|
519
479
|
return useAntdTableProps;
|
|
520
480
|
}
|
|
521
|
-
|
|
481
|
+
var useAntdTable_default = useAntdTable;
|
|
482
|
+
export {
|
|
483
|
+
CURRENT_PAGE,
|
|
484
|
+
SELECTION_ALL,
|
|
485
|
+
UNCHECK_ALL,
|
|
486
|
+
useAntdTable_default as default
|
|
487
|
+
};
|