| | |
| | | val = '' |
| | | } |
| | | return (<td className="editing_table_cell"> |
| | | <InputNumber className={err ? 'has-error' : ''} title={err} id={col.uuid + record.$$uuid} defaultValue={val} onChange={(val) => this.onChange(val)} onPressEnter={this.enterPress} onBlur={this.onBlur}/> |
| | | <InputNumber className={err ? 'has-error' : ''} precision={col.decimal || 0} title={err} id={col.uuid + record.$$uuid} defaultValue={val} onChange={(val) => this.onChange(val)} onPressEnter={this.enterPress} onBlur={this.onBlur}/> |
| | | </td>) |
| | | } else { |
| | | return (<td className={className + ' pointer'} style={style}> |
| | |
| | | // eslint-disable-next-line |
| | | content = eval(content) |
| | | } catch (e) { |
| | | if (window.debugger) { |
| | | console.info(content) |
| | | console.warn(e) |
| | | } |
| | | content = '' |
| | | } |
| | | } |
| | |
| | | |
| | | if (col.noValue === 'hide' && content === 0) { |
| | | content = '' |
| | | } |
| | | |
| | | if (col.round && typeof(content) === 'number') { |
| | | content = Math.round(content * col.round) / col.round |
| | | content = content.toFixed(col.decimal) |
| | | } |
| | | |
| | | if (content !== '') { |
| | |
| | | style = {...style, ...col.style} |
| | | } |
| | | |
| | | children = ( |
| | | <CardCellComponent data={record} cards={config} elements={col.elements}/> |
| | | ) |
| | | } else if (col.type === 'action') { |
| | | style.padding = '0px' |
| | | if (col.style) { |
| | | style = {...style, ...col.style} |
| | | } |
| | | children = ( |
| | | <CardCellComponent data={record} cards={config} elements={col.elements}/> |
| | | ) |
| | |
| | | } |
| | | |
| | | children = (<> |
| | | <InputNumber className={err ? 'has-error' : ''} title={err} id={col.uuid + record.$$uuid} defaultValue={_value} onChange={(val) => this.onChange(val)} onPressEnter={this.enterPress} onBlur={this.onBlur}/> |
| | | <InputNumber className={err ? 'has-error' : ''} title={err} precision={col.decimal || 0} id={col.uuid + record.$$uuid} defaultValue={_value} onChange={(val) => this.onChange(val)} onPressEnter={this.enterPress} onBlur={this.onBlur}/> |
| | | </>) |
| | | } else { |
| | | let content = '' |
| | |
| | | // eslint-disable-next-line |
| | | content = eval(content) |
| | | } catch (e) { |
| | | if (window.debugger) { |
| | | console.info(content) |
| | | console.warn(e) |
| | | } |
| | | content = '' |
| | | } |
| | | } |
| | |
| | | |
| | | if (col.noValue === 'hide' && content === 0) { |
| | | content = '' |
| | | } |
| | | |
| | | if (col.round && typeof(content) === 'number') { |
| | | content = Math.round(content * col.round) / col.round |
| | | content = content.toFixed(col.decimal) |
| | | } |
| | | |
| | | if (content !== '') { |
| | |
| | | style = {...style, ...col.style} |
| | | } |
| | | |
| | | children = ( |
| | | <CardCellComponent data={record} cards={config} elements={col.elements}/> |
| | | ) |
| | | } else if (col.type === 'action') { |
| | | style.padding = '0px' |
| | | if (col.style) { |
| | | style = {...style, ...col.style} |
| | | } |
| | | children = ( |
| | | <CardCellComponent data={record} cards={config} elements={col.elements}/> |
| | | ) |
| | |
| | | onCell: record => ({ |
| | | record, |
| | | col: item, |
| | | config: item.type === 'custom' || item.type === 'action' ? {setting, columns: fields} : null, |
| | | config: item.type === 'custom' ? {setting, columns: fields} : null, |
| | | }) |
| | | } |
| | | } |