| | |
| | | let fields = [] |
| | | let dataItem = data[0] || '' |
| | | |
| | | if (type === 'select' || type === 'radio') { |
| | | if (type === 'select' || type === 'radio' || type === 'link') { |
| | | fields = linkSubFields.map(cell => { |
| | | return { |
| | | title: cell.label, |
| | |
| | | if (isNaN(val)) { |
| | | val = '' |
| | | } |
| | | } catch { |
| | | } catch (e) { |
| | | val = '' |
| | | } |
| | | } else { |
| | |
| | | }) |
| | | } |
| | | |
| | | handleAdd = () => { |
| | | handleAdd = (e) => { |
| | | e.stopPropagation() |
| | | const { type, count, dataSource } = this.state |
| | | const newData = { |
| | | key: Utils.getuuid(), |
| | |
| | | let fields = [] |
| | | |
| | | if ((type === 'select' || type === 'radio') && linkSubFields.length > this.state.linkSubFields) { |
| | | let addcol = linkSubFields[linkSubFields.length - 1] |
| | | let addcol = linkSubFields.slice(-1)[0] |
| | | dataSource = dataSource.map(data => { |
| | | data[addcol.field] = data.Text |
| | | return data |
| | |
| | | |
| | | let dataItem = dataSource ? dataSource[0] : '' |
| | | |
| | | if (type === 'select' || type === 'radio') { |
| | | if (type === 'select' || type === 'radio' || type === 'link') { |
| | | fields = linkSubFields.map(field => { |
| | | return { |
| | | title: field.label, |
| | |
| | | title={this.props.dict['model.query.delete']} |
| | | onConfirm={() => this.handleDelete(record.key) |
| | | }> |
| | | <span style={{color: '#1890ff', cursor: 'pointer'}}><Icon type="delete" /></span> |
| | | <span style={{color: '#ff4d4f', cursor: 'pointer'}}><Icon type="delete" /></span> |
| | | </Popconfirm> |
| | | </div> |
| | | ) : null, |