king
2021-02-05 a8ec1d4136507d54580c2599fbfbc70a9a38ee62
src/tabviews/custom/components/share/normalTable/index.jsx
@@ -170,7 +170,7 @@
  }
  render() {
    let { col, config, record, className, style, triggerLink, updateStatus, ...resProps } = this.props
    let { col, config, record, className, style, triggerLink, ...resProps } = this.props
    if (!col) return (<td {...resProps} className={className} style={style}/>)
    
@@ -246,6 +246,10 @@
      if (col.blur) {
        content = md5(content)
      }
      if (col.rowspan === 'true') {
        resProps.rowSpan = record['$$' + col.field]
      }
      if (col.linkThdMenu || col.linkurl) {
@@ -347,12 +351,12 @@
    } else if (col.type === 'custom') {
      style.padding = '0px'
      resProps.children = (
        <CardCellComponent data={record} cards={config} elements={col.elements} updateStatus={this.props.updateStatus}/>
        <CardCellComponent data={record} cards={config} elements={col.elements}/>
      )
    } else if (col.type === 'action') {
      style.padding = '0px 5px'
      resProps.children = (
        <CardCellComponent data={record} cards={config} elements={col.elements} updateStatus={this.props.updateStatus}/>
        <CardCellComponent data={record} cards={config} elements={col.elements}/>
      )
    }
@@ -376,7 +380,6 @@
    loading: PropTypes.bool,         // 表格加载中
    refreshdata: PropTypes.func,     // 表格中排序列、页码的变化时刷新
    chgSelectData: PropTypes.func,   // 数据切换
    refreshbyaction: PropTypes.func, // 按钮执行完成后刷新
  }
  state = {
@@ -442,8 +445,7 @@
              record,
              col: item,
              config: item.type === 'custom' || item.type === 'action' ? {setting, columns: fields} : null,
              triggerLink: this.triggerLink,
              updateStatus: this.updateStatus
              triggerLink: this.triggerLink
            })
          }
        }
@@ -498,12 +500,6 @@
      return
    }
    MKEmitter.removeListener('resetTable', this.resetTable)
  }
  updateStatus = (type, positon, btn) => {
    if (type === 'refresh') {
      this.props.refreshbyaction(positon, btn)
    }
  }
  // 字段透视
@@ -581,7 +577,7 @@
      index = selectedRowKeys.slice(-1)[0]
    }
    if (setting.tableType === 'checkbox') {
    if (setting.tableType === 'checkbox' || setting.tableType === 'radio') {
      _activeIndex = index === '' ? null : index
    }
@@ -607,7 +603,7 @@
    if (setting.tableType === 'radio') {
      newkeys = [index]
      this.changedata(index)
      this.setState({ selectedRowKeys: newkeys })
      this.setState({ selectedRowKeys: newkeys, activeIndex: index })
    } else {
      let _index = ''
      if (newkeys.includes(index)) {
@@ -697,13 +693,13 @@
        let preItem = data[index - 1]
        rowspans.forEach((cell, i) => {
          if (i === 0) {
            if ((item[cell] || item[cell] === 0) && preItem[cell] === item[cell]) {
            if (preItem[cell] === item[cell]) {
              item['$' + cell] = preItem['$' + cell] + 1
            } else {
              item['$' + cell] = 1
            }
          } else {
            if ((item[cell] || item[cell] === 0) && preItem[cell] === item[cell]) {
            if (preItem[cell] === item[cell]) {
              item['$' + cell] = preItem['$' + cell] + 1
            } else {
              item['$' + cell] = 1
@@ -803,8 +799,8 @@
          <Switch title="收起" className="main-pickup" checkedChildren="开" unCheckedChildren="关" defaultChecked={pickup} onChange={this.pickupChange} /> : null
        }
        <Table
          size="middle"
          components={components}
          size={setting.size || 'middle'}
          bordered={setting.bordered !== 'false'}
          rowSelection={rowSelection}
          columns={this.state.columns}