| | |
| | | let _cols = new Map() |
| | | let _data = null |
| | | let _sync = _config.setting.sync === 'true' |
| | | |
| | | if (_config.wrap.controlField) { |
| | | if (_config.wrap.controlVal) { |
| | | _config.wrap.controlVal = _config.wrap.controlVal.split(',') |
| | | } else { |
| | | _config.wrap.controlVal = [''] |
| | | } |
| | | } |
| | | |
| | | let setting = {..._config.setting, ..._config.wrap, style: {}} |
| | | |
| | | if (setting.selected !== 'always' && setting.selected !== 'init') { |
| | |
| | | item.$$BID = BID || '' |
| | | item.$$BData = BData || '' |
| | | item.$Index = index + 1 + '' |
| | | |
| | | if (setting.controlField) { |
| | | if (setting.controlVal.includes(item[setting.controlField])) { |
| | | item.$disabled = true |
| | | } |
| | | } |
| | | |
| | | return item |
| | | }) |
| | | |
| | |
| | | if (_config.wrap.collapse === 'true') { |
| | | _config.wrap.title = _config.wrap.title || ' ' |
| | | } |
| | | |
| | | _config.style = _config.style || {} |
| | | |
| | | this.setState({ |
| | | pageSize: setting.pageSize || 10, |
| | |
| | | item.$$BID = BID || '' |
| | | item.$$BData = BData || '' |
| | | item.$Index = start + index + '' |
| | | |
| | | if (setting.controlField) { |
| | | if (setting.controlVal.includes(item[setting.controlField])) { |
| | | item.$disabled = true |
| | | } |
| | | } |
| | | |
| | | return item |
| | | }), |
| | | selectedData: [], |
| | |
| | | item.$$BID = BID || '' |
| | | item.$$BData = BData || '' |
| | | item.$Index = index + 1 + '' |
| | | |
| | | if (setting.controlField) { |
| | | if (setting.controlVal.includes(item[setting.controlField])) { |
| | | item.$disabled = true |
| | | } |
| | | } |
| | | |
| | | return item |
| | | }) |
| | | |
| | |
| | | } |
| | | |
| | | render() { |
| | | const { BID, setting, searchlist, actions, config, columns, selectedData, BData } = this.state |
| | | const { BID, setting, searchlist, actions, config, columns, selectedData, BData, data } = this.state |
| | | |
| | | let style = {...config.style} |
| | | if (config.wrap.empty === 'hidden' && (!data || data.length === 0)) { |
| | | style.display = 'none' |
| | | } |
| | | |
| | | return ( |
| | | <div className="custom-normal-table" style={config.style}> |
| | | <div className="custom-normal-table" style={style}> |
| | | {config.wrap.collapse === 'true' ? <Collapse bordered={false} defaultActiveKey="1" expandIconPosition="right"> |
| | | <Panel forceRender={true} header={<NormalHeader config={config}/>} key="1"> |
| | | {searchlist && searchlist.length ? |
| | |
| | | setting={setting} |
| | | columns={columns} |
| | | MenuID={config.uuid} |
| | | data={this.state.data} |
| | | data={data} |
| | | fields={config.columns} |
| | | total={this.state.total} |
| | | lineMarks={config.lineMarks} |