king
2020-03-04 96455706619a0a2a96a836714e106f4c7a3bfd40
src/tabviews/subtable/subTable/index.jsx
@@ -1,5 +1,6 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { is, fromJS } from 'immutable'
import { Table, message, Button, Typography } from 'antd'
import './index.scss'
@@ -16,7 +17,8 @@
    loading: PropTypes.bool,       // 表格加载中
    refreshdata: PropTypes.func,   // 表格中排序列、页码的变化时刷新
    buttonTrigger: PropTypes.func, // 表格中按钮触发操作
    handleTableId: PropTypes.func  // 控制表格数据切换时,更新在主表中的id
    handleTableId: PropTypes.func, // 控制表格数据切换时,更新在主表中的id
    pickup: PropTypes.any          // 数据展开合并控制
  }
  state = {
@@ -142,7 +144,7 @@
        <div className={match ? item.color : ''}>
          <div className="background"></div>
          <div className="content" style={{ minWidth: (item.Width || 120) + 'px' }}>
            <Paragraph copyable ellipsis={{ rows: 3, expandable: true }}>{content}</Paragraph>
            {content ? <Paragraph copyable ellipsis={{ rows: 3, expandable: true }}>{content}</Paragraph> : null}
          </div>
        </div>
      )
@@ -313,6 +315,10 @@
    this.props.handleTableId(_id, _data)
  }
  shouldComponentUpdate (nextProps, nextState) {
    return !is(fromJS(this.props), fromJS(nextProps)) || !is(fromJS(this.state), fromJS(nextState))
  }
  render() {
    let { selectedRowKeys } = this.state
@@ -325,6 +331,11 @@
      }
    }
    let _data = this.props.data ? this.props.data : []
    if (this.props.pickup) {
      _data = _data.filter((item, index) => selectedRowKeys.includes(index))
    }
    return (
      <div className="sub-table">
        <Table
@@ -332,7 +343,7 @@
          bordered={true}
          rowSelection={rowSelection}
          columns={this.state.columns}
          dataSource={this.props.data ? this.props.data : []}
          dataSource={_data}
          loading={this.props.loading}
          scroll={{ x: '100%', y: false }}
          onRow={(record, index) => {