ebaoferc 2.0.0 → 2.0.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/components/QueryProCard/index.less +2 -2
- package/dist/components/StyledQueryFilter/index.js +8 -8
- package/dist/components/StyledQueryFilter/index.less +26 -26
- package/dist/hooks/useTabsTablePagination/index.d.ts +2 -0
- package/dist/hooks/useTabsTablePagination/index.js +7 -12
- package/package.json +1 -1
|
@@ -13,14 +13,14 @@ import "./index.less";
|
|
|
13
13
|
|
|
14
14
|
// 继承 QueryFilterProps 并重写我们想要设置默认值的属性为可选
|
|
15
15
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
16
|
-
/**
|
|
17
|
-
* 增强的 QueryFilter 组件
|
|
18
|
-
*
|
|
19
|
-
* 默认参数:
|
|
20
|
-
* - colon: false (不显示冒号)
|
|
21
|
-
* - labelWidth: 80 (标签宽度为80px)
|
|
22
|
-
* - defaultFormItemsNumber: 7 (默认展示7个表单项)
|
|
23
|
-
* ```
|
|
16
|
+
/**
|
|
17
|
+
* 增强的 QueryFilter 组件
|
|
18
|
+
*
|
|
19
|
+
* 默认参数:
|
|
20
|
+
* - colon: false (不显示冒号)
|
|
21
|
+
* - labelWidth: 80 (标签宽度为80px)
|
|
22
|
+
* - defaultFormItemsNumber: 7 (默认展示7个表单项)
|
|
23
|
+
* ```
|
|
24
24
|
*/
|
|
25
25
|
var StyledQueryFilter = function StyledQueryFilter(props) {
|
|
26
26
|
var _props$colon = props.colon,
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
.custom-styled-query-filter {
|
|
2
|
-
/** QueryFilter 查询表单样式复写 **/
|
|
3
|
-
.ant-pro-query-filter {
|
|
4
|
-
padding: 0;
|
|
5
|
-
|
|
6
|
-
.ant-pro-query-filter-row {
|
|
7
|
-
row-gap: 0;
|
|
8
|
-
|
|
9
|
-
.ant-form-item {
|
|
10
|
-
margin-bottom:
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
.ant-form-item-control .ant-space-align-center {
|
|
14
|
-
flex-direction: row-reverse;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.ant-form-item-no-colon {
|
|
20
|
-
margin-right: 10px;
|
|
21
|
-
|
|
22
|
-
&::after {
|
|
23
|
-
display: none;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
}
|
|
1
|
+
.custom-styled-query-filter {
|
|
2
|
+
/** QueryFilter 查询表单样式复写 **/
|
|
3
|
+
.ant-pro-query-filter {
|
|
4
|
+
padding: 0;
|
|
5
|
+
|
|
6
|
+
.ant-pro-query-filter-row {
|
|
7
|
+
row-gap: 0;
|
|
8
|
+
|
|
9
|
+
.ant-form-item {
|
|
10
|
+
margin-bottom: 24px;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.ant-form-item-control .ant-space-align-center {
|
|
14
|
+
flex-direction: row-reverse;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.ant-form-item-no-colon {
|
|
20
|
+
margin-right: 10px;
|
|
21
|
+
|
|
22
|
+
&::after {
|
|
23
|
+
display: none;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -3,6 +3,8 @@ import { TUseEnhancePaginationOptions } from '../useEnhancePagination';
|
|
|
3
3
|
export type TUseTabsTablePaginationParams<TData extends Data, TParams extends Params> = {
|
|
4
4
|
defaultTabKey: any;
|
|
5
5
|
tabKeyAlias?: string;
|
|
6
|
+
pageNumAlias?: string;
|
|
7
|
+
pageSizeAlias?: string;
|
|
6
8
|
tabKeyMaps?: {
|
|
7
9
|
[key: string]: any[];
|
|
8
10
|
};
|
|
@@ -28,6 +28,10 @@ export function useTabsTablePagination(params) {
|
|
|
28
28
|
var defaultTabKey = params.defaultTabKey,
|
|
29
29
|
_params$tabKeyAlias = params.tabKeyAlias,
|
|
30
30
|
tabKeyAlias = _params$tabKeyAlias === void 0 ? 'tabState' : _params$tabKeyAlias,
|
|
31
|
+
_params$pageNumAlias = params.pageNumAlias,
|
|
32
|
+
pageNumAlias = _params$pageNumAlias === void 0 ? 'page' : _params$pageNumAlias,
|
|
33
|
+
_params$pageSizeAlias = params.pageSizeAlias,
|
|
34
|
+
pageSizeAlias = _params$pageSizeAlias === void 0 ? 'limit' : _params$pageSizeAlias,
|
|
31
35
|
tabKeyMaps = params.tabKeyMaps,
|
|
32
36
|
service = params.service,
|
|
33
37
|
options = params.options;
|
|
@@ -51,26 +55,17 @@ export function useTabsTablePagination(params) {
|
|
|
51
55
|
_params$pageSize = params.pageSize,
|
|
52
56
|
pageSize = _params$pageSize === void 0 ? 10 : _params$pageSize,
|
|
53
57
|
restParams = _objectWithoutProperties(params, _excluded);
|
|
54
|
-
var newConditions = _objectSpread(_objectSpread({}, restParams), {}, _defineProperty({
|
|
55
|
-
page: current,
|
|
56
|
-
limit: pageSize
|
|
57
|
-
}, tabKeyAlias, getTabValue(shortCircuitOperation(restParams === null || restParams === void 0 ? void 0 : restParams[tabKeyAlias], filterConditions === null || filterConditions === void 0 ? void 0 : filterConditions[tabKeyAlias]))));
|
|
58
|
+
var newConditions = _objectSpread(_objectSpread({}, restParams), {}, _defineProperty(_defineProperty(_defineProperty({}, pageNumAlias, current), pageSizeAlias, pageSize), tabKeyAlias, getTabValue(shortCircuitOperation(restParams === null || restParams === void 0 ? void 0 : restParams[tabKeyAlias], filterConditions === null || filterConditions === void 0 ? void 0 : filterConditions[tabKeyAlias]))));
|
|
58
59
|
setFilterConditions(newConditions);
|
|
59
60
|
var finalParams = [newConditions].concat(_toConsumableArray(otherParams));
|
|
60
61
|
return service.apply(void 0, _toConsumableArray(finalParams));
|
|
61
62
|
}, options);
|
|
62
63
|
var processQueryFilterOnReset = function processQueryFilterOnReset() {
|
|
63
|
-
setFilterConditions(_defineProperty({
|
|
64
|
-
page: 1,
|
|
65
|
-
limit: 10
|
|
66
|
-
}, tabKeyAlias, getTabValue(filterConditions === null || filterConditions === void 0 ? void 0 : filterConditions[tabKeyAlias])));
|
|
64
|
+
setFilterConditions(_defineProperty(_defineProperty(_defineProperty({}, pageNumAlias, 1), pageSizeAlias, 10), tabKeyAlias, getTabValue(filterConditions === null || filterConditions === void 0 ? void 0 : filterConditions[tabKeyAlias])));
|
|
67
65
|
};
|
|
68
66
|
var onChangeTab = function onChangeTab(activeKey) {
|
|
69
67
|
var _paginationHookRes$ru;
|
|
70
|
-
var newFilterConditions = _objectSpread(_objectSpread({}, filterConditions), {}, _defineProperty({
|
|
71
|
-
page: 1,
|
|
72
|
-
limit: 10
|
|
73
|
-
}, tabKeyAlias, getTabValue(activeKey)));
|
|
68
|
+
var newFilterConditions = _objectSpread(_objectSpread({}, filterConditions), {}, _defineProperty(_defineProperty(_defineProperty({}, pageNumAlias, 1), pageSizeAlias, 10), tabKeyAlias, getTabValue(activeKey)));
|
|
74
69
|
setFilterConditions(newFilterConditions);
|
|
75
70
|
var _paginationHookRes$pa = _toArray(paginationHookRes.params),
|
|
76
71
|
_ = _paginationHookRes$pa[0],
|