king
2020-04-14 5e10a7ee4a5ef882d6b0d92b19b1a888ffcc6f7f
src/tabviews/zshare/normalTable/index.jsx
@@ -6,6 +6,11 @@
const { Paragraph } = Typography
export default class MainTable extends Component {
  static defaultProps = {
    pagination: true,
    total: 0
  }
  static propTpyes = {
    tableId: PropTypes.string,     // 列表Id
    dict: PropTypes.object,        // 字典项
@@ -14,12 +19,13 @@
    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 = {
@@ -468,7 +474,7 @@
  }
  render() {
    const { setting, pickup } = this.props
    const { setting, pickup, pagination } = this.props
    let { selectedRowKeys } = this.state
    // 设置表格选择属性:单选、多选、不可选
@@ -503,6 +509,18 @@
      _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">
@@ -534,14 +552,7 @@
            }
          }}
          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"