king
2021-09-24 95ccc1acc6d8ede1c839493e7aecc9c97fd34c8c
src/tabviews/zshare/normalTable/index.jsx
@@ -17,6 +17,16 @@
const TabButton = asyncComponent(() => import('@/tabviews/zshare/actionList/tabbutton'))
const NewPageButton = asyncComponent(() => import('@/tabviews/zshare/actionList/newpagebutton'))
class BodyRow extends React.Component {
  shouldComponentUpdate (nextProps) {
    return this.props.className !== nextProps.className
  }
  render() {
    return <tr {...this.props}/>
  }
}
class NormalTable extends Component {
  static propTpyes = {
    tableId: PropTypes.string,       // 列表Id
@@ -49,7 +59,7 @@
  }
  UNSAFE_componentWillMount () {
    const { menuType, memberLevel, pageSize } = this.props
    const { menuType, memberLevel, pageSize, setting } = this.props
    let columns = fromJS(this.props.columns).toJS()
    let lineMarks = []
    let _columns = []
@@ -57,6 +67,42 @@
    let _format = false    // 是否虚化处理
    let rowspans = []
    if (setting.tableMode === 'fast') {
      rowspans = null
      columns.forEach(item => {
        if (item.hidden === true || item.Hide === 'true') return
        let cell = null
        if (item.type === 'colspan' || item.type === 'old_colspan') {
          cell = {title: item.label, children: []}
          item.subcols.forEach(col => {
            cell.children.push({
              align: col.Align,
              title: col.label,
              dataIndex: col.field || col.uuid,
              key: col.uuid,
              width: col.Width || 120
            })
          })
        } else {
          if (item.type === 'index') {
            item.field = '$Index'
            item.type = 'text'
          }
          cell = {
            align: item.Align,
            dataIndex: item.field || item.uuid,
            title: item.label,
            sorter: item.field && item.IsSort === 'true',
            width: item.Width || 120
          }
        }
        _columns.push(cell)
      })
    } else {
    if (window.GLOB.dataFormat && menuType !== 'HS' && memberLevel) {
      _format = true
@@ -173,6 +219,7 @@
    if (rowspans.length === 0) {
      rowspans = null
      }
    }
    
    this.setState({
@@ -1056,6 +1103,14 @@
    const { setting, pickup, statFValue } = this.props
    const { selectedRowKeys, lineMarks, activeIndex } = this.state
    let components = {
      body: {}
    }
    if (setting.tableMode === 'fast') {
      components.body.row = BodyRow
    }
    // 设置表格选择属性:单选、多选、不可选
    let rowSelection = null
    if (setting.tableType) {
@@ -1136,6 +1191,7 @@
          />
        </Affix>}
        <Table
          components={components}
          size={setting.size || 'middle'}
          style={style}
          bordered={setting.bordered !== 'false'}