| | |
| | | selectable: PropTypes.bool, |
| | | dict: PropTypes.object, // 字典项 |
| | | columns: PropTypes.array, // 表格列 |
| | | data: PropTypes.oneOfType([ |
| | | PropTypes.object, |
| | | PropTypes.array |
| | | ]) |
| | | actions: PropTypes.any, |
| | | data: PropTypes.any |
| | | } |
| | | |
| | | state = { |
| | |
| | | pageSize: 10, |
| | | columns: this.props.columns.map(item => { |
| | | let _width = parseInt(item.Width) || 50 |
| | | // if (/ID$/.test(item.FieldName) || item.FieldName.includes('PassWord')) { |
| | | // _width = _width * 3 |
| | | // } else if (item.FieldName.includes('Date')) { |
| | | // _width = _width * 2 |
| | | // } |
| | | |
| | | return { |
| | | align: item.Align, |
| | | dataIndex: item.FieldName, |
| | |
| | | onChange: this.onSelectChange |
| | | } |
| | | } |
| | | let offset = 48 |
| | | if (this.props.actions && this.props.actions.length > 0) { |
| | | offset = 105 |
| | | } |
| | | return ( |
| | | <div className="datamanage-table"> |
| | | {this.state.fixed && <Affix offsetTop={105} className="fix-header"> |
| | | {this.state.fixed && <Affix offsetTop={offset} className="fix-header"> |
| | | <Table |
| | | bordered={true} |
| | | rowSelection={rowSelection} |