| | |
| | | const { Paragraph } = Typography |
| | | |
| | | export default class MainTable extends Component { |
| | | static defaultProps = { |
| | | pagination: true, |
| | | total: 0 |
| | | } |
| | | |
| | | static propTpyes = { |
| | | tableId: PropTypes.string, // 列表Id |
| | | dict: PropTypes.object, // 字典项 |
| | |
| | | pickup: PropTypes.any, // 数据收起 |
| | | columns: PropTypes.array, // 表格列 |
| | | data: PropTypes.any, // 表格数据 |
| | | total: PropTypes.number, // 总数 |
| | | total: PropTypes.any, // 总数 |
| | | loading: PropTypes.bool, // 表格加载中 |
| | | refreshdata: PropTypes.func, // 表格中排序列、页码的变化时刷新 |
| | | buttonTrigger: PropTypes.func, // 表格中按钮触发操作 |
| | | linkTrigger: PropTypes.func, // 字段透视 |
| | | handleTableId: PropTypes.func // 数据切换 |
| | | handleTableId: PropTypes.func, // 数据切换 |
| | | pagination: PropTypes.any // 数据切换 |
| | | } |
| | | |
| | | state = { |
| | |
| | | } |
| | | |
| | | render() { |
| | | const { setting, pickup } = this.props |
| | | const { setting, pickup, pagination } = this.props |
| | | let { selectedRowKeys } = this.state |
| | | |
| | | // 设置表格选择属性:单选、多选、不可选 |
| | |
| | | _data = _data.filter((item, index) => selectedRowKeys.includes(index)) |
| | | } |
| | | |
| | | let _pagination = false |
| | | if (pagination) { |
| | | _pagination = { |
| | | current: this.state.pageIndex, |
| | | pageSize: this.state.pageSize, |
| | | pageSizeOptions: ['10', '25', '50', '100', '500', '1000'], |
| | | showSizeChanger: true, |
| | | total: this.props.total, |
| | | showTotal: (total, range) => `${range[0]}-${range[1]} ${this.props.dict['main.pagination.of']} ${total} ${this.props.dict['main.pagination.items']}` |
| | | } |
| | | } |
| | | |
| | | return ( |
| | | <div className="normal-data-table"> |
| | | {offset && <Affix offsetTop={offset} className="fix-header"> |
| | |
| | | } |
| | | }} |
| | | onChange={this.changeTable} |
| | | pagination={{ |
| | | current: this.state.pageIndex, |
| | | pageSize: this.state.pageSize, |
| | | pageSizeOptions: ['10', '25', '50', '100', '500', '1000'], |
| | | showSizeChanger: true, |
| | | total: this.props.total, |
| | | showTotal: (total, range) => `${range[0]}-${range[1]} ${this.props.dict['main.pagination.of']} ${total} ${this.props.dict['main.pagination.items']}` |
| | | }} |
| | | pagination={_pagination} |
| | | /> |
| | | <Modal |
| | | className="image-scale-modal" |