king
2022-11-08 d0e8c7cb64d7d219f7cfec8bc87cf699b9cfe7b2
src/menu/components/table/base-table/columns/index.jsx
@@ -12,7 +12,7 @@
import './index.scss'
const { confirm } = Modal
const EditColumn = asyncIconComponent(() => import('./editColumn'))
const EditColumn = asyncComponent(() => import('./editColumn'))
const MarkColumn = asyncIconComponent(() => import('@/menu/components/share/markcomponent'))
const CardCellComponent = asyncComponent(() => import('@/menu/components/card/cardcellcomponent'))
const PasteComponent = asyncIconComponent(() => import('@/components/paste'))
@@ -576,6 +576,16 @@
    }
    const columns = this.handlecolumns(this.state.columns, fields, config)
    let groups = null
    if (columns.length > 12) {
      let g = Math.ceil(columns.length / 8)
      let n = Math.ceil(columns.length / g)
      groups = []
      for (let i = 0, len = columns.length; i < len; i += n) {
        groups.push(columns.slice(i, i + n))
      }
    }
    return (
      <div className={`normal-table-columns ${config.setting.laypage} ${config.wrap.tableType} ${config.wrap.mode || ''}`} id={tableId}>
@@ -585,10 +595,29 @@
          <MarkColumn columns={fields} type="line" marks={lineMarks} onSubmit={this.updateLineMarks} />
        </div>
        <DndProvider>
          {groups ? groups.map((group, i) => {
            return <Table
              key={i}
              rowKey="uuid"
              size={config.wrap.size || 'middle'}
              bordered={config.wrap.bordered !== 'false'}
              components={components}
              dataSource={this.state.data}
              rowSelection={config.wrap.tableType && i === 0 ? { type: 'radio' } : null}
              columns={group}
              pagination={i === groups.length - 1 ? {
                current: 1,
                pageSize: 10,
                pageSizeOptions: ['10', '25', '50', '100', '500', '1000'],
                showSizeChanger: true,
                total: 58,
                showTotal: (total, range) => `${range[0]}-${range[1]} 共 ${total} 条`
              } : false}
            />
          }) :
          <Table
            rowKey="uuid"
            size={config.wrap.size || 'middle'}
            rowClassName="editable-row"
            bordered={config.wrap.bordered !== 'false'}
            components={components}
            dataSource={this.state.data}
@@ -602,7 +631,7 @@
              total: 58,
              showTotal: (total, range) => `${range[0]}-${range[1]} 共 ${total} 条`
            }}
          />
          />}
        </DndProvider>
        <EditColumn column={card} fields={fields} submitCol={this.submitCol} cancelCol={this.cancelCol}/>
      </div>