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

38 lines
1.1 KiB
JavaScript

import React, { PureComponent } from "react";
import { WeaLocaleProvider } from "ecCom";
import CustomTable from "../../components/customTable";
const getLabel = WeaLocaleProvider.getLabel;
class CustomPaginationTable extends PureComponent {
shouldComponentUpdate(nextProps, nextState, nextContext) {
return !(nextProps.columnIndex && this.props.columnIndex !== nextProps.columnIndex);
}
render() {
return (
<CustomTable
{...this.props}
pagination={{
onChange: value => {
this.props.onPageChange(value);
},
total: this.props.total,
showTotal: total => `${getLabel(83698, "共")} ${total} ${getLabel(18256, "条")}`,
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);
}
}}
/>
);
}
}
export default CustomPaginationTable;