handleShowTotal = (total, range) => {
let pageSizeOptions = [10, 20, 30, 40]
return (
<div>
显示第 <span className='pageTotalNum'>{range[0]}</span> 条到第 <span className='pageTotalNum'>{range[1]}</span> 条记录,总共{total}条记录,每页显示
<Select value={this.state.pageSizeOption} size='small' onChange={this.handlePageSizeOption}>
{pageSizeOptions.map((v) => (
<Option key={v} value={v}>
{v}
</Option>
))}
</Select>
条记录
</div>
)
}
render() {
const {data, pageSizeOption} = this.state
const paginationConfig = {
pageSize: pageSizeOption,
showTotal: this.handleShowTotal,
}
return (
<div>
<Table
tableLayout={'fixed'}
pagination={paginationConfig}
scroll={{x: 'max-content'}}
columns={reviewingTableConfig()}
dataSource={data}
rowKey={(record, index) => (record, index)}
/>
</div>
)
}
}