| | |
| | | |
| | | const { Paragraph } = Typography |
| | | const MkIcon = asyncComponent(() => import('@/components/mk-icon')) |
| | | const MKPopSelect = asyncComponent(() => import('./mkPopSelect')) |
| | | const CardCellComponent = asyncComponent(() => import('@/tabviews/custom/components/card/cardcellList')) |
| | | |
| | | class CusSwitch extends Component { |
| | |
| | | }, 10) |
| | | } |
| | | |
| | | onPopChange = () => { |
| | | |
| | | } |
| | | |
| | | render() { |
| | | let { col, config, record, style, className, ...resProps } = this.props |
| | | const { editing, value, err } = this.state |
| | |
| | | |
| | | return (<td onClick={(e) => e.stopPropagation()} className="editing_table_cell"> |
| | | <CusSwitch config={col} defaultValue={_value} autoFocus={true} onChange={this.onSwitchChange} onBlur={this.switchBlur}/> |
| | | </td>) |
| | | } else if (col.editType === 'popSelect') { |
| | | let _value = record[col.field] !== undefined ? record[col.field] : '' |
| | | |
| | | return (<td onClick={(e) => e.stopPropagation()} className="editing_table_cell"> |
| | | <MKPopSelect defaultValue={_value} config={col} BID={record.$$BID} ID={record.$$uuid} onChange={this.onPopChange} onSubmit={() => {}}/> |
| | | </td>) |
| | | } else { |
| | | let _value = record[col.field] !== undefined ? record[col.field] : '' |
| | |
| | | MKEmitter.emit('changeRecord', col.tableId, {...record, [col.field]: _val}) |
| | | } |
| | | |
| | | onPopChange = () => { |
| | | |
| | | } |
| | | |
| | | render() { |
| | | let { col, config, record, style, className, ...resProps } = this.props |
| | | const { err } = this.state |
| | |
| | | children = ( |
| | | <CusDatePicker config={col} value={record[col.field] || null} onChange={this.onDateChange} blur={() => {}}/> |
| | | ) |
| | | } else if (col.editType === 'popSelect') { |
| | | children = ( |
| | | <MKPopSelect config={col} defaultValue={record[col.field] || ''} BID={record.$$BID} ID={record.$$uuid} onChange={this.onPopChange} onSubmit={() => {}}/> |
| | | ) |
| | | } else { |
| | | children = (<> |
| | | <Select |