|
@@ -1,4 +1,4 @@
|
|
|
-import {Spin} from 'antd';
|
|
|
+import {Spin, Pagination} from 'antd';
|
|
|
import {ColumnsType} from 'antd/es/table';
|
|
|
import {
|
|
|
createPageContext,
|
|
@@ -19,6 +19,7 @@ type Props<T> = {
|
|
|
pageContext: ReturnType<typeof createPageContext>;
|
|
|
searchContext: ReturnType<typeof createSearchContext>;
|
|
|
count: number;
|
|
|
+ /** @deprecated */
|
|
|
rowKey?: string;
|
|
|
'data-testid'?: string;
|
|
|
pageSizeList?: string[];
|
|
@@ -31,7 +32,6 @@ function Table<T extends Record<string, any>>(props: Props<T>): ReactElement {
|
|
|
pageContext,
|
|
|
searchContext,
|
|
|
count,
|
|
|
- rowKey,
|
|
|
pageSizeList = PAGE_SIZE_LIST,
|
|
|
} = props;
|
|
|
const [{page, pageSize}, {onPageChange}] = usePage(pageContext);
|
|
@@ -96,6 +96,17 @@ function Table<T extends Record<string, any>>(props: Props<T>): ReactElement {
|
|
|
</tbody>
|
|
|
</table>
|
|
|
</div>
|
|
|
+ <Pagination
|
|
|
+ className={css.pagination}
|
|
|
+ pageSize={pageSize}
|
|
|
+ showQuickJumper
|
|
|
+ pageSizeOptions={pageSizeList}
|
|
|
+ total={count}
|
|
|
+ showSizeChanger
|
|
|
+ onChange={onPageChange}
|
|
|
+ current={page}
|
|
|
+ showTotal={total => `共${total}条数据`}
|
|
|
+ />
|
|
|
</Spin>
|
|
|
);
|
|
|
}
|