salary-management-front/pc4mobx/hrmSalary/components/customPaginationTable/index.js

38 lines
1.1 KiB
JavaScript
Raw Normal View History

import React, { PureComponent } from "react";
2023-04-13 17:32:27 +08:00
import { WeaLocaleProvider } from "ecCom";
2022-06-17 16:53:27 +08:00
import CustomTable from "../../components/customTable";
2022-06-07 09:08:36 +08:00
2023-04-13 17:32:27 +08:00
const getLabel = WeaLocaleProvider.getLabel;
class CustomPaginationTable extends PureComponent {
shouldComponentUpdate(nextProps, nextState, nextContext) {
2022-12-02 16:12:11 +08:00
return !(nextProps.columnIndex && this.props.columnIndex !== nextProps.columnIndex);
}
2022-06-17 16:53:27 +08:00
render() {
return (
<CustomTable
{...this.props}
pagination={{
onChange: value => {
this.props.onPageChange(value);
},
total: this.props.total,
2023-04-13 17:32:27 +08:00
showTotal: total => `${getLabel(83698, "共")} ${total} ${getLabel(18256, "条")}`,
2022-06-17 16:53:27 +08:00
current: this.props.current,
showSizeChanger: true,
pageSizeOptions: ["10", "20", "50", "100"],
showQuickJumper: true,
pageSize: this.props.pageSize,
onShowSizeChange: (current, pageSize) => {
this.props.onShowSizeChange &&
this.props.onShowSizeChange(current, pageSize);
2022-06-17 16:53:27 +08:00
}
}}
/>
);
}
}
export default CustomPaginationTable;