@zat-design/sisyphus-react 4.5.9 → 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/dist/index.esm.css +1 -1
- package/dist/less.esm.css +1 -1
- 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.d.ts +2 -1
- package/es/ProDownload/index.js +74 -69
- package/es/ProDownload/propsType.js +0 -1
- package/es/ProDownload/utils.d.ts +10 -5
- package/es/ProDownload/utils.js +63 -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 +154 -235
- 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 +182 -212
- 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 -102
- package/es/ProForm/components/combination/FormList/components/Empty.js +28 -55
- 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/style/index.less +6 -0
- 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 +106 -213
- package/es/ProForm/components/combination/Group/hooks/index.js +69 -129
- 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 +72 -70
- package/es/ProForm/components/combination/ProModalSelect/index.js +309 -347
- 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 +62 -134
- 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 +160 -235
- 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 +113 -139
- 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 -24
- 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 -84
- 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 -63
- 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 +320 -350
- package/es/ProLayout/components/TabsManager/hooks/useTabsUrlSync.d.ts +19 -0
- package/es/ProLayout/components/TabsManager/hooks/useTabsUrlSync.js +332 -0
- package/es/ProLayout/components/TabsManager/index.js +407 -351
- package/es/ProLayout/components/TabsManager/propTypes.d.ts +4 -0
- package/es/ProLayout/components/TabsManager/propTypes.js +7 -15
- package/es/ProLayout/components/TabsManager/style/index.less +1 -1
- package/es/ProLayout/components/TabsManager/utils/historyObserver.d.ts +7 -0
- package/es/ProLayout/components/TabsManager/utils/historyObserver.js +65 -0
- package/es/ProLayout/components/TabsManager/utils/index.d.ts +15 -2
- package/es/ProLayout/components/TabsManager/utils/index.js +156 -159
- package/es/ProLayout/components/index.js +8 -3
- package/es/ProLayout/index.js +173 -228
- package/es/ProLayout/propTypes.d.ts +28 -1
- 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 +187 -223
- package/es/ProSelect/propsType.js +0 -1
- package/es/ProSelect/style/index.less +13 -0
- 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/style/index.less +1 -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 +191 -224
- 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 +41 -58
- 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 -168
- 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 +255 -459
- 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 -438
- 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 -148
- 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 -2
- package/es/ProConfigProvider/demo/locale.js +0 -58
|
@@ -1,45 +1,40 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import { Form, message } from 'antd';
|
|
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";
|
|
10
9
|
import { defaultPage } from "../index";
|
|
11
10
|
import { isListResult, removeEmptyKeys, isNonEmptyObject } from "../utils";
|
|
12
11
|
import locale, { formatMessage } from "../../locale";
|
|
13
|
-
const useDefaultOptions = options => {
|
|
14
|
-
const [page, onPageChange] = useState(options
|
|
12
|
+
const useDefaultOptions = (options) => {
|
|
13
|
+
const [page, onPageChange] = useState((options == null ? void 0 : options.page) || defaultPage);
|
|
15
14
|
return {
|
|
16
15
|
...options,
|
|
17
|
-
rowSelectType: options
|
|
16
|
+
rowSelectType: (options == null ? void 0 : options.rowSelectType) || "checkbox",
|
|
18
17
|
page,
|
|
19
|
-
onPageChange: options
|
|
18
|
+
onPageChange: (options == null ? void 0 : options.onPageChange) || onPageChange
|
|
20
19
|
};
|
|
21
20
|
};
|
|
22
21
|
let previousSearchValues = null;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
const SELECTION_ALL = "SELECTION_ALL";
|
|
23
|
+
const CURRENT_PAGE = "CURRENT_PAGE";
|
|
24
|
+
const UNCHECK_ALL = "UNCHECK_ALL";
|
|
26
25
|
function useAntdTable(service, options, useRequestOptions) {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
total,
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
extraFilter,
|
|
33
|
-
allSelected,
|
|
34
|
-
searchValues
|
|
35
|
-
}, 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({
|
|
36
31
|
data: [],
|
|
37
32
|
total: 0,
|
|
38
33
|
selectedRecords: [],
|
|
39
34
|
selectedRowKeys: [],
|
|
40
35
|
extraFilter: {
|
|
41
|
-
filters:
|
|
42
|
-
sorter:
|
|
36
|
+
filters: void 0,
|
|
37
|
+
sorter: void 0
|
|
43
38
|
},
|
|
44
39
|
allSelected: false,
|
|
45
40
|
searchValues: {}
|
|
@@ -60,32 +55,25 @@ function useAntdTable(service, options, useRequestOptions) {
|
|
|
60
55
|
disabled
|
|
61
56
|
} = useDefaultOptions(options);
|
|
62
57
|
const [form] = Form.useForm(_form);
|
|
63
|
-
const {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
const defaultParam = Array.isArray(defaultParams) ? defaultParams?.[0] : defaultParams || {};
|
|
67
|
-
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;
|
|
68
61
|
const previousPage = usePrevious(page || defaultPage);
|
|
69
|
-
const getTransformParams = params => {
|
|
62
|
+
const getTransformParams = (params) => {
|
|
70
63
|
const realParams = {
|
|
71
64
|
...defaultParam,
|
|
72
65
|
...extraParams,
|
|
73
66
|
...params
|
|
74
67
|
};
|
|
75
|
-
const {
|
|
76
|
-
page = initPage,
|
|
77
|
-
filters,
|
|
78
|
-
sorter,
|
|
79
|
-
...otherParams
|
|
80
|
-
} = realParams;
|
|
68
|
+
const { page: page2 = initPage, filters, sorter, ...otherParams } = realParams;
|
|
81
69
|
const queryBean = {
|
|
82
|
-
filters: JSON.stringify(filters) ===
|
|
83
|
-
sorter: JSON.stringify(sorter) ===
|
|
70
|
+
filters: JSON.stringify(filters) === "{}" ? void 0 : filters,
|
|
71
|
+
sorter: JSON.stringify(sorter) === "{}" ? void 0 : sorter,
|
|
84
72
|
...otherParams
|
|
85
73
|
};
|
|
86
74
|
const requestParams = {
|
|
87
|
-
...
|
|
88
|
-
queryBean:
|
|
75
|
+
...page2,
|
|
76
|
+
queryBean: pickBy(queryBean, (item) => item !== void 0) ?? {}
|
|
89
77
|
};
|
|
90
78
|
if (transformParams) {
|
|
91
79
|
const mergedParams = {
|
|
@@ -96,9 +84,7 @@ function useAntdTable(service, options, useRequestOptions) {
|
|
|
96
84
|
}
|
|
97
85
|
return requestParams;
|
|
98
86
|
};
|
|
99
|
-
|
|
100
|
-
// 仅清数据源相关,查询相关
|
|
101
|
-
const handleSetStateCallback = values => {
|
|
87
|
+
const handleSetStateCallback = (values) => {
|
|
102
88
|
setState({
|
|
103
89
|
data: [],
|
|
104
90
|
total: 0,
|
|
@@ -112,37 +98,27 @@ function useAntdTable(service, options, useRequestOptions) {
|
|
|
112
98
|
const curExtraParams = useMemo(() => {
|
|
113
99
|
return extraParams ? JSON.stringify(extraParams) : extraParams;
|
|
114
100
|
}, [extraParams]);
|
|
115
|
-
|
|
116
|
-
// 调接口
|
|
117
101
|
const result = useRequest(service, {
|
|
118
102
|
debounceWait: 300,
|
|
119
103
|
...useRequestOptions,
|
|
120
104
|
defaultParams: [getTransformParams()],
|
|
121
105
|
onSuccess: (res, params) => {
|
|
106
|
+
var _a2, _b2;
|
|
122
107
|
const transformResult = transformResponse ? transformResponse(res) : res || {};
|
|
123
|
-
const {
|
|
124
|
-
list = [],
|
|
125
|
-
total = 0
|
|
126
|
-
} = isListResult(transformResult) ? transformResult : transformResult?.data || {};
|
|
108
|
+
const { list = [], total: total2 = 0 } = isListResult(transformResult) ? transformResult : (transformResult == null ? void 0 : transformResult.data) || {};
|
|
127
109
|
if (list !== null && !Array.isArray(list)) {
|
|
128
|
-
return message.error(locale
|
|
110
|
+
return message.error((_b2 = (_a2 = locale) == null ? void 0 : _a2.ProTable) == null ? void 0 : _b2.transformResponseMsg);
|
|
129
111
|
}
|
|
130
112
|
setState({
|
|
131
|
-
total,
|
|
113
|
+
total: total2,
|
|
132
114
|
data: list || []
|
|
133
115
|
});
|
|
134
|
-
if (useRequestOptions
|
|
116
|
+
if (useRequestOptions == null ? void 0 : useRequestOptions.onSuccess) {
|
|
135
117
|
useRequestOptions.onSuccess(res, params);
|
|
136
118
|
}
|
|
137
119
|
}
|
|
138
120
|
});
|
|
139
|
-
const {
|
|
140
|
-
run,
|
|
141
|
-
refreshAsync
|
|
142
|
-
} = result;
|
|
143
|
-
|
|
144
|
-
// service变化时触发 (禁止掉防止service变更时导致的死循环)
|
|
145
|
-
|
|
121
|
+
const { run, refreshAsync } = result;
|
|
146
122
|
const clearSelected = () => {
|
|
147
123
|
setState({
|
|
148
124
|
allSelected: false,
|
|
@@ -157,15 +133,13 @@ function useAntdTable(service, options, useRequestOptions) {
|
|
|
157
133
|
selectedRecords: [],
|
|
158
134
|
selectedRowKeys: [],
|
|
159
135
|
extraFilter: {
|
|
160
|
-
filters:
|
|
161
|
-
sorter:
|
|
136
|
+
filters: void 0,
|
|
137
|
+
sorter: void 0
|
|
162
138
|
}
|
|
163
139
|
});
|
|
164
140
|
};
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
const onReset = refresh => {
|
|
168
|
-
form?.resetFields();
|
|
141
|
+
const onReset = (refresh) => {
|
|
142
|
+
form == null ? void 0 : form.resetFields();
|
|
169
143
|
const newPage = {
|
|
170
144
|
pageNum: 1,
|
|
171
145
|
pageSize: page.pageSize
|
|
@@ -173,27 +147,20 @@ function useAntdTable(service, options, useRequestOptions) {
|
|
|
173
147
|
resetParams();
|
|
174
148
|
if (isResetQuery || refresh) {
|
|
175
149
|
onPageChange(newPage);
|
|
176
|
-
run(
|
|
177
|
-
|
|
178
|
-
|
|
150
|
+
run(
|
|
151
|
+
getTransformParams({
|
|
152
|
+
page: newPage
|
|
153
|
+
})
|
|
154
|
+
);
|
|
179
155
|
}
|
|
180
156
|
};
|
|
181
|
-
|
|
182
|
-
/**
|
|
183
|
-
* 手动触发时,手动调用run
|
|
184
|
-
*/
|
|
185
157
|
useEffect(() => {
|
|
186
|
-
if (!useRequestOptions
|
|
158
|
+
if (!(useRequestOptions == null ? void 0 : useRequestOptions.manual)) {
|
|
187
159
|
onReset(true);
|
|
188
160
|
}
|
|
189
|
-
}, [useRequestOptions
|
|
190
|
-
|
|
191
|
-
/**
|
|
192
|
-
* 手动触发时,手动调用run
|
|
193
|
-
*/
|
|
161
|
+
}, [useRequestOptions == null ? void 0 : useRequestOptions.manual, curExtraParams, curService]);
|
|
194
162
|
useEffect(() => {
|
|
195
|
-
if (!useRequestOptions
|
|
196
|
-
// 当 extraParams 变化时,重置分页和选中状态
|
|
163
|
+
if (!(useRequestOptions == null ? void 0 : useRequestOptions.manual)) {
|
|
197
164
|
onPageChange(initPage);
|
|
198
165
|
setState({
|
|
199
166
|
searchValues: {},
|
|
@@ -201,56 +168,47 @@ function useAntdTable(service, options, useRequestOptions) {
|
|
|
201
168
|
selectedRecords: [],
|
|
202
169
|
selectedRowKeys: [],
|
|
203
170
|
extraFilter: {
|
|
204
|
-
filters:
|
|
205
|
-
sorter:
|
|
171
|
+
filters: void 0,
|
|
172
|
+
sorter: void 0
|
|
206
173
|
}
|
|
207
174
|
});
|
|
208
|
-
run(getTransformParams({
|
|
209
|
-
page: initPage
|
|
210
|
-
}));
|
|
175
|
+
run(getTransformParams({ page: initPage }));
|
|
211
176
|
}
|
|
212
|
-
}, [useRequestOptions
|
|
177
|
+
}, [useRequestOptions == null ? void 0 : useRequestOptions.manual, curExtraParams, curService]);
|
|
213
178
|
useDeepCompareEffect(() => {
|
|
214
179
|
if (allSelected) {
|
|
215
|
-
const filterList = data.filter(item => !selectedRowKeys.includes(item
|
|
180
|
+
const filterList = data.filter((item) => !selectedRowKeys.includes(item == null ? void 0 : item[rowKey]));
|
|
216
181
|
let nextObject = {
|
|
217
182
|
selectedRecords: [...selectedRecords, ...filterList],
|
|
218
|
-
selectedRowKeys: [
|
|
183
|
+
selectedRowKeys: [
|
|
184
|
+
...selectedRowKeys,
|
|
185
|
+
...filterList == null ? void 0 : filterList.map((item) => item == null ? void 0 : item[rowKey])
|
|
186
|
+
]
|
|
219
187
|
};
|
|
220
|
-
if (typeof disabled ===
|
|
221
|
-
const {
|
|
222
|
-
|
|
223
|
-
} = nextObject;
|
|
224
|
-
const nextSelectRecords = selectedRecords.filter(item => {
|
|
225
|
-
// 去掉禁用的
|
|
188
|
+
if (typeof disabled === "function") {
|
|
189
|
+
const { selectedRecords: selectedRecords2 } = nextObject;
|
|
190
|
+
const nextSelectRecords = selectedRecords2.filter((item) => {
|
|
226
191
|
return !disabled(item);
|
|
227
192
|
}) ?? [];
|
|
228
|
-
const nextSelectedRowKeys = nextSelectRecords.map(item => {
|
|
229
|
-
return item
|
|
193
|
+
const nextSelectedRowKeys = nextSelectRecords.map((item) => {
|
|
194
|
+
return item == null ? void 0 : item[rowKey];
|
|
230
195
|
}) ?? [];
|
|
231
|
-
nextObject = {
|
|
232
|
-
selectedRecords: nextSelectRecords,
|
|
233
|
-
selectedRowKeys: nextSelectedRowKeys
|
|
234
|
-
};
|
|
196
|
+
nextObject = { selectedRecords: nextSelectRecords, selectedRowKeys: nextSelectedRowKeys };
|
|
235
197
|
}
|
|
236
198
|
setState(nextObject);
|
|
237
199
|
}
|
|
238
200
|
}, [allSelected, data]);
|
|
239
|
-
|
|
240
|
-
// 释放
|
|
241
201
|
useEffect(() => {
|
|
242
202
|
return () => {
|
|
243
203
|
previousSearchValues = null;
|
|
244
204
|
};
|
|
245
205
|
}, []);
|
|
246
|
-
|
|
247
|
-
// 分页变更
|
|
248
206
|
const handlePageChange = (current, pageSize) => {
|
|
249
|
-
const
|
|
207
|
+
const page2 = {
|
|
250
208
|
pageNum: current,
|
|
251
209
|
pageSize
|
|
252
210
|
};
|
|
253
|
-
onPageChange(
|
|
211
|
+
onPageChange(page2);
|
|
254
212
|
if (!rowSelections && !crossPageSelect) {
|
|
255
213
|
setState({
|
|
256
214
|
selectedRecords: [],
|
|
@@ -259,22 +217,23 @@ function useAntdTable(service, options, useRequestOptions) {
|
|
|
259
217
|
}
|
|
260
218
|
const newValues = form.getFieldsValue() ?? {};
|
|
261
219
|
const nextValues = removeEmptyKeys(newValues);
|
|
262
|
-
run(
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
220
|
+
run(
|
|
221
|
+
getTransformParams({
|
|
222
|
+
page: page2,
|
|
223
|
+
...nextValues,
|
|
224
|
+
...extraFilter
|
|
225
|
+
})
|
|
226
|
+
);
|
|
267
227
|
};
|
|
268
|
-
const handleTableChange = (
|
|
269
|
-
|
|
270
|
-
if (extra.action === 'paginate') {
|
|
228
|
+
const handleTableChange = (pagination2, filters, sorter, extra) => {
|
|
229
|
+
if (extra.action === "paginate") {
|
|
271
230
|
return;
|
|
272
231
|
}
|
|
273
|
-
const
|
|
274
|
-
pageNum:
|
|
275
|
-
pageSize:
|
|
232
|
+
const page2 = {
|
|
233
|
+
pageNum: pagination2.current,
|
|
234
|
+
pageSize: pagination2.pageSize
|
|
276
235
|
};
|
|
277
|
-
onPageChange(
|
|
236
|
+
onPageChange(page2);
|
|
278
237
|
setState({
|
|
279
238
|
selectedRecords: [],
|
|
280
239
|
selectedRowKeys: [],
|
|
@@ -283,28 +242,26 @@ function useAntdTable(service, options, useRequestOptions) {
|
|
|
283
242
|
sorter
|
|
284
243
|
}
|
|
285
244
|
});
|
|
286
|
-
const _values = form
|
|
287
|
-
run(
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
245
|
+
const _values = (form == null ? void 0 : form.getFieldsValue()) ?? {};
|
|
246
|
+
run(
|
|
247
|
+
getTransformParams({
|
|
248
|
+
page: page2,
|
|
249
|
+
..._values,
|
|
250
|
+
filters,
|
|
251
|
+
sorter
|
|
252
|
+
})
|
|
253
|
+
);
|
|
293
254
|
};
|
|
294
|
-
const onSearch = values => {
|
|
255
|
+
const onSearch = (values) => {
|
|
295
256
|
const newPage = {
|
|
296
257
|
pageNum: 1,
|
|
297
258
|
pageSize: page.pageSize
|
|
298
259
|
};
|
|
299
260
|
const _values = removeEmptyKeys(values);
|
|
300
|
-
|
|
301
|
-
// 如果 previousPage 存在且与 page 不相等,则触发页面变化
|
|
302
|
-
if (previousPage && !_isEqual(previousPage, page)) {
|
|
261
|
+
if (previousPage && !isEqual(previousPage, page)) {
|
|
303
262
|
onPageChange(newPage);
|
|
304
263
|
}
|
|
305
|
-
|
|
306
|
-
// 减少查询按钮的渲染,只有需要重置值时才需要调用
|
|
307
|
-
if (selectedRecords?.length || isNonEmptyObject(_values) || !_isEqual(previousSearchValues, _values)) {
|
|
264
|
+
if ((selectedRecords == null ? void 0 : selectedRecords.length) || isNonEmptyObject(_values) || !isEqual(previousSearchValues, _values)) {
|
|
308
265
|
previousSearchValues = _values;
|
|
309
266
|
setState({
|
|
310
267
|
searchValues: _values,
|
|
@@ -313,27 +270,29 @@ function useAntdTable(service, options, useRequestOptions) {
|
|
|
313
270
|
selectedRowKeys: []
|
|
314
271
|
});
|
|
315
272
|
}
|
|
316
|
-
run(
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
273
|
+
run(
|
|
274
|
+
getTransformParams({
|
|
275
|
+
page: newPage,
|
|
276
|
+
...extraFilter,
|
|
277
|
+
..._values
|
|
278
|
+
})
|
|
279
|
+
);
|
|
321
280
|
};
|
|
322
|
-
const refreshPage = res => {
|
|
281
|
+
const refreshPage = (res) => {
|
|
323
282
|
const transformResult = transformResponse ? transformResponse(res) : res || {};
|
|
324
|
-
const {
|
|
325
|
-
|
|
326
|
-
} = isListResult(transformResult) ? transformResult : transformResult?.data || {};
|
|
327
|
-
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;
|
|
328
285
|
if (page.pageNum > totalPage) {
|
|
329
286
|
const newPage = {
|
|
330
287
|
pageNum: totalPage,
|
|
331
288
|
pageSize: page.pageSize
|
|
332
289
|
};
|
|
333
290
|
onPageChange(newPage);
|
|
334
|
-
run(
|
|
335
|
-
|
|
336
|
-
|
|
291
|
+
run(
|
|
292
|
+
getTransformParams({
|
|
293
|
+
page: newPage
|
|
294
|
+
})
|
|
295
|
+
);
|
|
337
296
|
}
|
|
338
297
|
};
|
|
339
298
|
const handleRefresh = async () => {
|
|
@@ -345,50 +304,48 @@ function useAntdTable(service, options, useRequestOptions) {
|
|
|
345
304
|
const res = await refreshAsync();
|
|
346
305
|
refreshPage(res);
|
|
347
306
|
};
|
|
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
|
-
|
|
381
|
-
selectedRowKeys: []
|
|
382
|
-
});
|
|
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
|
+
}
|
|
383
340
|
}
|
|
384
|
-
|
|
341
|
+
];
|
|
385
342
|
const selections = useMemo(() => {
|
|
386
343
|
if (rowSelections === true) {
|
|
387
344
|
return defaultSelections;
|
|
388
345
|
}
|
|
389
346
|
if (Array.isArray(rowSelections)) {
|
|
390
|
-
return rowSelections.map(item => {
|
|
391
|
-
if (typeof item ===
|
|
347
|
+
return rowSelections.map((item) => {
|
|
348
|
+
if (typeof item === "string") {
|
|
392
349
|
if (item === CURRENT_PAGE) {
|
|
393
350
|
return defaultSelections[0];
|
|
394
351
|
}
|
|
@@ -407,18 +364,24 @@ function useAntdTable(service, options, useRequestOptions) {
|
|
|
407
364
|
const _rowSelection = {
|
|
408
365
|
fixed: true,
|
|
409
366
|
type: rowSelectType,
|
|
410
|
-
columnWidth: rowSelections ? 64 :
|
|
367
|
+
columnWidth: rowSelections ? 64 : void 0,
|
|
411
368
|
selectedRowKeys,
|
|
412
369
|
onChange(rowKeys, rows) {
|
|
370
|
+
var _a2, _b2, _c2;
|
|
413
371
|
if (crossPageSelect) {
|
|
414
|
-
const removeKeys = data
|
|
415
|
-
const newSelectedKeys = Array.from(new Set([...selectedRowKeys, ...rowKeys]))
|
|
416
|
-
|
|
417
|
-
|
|
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;
|
|
418
381
|
return acc;
|
|
419
382
|
}, {});
|
|
420
383
|
setState({
|
|
421
|
-
selectedRecords: newSelectedKeys
|
|
384
|
+
selectedRecords: newSelectedKeys == null ? void 0 : newSelectedKeys.map((item) => selectedRecordObj == null ? void 0 : selectedRecordObj[String(item)]),
|
|
422
385
|
selectedRowKeys: newSelectedKeys
|
|
423
386
|
});
|
|
424
387
|
} else {
|
|
@@ -428,7 +391,7 @@ function useAntdTable(service, options, useRequestOptions) {
|
|
|
428
391
|
});
|
|
429
392
|
}
|
|
430
393
|
},
|
|
431
|
-
onSelectAll: selected => {
|
|
394
|
+
onSelectAll: (selected) => {
|
|
432
395
|
if (rowSelections && allSelected && !selected) {
|
|
433
396
|
setState({
|
|
434
397
|
allSelected: false,
|
|
@@ -437,27 +400,28 @@ function useAntdTable(service, options, useRequestOptions) {
|
|
|
437
400
|
});
|
|
438
401
|
}
|
|
439
402
|
},
|
|
440
|
-
getCheckboxProps: record => ({
|
|
441
|
-
className: allSelected && rowSelections ?
|
|
403
|
+
getCheckboxProps: (record) => ({
|
|
404
|
+
className: allSelected && rowSelections ? "checkbox-disabled" : ""
|
|
442
405
|
}),
|
|
443
406
|
selections
|
|
444
407
|
};
|
|
445
|
-
const rowSelection =
|
|
446
|
-
if (
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
const
|
|
408
|
+
const rowSelection = isObject(returnRowSelection) ? merge({}, _rowSelection, returnRowSelection) : _rowSelection;
|
|
409
|
+
if (isObject(returnRowSelection)) {
|
|
410
|
+
const customGetCheckboxProps = returnRowSelection.getCheckboxProps;
|
|
411
|
+
if (typeof customGetCheckboxProps === "function") {
|
|
412
|
+
rowSelection.getCheckboxProps = (record) => {
|
|
413
|
+
const internalProps = _rowSelection.getCheckboxProps(record);
|
|
414
|
+
const customProps = customGetCheckboxProps(record) ?? {};
|
|
452
415
|
return {
|
|
453
|
-
|
|
454
|
-
...
|
|
416
|
+
...internalProps,
|
|
417
|
+
...customProps,
|
|
418
|
+
className: [customProps.className, internalProps.className].filter(Boolean).join(" ")
|
|
455
419
|
};
|
|
456
|
-
}
|
|
420
|
+
};
|
|
457
421
|
}
|
|
458
422
|
}
|
|
459
|
-
const selectedTip = allSelected && selectedRowKeys.length ? formatMessage(locale
|
|
460
|
-
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
|
|
461
425
|
}) : null;
|
|
462
426
|
const pagination = {
|
|
463
427
|
current: page.pageNum,
|
|
@@ -466,11 +430,11 @@ function useAntdTable(service, options, useRequestOptions) {
|
|
|
466
430
|
showQuickJumper: true,
|
|
467
431
|
onPaginationChange: true,
|
|
468
432
|
total,
|
|
469
|
-
showTotal:
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
});
|
|
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 });
|
|
474
438
|
},
|
|
475
439
|
onShowSizeChange: handlePageChange,
|
|
476
440
|
onChange: handlePageChange
|
|
@@ -479,22 +443,22 @@ function useAntdTable(service, options, useRequestOptions) {
|
|
|
479
443
|
...result,
|
|
480
444
|
form,
|
|
481
445
|
data,
|
|
482
|
-
params: result
|
|
446
|
+
params: ((_i = result == null ? void 0 : result.params) == null ? void 0 : _i[0]) || {},
|
|
483
447
|
rowSelection,
|
|
484
|
-
searchValues: form
|
|
448
|
+
searchValues: (form == null ? void 0 : form.getFieldsValue()) ?? {},
|
|
485
449
|
allSelected,
|
|
486
450
|
selectedTip,
|
|
487
451
|
selectedRowKeys,
|
|
488
452
|
selectedRecords,
|
|
489
453
|
clearSelected,
|
|
490
|
-
setSelectedRowKeys:
|
|
454
|
+
setSelectedRowKeys: (selectedRowKeys2) => {
|
|
491
455
|
setState({
|
|
492
|
-
selectedRowKeys
|
|
456
|
+
selectedRowKeys: selectedRowKeys2
|
|
493
457
|
});
|
|
494
458
|
},
|
|
495
|
-
setSelectedRecords:
|
|
459
|
+
setSelectedRecords: (selectedRecords2) => {
|
|
496
460
|
setState({
|
|
497
|
-
selectedRecords
|
|
461
|
+
selectedRecords: selectedRecords2
|
|
498
462
|
});
|
|
499
463
|
},
|
|
500
464
|
pagination,
|
|
@@ -505,16 +469,19 @@ function useAntdTable(service, options, useRequestOptions) {
|
|
|
505
469
|
rowKey,
|
|
506
470
|
loading: result.loading,
|
|
507
471
|
dataSource: data,
|
|
508
|
-
rowSelection: returnRowSelection || rowSelections ? rowSelection :
|
|
472
|
+
rowSelection: returnRowSelection || rowSelections ? rowSelection : void 0,
|
|
509
473
|
pagination,
|
|
510
474
|
onChange: handleTableChange
|
|
511
475
|
},
|
|
512
476
|
handleSetStateCallback
|
|
513
477
|
};
|
|
514
|
-
useAntdTableProps.tableProps.formTableProps = {
|
|
515
|
-
..._omit(useAntdTableProps, 'tableProps'),
|
|
516
|
-
form
|
|
517
|
-
};
|
|
478
|
+
useAntdTableProps.tableProps.formTableProps = { ...omit(useAntdTableProps, "tableProps"), form };
|
|
518
479
|
return useAntdTableProps;
|
|
519
480
|
}
|
|
520
|
-
|
|
481
|
+
var useAntdTable_default = useAntdTable;
|
|
482
|
+
export {
|
|
483
|
+
CURRENT_PAGE,
|
|
484
|
+
SELECTION_ALL,
|
|
485
|
+
UNCHECK_ALL,
|
|
486
|
+
useAntdTable_default as default
|
|
487
|
+
};
|