@hw-component/table 1.9.34 → 1.9.35
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/HTablePagination/index.d.ts +3 -2
- package/es/HTablePagination/index.js +31 -33
- package/es/modal.d.ts +3 -1
- package/lib/HTablePagination/index.d.ts +3 -2
- package/lib/HTablePagination/index.js +31 -33
- package/lib/modal.d.ts +3 -1
- package/package.json +1 -1
- package/src/components/HTablePagination/index.tsx +9 -7
- package/src/components/modal.ts +3 -1
|
@@ -2,13 +2,14 @@ import type { PaginationProps } from "antd";
|
|
|
2
2
|
import type { ParamsModal, HTableInstance } from "../modal";
|
|
3
3
|
import React from "react";
|
|
4
4
|
import type { AffixProps } from "antd/lib/affix";
|
|
5
|
-
export interface IPaginationProps extends PaginationProps {
|
|
5
|
+
export interface IPaginationProps extends Omit<PaginationProps, "showTotal"> {
|
|
6
6
|
onPageChange?: (params: ParamsModal) => void;
|
|
7
7
|
paginationStyle?: React.CSSProperties;
|
|
8
8
|
affixProps?: AffixProps | false;
|
|
9
9
|
goTop?: boolean;
|
|
10
10
|
actionRender?: (tableInstance: HTableInstance) => React.ReactNode;
|
|
11
11
|
table?: HTableInstance;
|
|
12
|
+
showTotal?: false | PaginationProps["showTotal"];
|
|
12
13
|
}
|
|
13
|
-
declare const _default: ({ onPageChange, paginationStyle, affixProps, goTop, actionRender, table, ...props }: IPaginationProps) => JSX.Element;
|
|
14
|
+
declare const _default: ({ onPageChange, paginationStyle, affixProps, goTop, actionRender, table, showTotal, ...props }: IPaginationProps) => JSX.Element;
|
|
14
15
|
export default _default;
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
// welcome to hoo hoo hoo
|
|
2
|
+
import _defineProperty from '@babel/runtime-corejs3/helpers/defineProperty';
|
|
3
|
+
import _objectWithoutProperties from '@babel/runtime-corejs3/helpers/objectWithoutProperties';
|
|
4
|
+
import _slicedToArray from '@babel/runtime-corejs3/helpers/slicedToArray';
|
|
5
|
+
import _concatInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/concat';
|
|
6
|
+
import _Number$parseInt from '@babel/runtime-corejs3/core-js-stable/number/parse-int';
|
|
2
7
|
import _Object$keys from '@babel/runtime-corejs3/core-js-stable/object/keys';
|
|
3
8
|
import _Object$getOwnPropertySymbols from '@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols';
|
|
4
9
|
import _filterInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/filter';
|
|
@@ -7,11 +12,6 @@ import _forEachInstanceProperty from '@babel/runtime-corejs3/core-js-stable/inst
|
|
|
7
12
|
import _Object$getOwnPropertyDescriptors from '@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors';
|
|
8
13
|
import _Object$defineProperties from '@babel/runtime-corejs3/core-js-stable/object/define-properties';
|
|
9
14
|
import _Object$defineProperty from '@babel/runtime-corejs3/core-js-stable/object/define-property';
|
|
10
|
-
import _defineProperty from '@babel/runtime-corejs3/helpers/defineProperty';
|
|
11
|
-
import _slicedToArray from '@babel/runtime-corejs3/helpers/slicedToArray';
|
|
12
|
-
import _objectWithoutProperties from '@babel/runtime-corejs3/helpers/objectWithoutProperties';
|
|
13
|
-
import _Number$parseInt from '@babel/runtime-corejs3/core-js-stable/number/parse-int';
|
|
14
|
-
import _concatInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/concat';
|
|
15
15
|
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
|
16
16
|
import { Row, Pagination, Affix } from 'antd';
|
|
17
17
|
import { useHTableContext } from '../context.js';
|
|
@@ -20,18 +20,27 @@ import { useState } from 'react';
|
|
|
20
20
|
import GoTop from '../GoTop/index.js';
|
|
21
21
|
import { useHTableConfigContext } from '../TableConfig.js';
|
|
22
22
|
|
|
23
|
-
var _excluded = ["onPageChange", "paginationStyle", "affixProps", "goTop", "actionRender", "table"],
|
|
23
|
+
var _excluded = ["onPageChange", "paginationStyle", "affixProps", "goTop", "actionRender", "table", "showTotal"],
|
|
24
24
|
_excluded2 = ["offsetBottom"];
|
|
25
25
|
function ownKeys(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
26
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var
|
|
27
|
-
var
|
|
28
|
-
var
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
26
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context3, _context4; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context3 = ownKeys(Object(t), !0)).call(_context3, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context4 = ownKeys(Object(t))).call(_context4, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
27
|
+
var defaultShowTotal = function defaultShowTotal(totalNum, _ref) {
|
|
28
|
+
var _context, _context2;
|
|
29
|
+
var _ref2 = _slicedToArray(_ref, 2),
|
|
30
|
+
showCurrent = _ref2[0],
|
|
31
|
+
showCurrentEnd = _ref2[1];
|
|
32
|
+
return _concatInstanceProperty(_context = _concatInstanceProperty(_context2 = "\u7B2C".concat(showCurrent, "-")).call(_context2, showCurrentEnd, "/\u603B\u5171")).call(_context, totalNum, "\u6761");
|
|
33
|
+
};
|
|
34
|
+
var HTablePagination = (function (_ref3) {
|
|
35
|
+
var onPageChange = _ref3.onPageChange,
|
|
36
|
+
paginationStyle = _ref3.paginationStyle,
|
|
37
|
+
affixProps = _ref3.affixProps,
|
|
38
|
+
goTop = _ref3.goTop,
|
|
39
|
+
actionRender = _ref3.actionRender,
|
|
40
|
+
table = _ref3.table,
|
|
41
|
+
_ref3$showTotal = _ref3.showTotal,
|
|
42
|
+
showTotal = _ref3$showTotal === void 0 ? defaultShowTotal : _ref3$showTotal,
|
|
43
|
+
props = _objectWithoutProperties(_ref3, _excluded);
|
|
35
44
|
var _useHTableContext = useHTableContext(),
|
|
36
45
|
contextOnPageChange = _useHTableContext.onPageChange,
|
|
37
46
|
data = _useHTableContext.data,
|
|
@@ -42,10 +51,10 @@ var HTablePagination = (function (_ref) {
|
|
|
42
51
|
defaultPaginationStyle = _useHTableConfigConte.paginationStyle;
|
|
43
52
|
var tableInstance = table || contextTableInstance;
|
|
44
53
|
var tableOnPageChange = onPageChange || contextOnPageChange;
|
|
45
|
-
var
|
|
46
|
-
size =
|
|
47
|
-
current =
|
|
48
|
-
total =
|
|
54
|
+
var _ref4 = data || {},
|
|
55
|
+
size = _ref4.size,
|
|
56
|
+
current = _ref4.current,
|
|
57
|
+
total = _ref4.total;
|
|
49
58
|
var pageCurrent = _Number$parseInt(current || "1", 10);
|
|
50
59
|
var pageSize = _Number$parseInt(size || "10", 10);
|
|
51
60
|
var pageTotal = _Number$parseInt(total || "0", 10);
|
|
@@ -54,6 +63,7 @@ var HTablePagination = (function (_ref) {
|
|
|
54
63
|
_useState2 = _slicedToArray(_useState, 2),
|
|
55
64
|
style = _useState2[0],
|
|
56
65
|
setStyle = _useState2[1];
|
|
66
|
+
var cuShowTotal = showTotal === false ? undefined : showTotal;
|
|
57
67
|
if (!data) {
|
|
58
68
|
return jsx(Fragment, {});
|
|
59
69
|
}
|
|
@@ -70,13 +80,7 @@ var HTablePagination = (function (_ref) {
|
|
|
70
80
|
showQuickJumper: true,
|
|
71
81
|
pageSize: pageSize,
|
|
72
82
|
current: pageCurrent,
|
|
73
|
-
showTotal:
|
|
74
|
-
var _context, _context2;
|
|
75
|
-
var _ref4 = _slicedToArray(_ref3, 2),
|
|
76
|
-
showCurrent = _ref4[0],
|
|
77
|
-
showCurrentEnd = _ref4[1];
|
|
78
|
-
return _concatInstanceProperty(_context = _concatInstanceProperty(_context2 = "\u7B2C".concat(showCurrent, "-")).call(_context2, showCurrentEnd, "/\u603B\u5171")).call(_context, totalNum, "\u6761");
|
|
79
|
-
},
|
|
83
|
+
showTotal: cuShowTotal,
|
|
80
84
|
total: pageTotal,
|
|
81
85
|
onChange: function onChange(pn, ps) {
|
|
82
86
|
tableOnPageChange({
|
|
@@ -116,13 +120,7 @@ var HTablePagination = (function (_ref) {
|
|
|
116
120
|
showQuickJumper: true,
|
|
117
121
|
pageSize: pageSize,
|
|
118
122
|
current: pageCurrent,
|
|
119
|
-
showTotal:
|
|
120
|
-
var _context3, _context4;
|
|
121
|
-
var _ref7 = _slicedToArray(_ref6, 2),
|
|
122
|
-
showCurrent = _ref7[0],
|
|
123
|
-
showCurrentEnd = _ref7[1];
|
|
124
|
-
return _concatInstanceProperty(_context3 = _concatInstanceProperty(_context4 = "\u7B2C".concat(showCurrent, "-")).call(_context4, showCurrentEnd, "/\u603B\u5171")).call(_context3, totalNum, "\u6761");
|
|
125
|
-
},
|
|
123
|
+
showTotal: cuShowTotal,
|
|
126
124
|
total: pageTotal,
|
|
127
125
|
onChange: function onChange(pn, ps) {
|
|
128
126
|
tableOnPageChange({
|
package/es/modal.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ import type { TableProps } from "antd/lib/table";
|
|
|
8
8
|
import type { AffixProps } from "antd/lib/affix";
|
|
9
9
|
import type { OptionModal } from "./HTableBody";
|
|
10
10
|
import type { DrawerProps } from "antd";
|
|
11
|
+
import { IPaginationProps } from "@/components/HTablePagination";
|
|
11
12
|
export interface RowObj {
|
|
12
13
|
keys?: React.Key[];
|
|
13
14
|
rowData?: any[];
|
|
@@ -47,7 +48,7 @@ export interface RowSelectionOuter {
|
|
|
47
48
|
export type HRowSelection = RowSelectionOuter & (TableProps<any>["rowSelection"] & {
|
|
48
49
|
alwaysShowAlert?: boolean;
|
|
49
50
|
});
|
|
50
|
-
export interface HTableProps extends Omit<ProTableProps<any, any>, "request" | "dataSource" | "rowSelection"> {
|
|
51
|
+
export interface HTableProps extends Omit<ProTableProps<any, any>, "request" | "dataSource" | "rowSelection" | "pagination"> {
|
|
51
52
|
request?: (params: ParamsModal) => Promise<ResultModal>;
|
|
52
53
|
configData: ConfigDataModal;
|
|
53
54
|
searchSpan?: ColProps;
|
|
@@ -79,6 +80,7 @@ export interface HTableProps extends Omit<ProTableProps<any, any>, "request" | "
|
|
|
79
80
|
labelWidth?: number;
|
|
80
81
|
hideLabel?: boolean;
|
|
81
82
|
options?: OptionModal | false;
|
|
83
|
+
pagination?: IPaginationProps;
|
|
82
84
|
}
|
|
83
85
|
interface ColCheckResultKeys {
|
|
84
86
|
keys?: string[];
|
|
@@ -2,13 +2,14 @@ import type { PaginationProps } from "antd";
|
|
|
2
2
|
import type { ParamsModal, HTableInstance } from "../modal";
|
|
3
3
|
import React from "react";
|
|
4
4
|
import type { AffixProps } from "antd/lib/affix";
|
|
5
|
-
export interface IPaginationProps extends PaginationProps {
|
|
5
|
+
export interface IPaginationProps extends Omit<PaginationProps, "showTotal"> {
|
|
6
6
|
onPageChange?: (params: ParamsModal) => void;
|
|
7
7
|
paginationStyle?: React.CSSProperties;
|
|
8
8
|
affixProps?: AffixProps | false;
|
|
9
9
|
goTop?: boolean;
|
|
10
10
|
actionRender?: (tableInstance: HTableInstance) => React.ReactNode;
|
|
11
11
|
table?: HTableInstance;
|
|
12
|
+
showTotal?: false | PaginationProps["showTotal"];
|
|
12
13
|
}
|
|
13
|
-
declare const _default: ({ onPageChange, paginationStyle, affixProps, goTop, actionRender, table, ...props }: IPaginationProps) => JSX.Element;
|
|
14
|
+
declare const _default: ({ onPageChange, paginationStyle, affixProps, goTop, actionRender, table, showTotal, ...props }: IPaginationProps) => JSX.Element;
|
|
14
15
|
export default _default;
|
|
@@ -2,6 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
var _defineProperty = require('@babel/runtime-corejs3/helpers/defineProperty');
|
|
6
|
+
var _objectWithoutProperties = require('@babel/runtime-corejs3/helpers/objectWithoutProperties');
|
|
7
|
+
var _slicedToArray = require('@babel/runtime-corejs3/helpers/slicedToArray');
|
|
8
|
+
var _concatInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/concat');
|
|
9
|
+
var _Number$parseInt = require('@babel/runtime-corejs3/core-js-stable/number/parse-int');
|
|
5
10
|
var _Object$keys = require('@babel/runtime-corejs3/core-js-stable/object/keys');
|
|
6
11
|
var _Object$getOwnPropertySymbols = require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols');
|
|
7
12
|
var _filterInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/filter');
|
|
@@ -10,11 +15,6 @@ var _forEachInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/in
|
|
|
10
15
|
var _Object$getOwnPropertyDescriptors = require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors');
|
|
11
16
|
var _Object$defineProperties = require('@babel/runtime-corejs3/core-js-stable/object/define-properties');
|
|
12
17
|
var _Object$defineProperty = require('@babel/runtime-corejs3/core-js-stable/object/define-property');
|
|
13
|
-
var _defineProperty = require('@babel/runtime-corejs3/helpers/defineProperty');
|
|
14
|
-
var _slicedToArray = require('@babel/runtime-corejs3/helpers/slicedToArray');
|
|
15
|
-
var _objectWithoutProperties = require('@babel/runtime-corejs3/helpers/objectWithoutProperties');
|
|
16
|
-
var _Number$parseInt = require('@babel/runtime-corejs3/core-js-stable/number/parse-int');
|
|
17
|
-
var _concatInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/concat');
|
|
18
18
|
var jsxRuntime = require('react/jsx-runtime');
|
|
19
19
|
var antd = require('antd');
|
|
20
20
|
var context = require('../context.js');
|
|
@@ -23,18 +23,27 @@ var React = require('react');
|
|
|
23
23
|
var index$1 = require('../GoTop/index.js');
|
|
24
24
|
var TableConfig = require('../TableConfig.js');
|
|
25
25
|
|
|
26
|
-
var _excluded = ["onPageChange", "paginationStyle", "affixProps", "goTop", "actionRender", "table"],
|
|
26
|
+
var _excluded = ["onPageChange", "paginationStyle", "affixProps", "goTop", "actionRender", "table", "showTotal"],
|
|
27
27
|
_excluded2 = ["offsetBottom"];
|
|
28
28
|
function ownKeys(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
29
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var
|
|
30
|
-
var
|
|
31
|
-
var
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
29
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context3, _context4; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context3 = ownKeys(Object(t), !0)).call(_context3, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context4 = ownKeys(Object(t))).call(_context4, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
30
|
+
var defaultShowTotal = function defaultShowTotal(totalNum, _ref) {
|
|
31
|
+
var _context, _context2;
|
|
32
|
+
var _ref2 = _slicedToArray(_ref, 2),
|
|
33
|
+
showCurrent = _ref2[0],
|
|
34
|
+
showCurrentEnd = _ref2[1];
|
|
35
|
+
return _concatInstanceProperty(_context = _concatInstanceProperty(_context2 = "\u7B2C".concat(showCurrent, "-")).call(_context2, showCurrentEnd, "/\u603B\u5171")).call(_context, totalNum, "\u6761");
|
|
36
|
+
};
|
|
37
|
+
var HTablePagination = (function (_ref3) {
|
|
38
|
+
var onPageChange = _ref3.onPageChange,
|
|
39
|
+
paginationStyle = _ref3.paginationStyle,
|
|
40
|
+
affixProps = _ref3.affixProps,
|
|
41
|
+
goTop = _ref3.goTop,
|
|
42
|
+
actionRender = _ref3.actionRender,
|
|
43
|
+
table = _ref3.table,
|
|
44
|
+
_ref3$showTotal = _ref3.showTotal,
|
|
45
|
+
showTotal = _ref3$showTotal === void 0 ? defaultShowTotal : _ref3$showTotal,
|
|
46
|
+
props = _objectWithoutProperties(_ref3, _excluded);
|
|
38
47
|
var _useHTableContext = context.useHTableContext(),
|
|
39
48
|
contextOnPageChange = _useHTableContext.onPageChange,
|
|
40
49
|
data = _useHTableContext.data,
|
|
@@ -45,10 +54,10 @@ var HTablePagination = (function (_ref) {
|
|
|
45
54
|
defaultPaginationStyle = _useHTableConfigConte.paginationStyle;
|
|
46
55
|
var tableInstance = table || contextTableInstance;
|
|
47
56
|
var tableOnPageChange = onPageChange || contextOnPageChange;
|
|
48
|
-
var
|
|
49
|
-
size =
|
|
50
|
-
current =
|
|
51
|
-
total =
|
|
57
|
+
var _ref4 = data || {},
|
|
58
|
+
size = _ref4.size,
|
|
59
|
+
current = _ref4.current,
|
|
60
|
+
total = _ref4.total;
|
|
52
61
|
var pageCurrent = _Number$parseInt(current || "1", 10);
|
|
53
62
|
var pageSize = _Number$parseInt(size || "10", 10);
|
|
54
63
|
var pageTotal = _Number$parseInt(total || "0", 10);
|
|
@@ -57,6 +66,7 @@ var HTablePagination = (function (_ref) {
|
|
|
57
66
|
_useState2 = _slicedToArray(_useState, 2),
|
|
58
67
|
style = _useState2[0],
|
|
59
68
|
setStyle = _useState2[1];
|
|
69
|
+
var cuShowTotal = showTotal === false ? undefined : showTotal;
|
|
60
70
|
if (!data) {
|
|
61
71
|
return jsxRuntime.jsx(jsxRuntime.Fragment, {});
|
|
62
72
|
}
|
|
@@ -73,13 +83,7 @@ var HTablePagination = (function (_ref) {
|
|
|
73
83
|
showQuickJumper: true,
|
|
74
84
|
pageSize: pageSize,
|
|
75
85
|
current: pageCurrent,
|
|
76
|
-
showTotal:
|
|
77
|
-
var _context, _context2;
|
|
78
|
-
var _ref4 = _slicedToArray(_ref3, 2),
|
|
79
|
-
showCurrent = _ref4[0],
|
|
80
|
-
showCurrentEnd = _ref4[1];
|
|
81
|
-
return _concatInstanceProperty(_context = _concatInstanceProperty(_context2 = "\u7B2C".concat(showCurrent, "-")).call(_context2, showCurrentEnd, "/\u603B\u5171")).call(_context, totalNum, "\u6761");
|
|
82
|
-
},
|
|
86
|
+
showTotal: cuShowTotal,
|
|
83
87
|
total: pageTotal,
|
|
84
88
|
onChange: function onChange(pn, ps) {
|
|
85
89
|
tableOnPageChange({
|
|
@@ -119,13 +123,7 @@ var HTablePagination = (function (_ref) {
|
|
|
119
123
|
showQuickJumper: true,
|
|
120
124
|
pageSize: pageSize,
|
|
121
125
|
current: pageCurrent,
|
|
122
|
-
showTotal:
|
|
123
|
-
var _context3, _context4;
|
|
124
|
-
var _ref7 = _slicedToArray(_ref6, 2),
|
|
125
|
-
showCurrent = _ref7[0],
|
|
126
|
-
showCurrentEnd = _ref7[1];
|
|
127
|
-
return _concatInstanceProperty(_context3 = _concatInstanceProperty(_context4 = "\u7B2C".concat(showCurrent, "-")).call(_context4, showCurrentEnd, "/\u603B\u5171")).call(_context3, totalNum, "\u6761");
|
|
128
|
-
},
|
|
126
|
+
showTotal: cuShowTotal,
|
|
129
127
|
total: pageTotal,
|
|
130
128
|
onChange: function onChange(pn, ps) {
|
|
131
129
|
tableOnPageChange({
|
package/lib/modal.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ import type { TableProps } from "antd/lib/table";
|
|
|
8
8
|
import type { AffixProps } from "antd/lib/affix";
|
|
9
9
|
import type { OptionModal } from "./HTableBody";
|
|
10
10
|
import type { DrawerProps } from "antd";
|
|
11
|
+
import { IPaginationProps } from "@/components/HTablePagination";
|
|
11
12
|
export interface RowObj {
|
|
12
13
|
keys?: React.Key[];
|
|
13
14
|
rowData?: any[];
|
|
@@ -47,7 +48,7 @@ export interface RowSelectionOuter {
|
|
|
47
48
|
export type HRowSelection = RowSelectionOuter & (TableProps<any>["rowSelection"] & {
|
|
48
49
|
alwaysShowAlert?: boolean;
|
|
49
50
|
});
|
|
50
|
-
export interface HTableProps extends Omit<ProTableProps<any, any>, "request" | "dataSource" | "rowSelection"> {
|
|
51
|
+
export interface HTableProps extends Omit<ProTableProps<any, any>, "request" | "dataSource" | "rowSelection" | "pagination"> {
|
|
51
52
|
request?: (params: ParamsModal) => Promise<ResultModal>;
|
|
52
53
|
configData: ConfigDataModal;
|
|
53
54
|
searchSpan?: ColProps;
|
|
@@ -79,6 +80,7 @@ export interface HTableProps extends Omit<ProTableProps<any, any>, "request" | "
|
|
|
79
80
|
labelWidth?: number;
|
|
80
81
|
hideLabel?: boolean;
|
|
81
82
|
options?: OptionModal | false;
|
|
83
|
+
pagination?: IPaginationProps;
|
|
82
84
|
}
|
|
83
85
|
interface ColCheckResultKeys {
|
|
84
86
|
keys?: string[];
|
package/package.json
CHANGED
|
@@ -7,13 +7,17 @@ import React, { useState } from "react";
|
|
|
7
7
|
import type { AffixProps } from "antd/lib/affix";
|
|
8
8
|
import GoTop from "../GoTop";
|
|
9
9
|
import { useHTableConfigContext } from "@/components/TableConfig";
|
|
10
|
-
export interface IPaginationProps extends PaginationProps {
|
|
10
|
+
export interface IPaginationProps extends Omit<PaginationProps, "showTotal"> {
|
|
11
11
|
onPageChange?: (params: ParamsModal) => void;
|
|
12
12
|
paginationStyle?: React.CSSProperties;
|
|
13
13
|
affixProps?: AffixProps | false;
|
|
14
14
|
goTop?: boolean;
|
|
15
15
|
actionRender?: (tableInstance: HTableInstance) => React.ReactNode;
|
|
16
16
|
table?: HTableInstance;
|
|
17
|
+
showTotal?:false|PaginationProps["showTotal"]
|
|
18
|
+
}
|
|
19
|
+
const defaultShowTotal=(totalNum:number, [showCurrent, showCurrentEnd])=>{
|
|
20
|
+
return `第${showCurrent}-${showCurrentEnd}/总共${totalNum}条`;
|
|
17
21
|
}
|
|
18
22
|
export default ({
|
|
19
23
|
onPageChange,
|
|
@@ -22,6 +26,7 @@ export default ({
|
|
|
22
26
|
goTop,
|
|
23
27
|
actionRender,
|
|
24
28
|
table,
|
|
29
|
+
showTotal=defaultShowTotal,
|
|
25
30
|
...props
|
|
26
31
|
}: IPaginationProps) => {
|
|
27
32
|
const {
|
|
@@ -40,6 +45,7 @@ export default ({
|
|
|
40
45
|
const pageTotal = Number.parseInt(total || "0", 10);
|
|
41
46
|
const className = useClassName("hw-table-pagination");
|
|
42
47
|
const [style, setStyle] = useState({});
|
|
48
|
+
const cuShowTotal=showTotal===false?undefined:showTotal;
|
|
43
49
|
if (!data) {
|
|
44
50
|
return <></>;
|
|
45
51
|
}
|
|
@@ -57,9 +63,7 @@ export default ({
|
|
|
57
63
|
showQuickJumper={true}
|
|
58
64
|
pageSize={pageSize}
|
|
59
65
|
current={pageCurrent}
|
|
60
|
-
showTotal={
|
|
61
|
-
return `第${showCurrent}-${showCurrentEnd}/总共${totalNum}条`;
|
|
62
|
-
}}
|
|
66
|
+
showTotal={cuShowTotal}
|
|
63
67
|
total={pageTotal}
|
|
64
68
|
onChange={(pn, ps) => {
|
|
65
69
|
tableOnPageChange({ size: ps, current: pn });
|
|
@@ -97,9 +101,7 @@ export default ({
|
|
|
97
101
|
showQuickJumper={true}
|
|
98
102
|
pageSize={pageSize}
|
|
99
103
|
current={pageCurrent}
|
|
100
|
-
showTotal={
|
|
101
|
-
return `第${showCurrent}-${showCurrentEnd}/总共${totalNum}条`;
|
|
102
|
-
}}
|
|
104
|
+
showTotal={cuShowTotal}
|
|
103
105
|
total={pageTotal}
|
|
104
106
|
onChange={(pn, ps) => {
|
|
105
107
|
tableOnPageChange({ size: ps, current: pn });
|
package/src/components/modal.ts
CHANGED
|
@@ -12,6 +12,7 @@ import type { AffixProps } from "antd/lib/affix";
|
|
|
12
12
|
import type { OptionModal } from "./HTableBody";
|
|
13
13
|
import { GetRowKey } from "rc-table/lib/interface";
|
|
14
14
|
import type { DrawerProps } from "antd";
|
|
15
|
+
import {IPaginationProps} from "@/components/HTablePagination";
|
|
15
16
|
|
|
16
17
|
export interface RowObj {
|
|
17
18
|
keys?: React.Key[];
|
|
@@ -76,7 +77,7 @@ export type HRowSelection = RowSelectionOuter &
|
|
|
76
77
|
export interface HTableProps
|
|
77
78
|
extends Omit<
|
|
78
79
|
ProTableProps<any, any>,
|
|
79
|
-
"request" | "dataSource" | "rowSelection"
|
|
80
|
+
"request" | "dataSource" | "rowSelection"|"pagination"
|
|
80
81
|
> {
|
|
81
82
|
request?: (params: ParamsModal) => Promise<ResultModal>;
|
|
82
83
|
configData: ConfigDataModal;
|
|
@@ -112,6 +113,7 @@ export interface HTableProps
|
|
|
112
113
|
labelWidth?: number;
|
|
113
114
|
hideLabel?: boolean;
|
|
114
115
|
options?: OptionModal | false;
|
|
116
|
+
pagination?:IPaginationProps
|
|
115
117
|
}
|
|
116
118
|
interface ColCheckResultKeys {
|
|
117
119
|
keys?: string[];
|