king
2020-12-23 e9640ccdc9fe57f91919e3f51462c780e44fadb0
src/tabviews/custom/components/share/normalTable/index.jsx
@@ -391,9 +391,7 @@
  }
  UNSAFE_componentWillMount () {
    const { menuType, memberLevel, setting, fields } = this.props
    let columns = fromJS(this.props.columns).toJS()
    let _columns = []
    const { menuType, memberLevel, setting, fields, columns } = this.props
    let radio = 5          // 虚化比例
    let _format = false    // 是否虚化处理
    let rowspans = []
@@ -408,40 +406,13 @@
      }
    }
    columns.forEach(item => {
      if (item.hidden === true || item.Hide === 'true') return
    let getColumns = (cols) => {
      return cols.map(item => {
      let cell = null
      if (item.type === 'colspan') {
        cell = {title: item.label, children: []}
        item.subcols.forEach(col => {
          if (col.rowspan === 'true') {
            rowspans.push(col.field)
          }
          if (_format && !Math.floor(Math.random() * radio)) {
            col.blur = true
          }
          if (col.marks && col.marks.length === 0) {
            col.marks = ''
          }
          cell.children.push({
            align: col.Align,
            title: col.label,
            dataIndex: col.field || col.uuid,
            key: col.uuid,
            width: col.Width || 120,
            onCell: record => ({
              record,
              col,
              config: col.type === 'custom' ? {setting, columns: fields} : null,
              triggerLink: this.triggerLink,
              updateStatus: this.updateStatus
            })
          })
        })
          cell = { title: item.label, align: item.Align }
          cell.children = getColumns(item.subcols)
      } else {
        if (item.rowspan === 'true') {
          rowspans.push(item.field)
@@ -456,7 +427,7 @@
        cell = {
          align: item.Align,
          dataIndex: item.field || item.uuid,
            dataIndex: item.uuid,
          title: item.label,
          sorter: item.field && item.IsSort === 'true',
          width: item.Width || 120,
@@ -470,8 +441,11 @@
        }
      }
      _columns.push(cell)
        return cell
    })
    }
    let _columns = getColumns(columns)
    if (rowspans.length === 0) {
      rowspans = null