| | |
| | | const TabButton = asyncComponent(() => import('@/tabviews/zshare/actionList/tabbutton')) |
| | | const NewPageButton = asyncComponent(() => import('@/tabviews/zshare/actionList/newpagebutton')) |
| | | |
| | | class BodyRow extends React.Component { |
| | | shouldComponentUpdate (nextProps) { |
| | | return this.props.className !== nextProps.className |
| | | } |
| | | |
| | | render() { |
| | | return <tr {...this.props}/> |
| | | } |
| | | } |
| | | |
| | | class NormalTable extends Component { |
| | | static propTpyes = { |
| | | tableId: PropTypes.string, // 列表Id |
| | |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | | const { menuType, memberLevel, pageSize } = this.props |
| | | const { menuType, memberLevel, pageSize, setting } = this.props |
| | | let columns = fromJS(this.props.columns).toJS() |
| | | let lineMarks = [] |
| | | let _columns = [] |
| | |
| | | let _format = false // 是否虚化处理 |
| | | let rowspans = [] |
| | | |
| | | if (setting.tableMode === 'fast') { |
| | | rowspans = null |
| | | columns.forEach(item => { |
| | | if (item.hidden === true || item.Hide === 'true') return |
| | | let cell = null |
| | | |
| | | if (item.type === 'colspan' || item.type === 'old_colspan') { |
| | | cell = {title: item.label, children: []} |
| | | |
| | | item.subcols.forEach(col => { |
| | | cell.children.push({ |
| | | align: col.Align, |
| | | title: col.label, |
| | | dataIndex: col.field || col.uuid, |
| | | key: col.uuid, |
| | | width: col.Width || 120 |
| | | }) |
| | | }) |
| | | } else { |
| | | if (item.type === 'index') { |
| | | item.field = '$Index' |
| | | item.type = 'text' |
| | | } |
| | | |
| | | cell = { |
| | | align: item.Align, |
| | | dataIndex: item.field || item.uuid, |
| | | title: item.label, |
| | | sorter: item.field && item.IsSort === 'true', |
| | | width: item.Width || 120 |
| | | } |
| | | } |
| | | |
| | | _columns.push(cell) |
| | | }) |
| | | } else { |
| | | if (window.GLOB.dataFormat && menuType !== 'HS' && memberLevel) { |
| | | _format = true |
| | | |
| | |
| | | |
| | | if (rowspans.length === 0) { |
| | | rowspans = null |
| | | } |
| | | } |
| | | |
| | | this.setState({ |
| | |
| | | const { setting, pickup, statFValue } = this.props |
| | | const { selectedRowKeys, lineMarks, activeIndex } = this.state |
| | | |
| | | let components = { |
| | | body: {} |
| | | } |
| | | |
| | | if (setting.tableMode === 'fast') { |
| | | components.body.row = BodyRow |
| | | } |
| | | |
| | | // 设置表格选择属性:单选、多选、不可选 |
| | | let rowSelection = null |
| | | if (setting.tableType) { |
| | |
| | | /> |
| | | </Affix>} |
| | | <Table |
| | | components={components} |
| | | size={setting.size || 'middle'} |
| | | style={style} |
| | | bordered={setting.bordered !== 'false'} |