| | |
| | | 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')) |
| | |
| | | } |
| | | |
| | | 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}> |
| | |
| | | <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} |
| | |
| | | total: 58, |
| | | showTotal: (total, range) => `${range[0]}-${range[1]} 共 ${total} 条` |
| | | }} |
| | | /> |
| | | />} |
| | | </DndProvider> |
| | | <EditColumn column={card} fields={fields} submitCol={this.submitCol} cancelCol={this.cancelCol}/> |
| | | </div> |