| | |
| | | return <MkEditIcon allowClear/> |
| | | } else if (inputType === 'select') { |
| | | return ( |
| | | <Select> |
| | | {options.map((item, i) => (<Select.Option key={i} value={item.field || item.value}> {item.label || item.text} </Select.Option>))} |
| | | <Select showSearch filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0}> |
| | | {options.map((item, i) => (<Select.Option key={i} value={item.field || item.value}>{item.label || item.text}</Select.Option>))} |
| | | </Select> |
| | | ) |
| | | } else if (inputType === 'multiStr') { |
| | |
| | | }) |
| | | }) |
| | | }) |
| | | } else if (col.inputType === 'cascader') { |
| | | let keys = record[col.dataIndex] |
| | | let _options = [] |
| | | let rematch = (options, level) => { |
| | | options.some(m => { |
| | | if (!m.value || m.value !== keys[level]) return false |
| | | |
| | | _options.push(m) |
| | | |
| | | if (m.children && keys[level + 1]) { |
| | | rematch(m.children, level + 1) |
| | | } |
| | | return true |
| | | }) |
| | | } |
| | | |
| | | rematch(col.options, 0) |
| | | |
| | | if (_options.length) { |
| | | col.extends.forEach(n => { |
| | | record[n.value] = _options.map(o => o[n.key]).join(' / ') |
| | | }) |
| | | } |
| | | } else { |
| | | let key = record[col.dataIndex] |
| | | let option = col.options.filter(m => m.value === key)[0] |