| | |
| | | fieldlen[item.field] = _fieldlen |
| | | |
| | | if (item.type === 'select' || item.type === 'link' || item.type === 'multiselect' || item.type === 'radio' || item.type === 'checkbox') { |
| | | if (item.setAll === 'true') { |
| | | if (item.setAll === 'true' && (item.type === 'select' || item.type === 'link' || item.type === 'radio')) { |
| | | item.options.unshift({ |
| | | key: Utils.getuuid(), |
| | | Value: '', |
| | | Text: this.props.dict['main.all'] |
| | | Text: item.emptyText || '空' |
| | | }) |
| | | } |
| | | |
| | |
| | | |
| | | let _formlist = formlist.map(item => { |
| | | if (['select', 'link', 'multiselect', 'radio', 'checkbox', 'checkcard'].includes(item.type) && result[item.field] && result[item.field].length > 0) { |
| | | let options = result[item.field].map(cell => { |
| | | let options = [] |
| | | result[item.field].forEach(cell => { |
| | | let _cell = { key: Utils.getuuid() } |
| | | |
| | | if (item.type !== 'checkcard') { |
| | | _cell.Value = cell[item.valueField] |
| | | _cell.Text = cell[item.valueText] |
| | | if ((!_cell.Value && _cell.Value !== 0) || (!_cell.Text && _cell.Text !== 0)) return |
| | | } else { |
| | | _cell.$value = cell[item.valueField] |
| | | _cell = {..._cell, ...cell} |
| | | if (!_cell.$value && _cell.$value !== 0) return |
| | | } |
| | | |
| | | if (item.type === 'link') { |
| | | _cell.ParentID = cell[item.linkField] |
| | | _cell.ParentID = cell[item.linkField] === undefined ? '' : cell[item.linkField] |
| | | } else if ((item.type === 'select' || item.type === 'radio') && item.linkSubField && item.linkSubField.length > 0) { |
| | | item.linkSubField.forEach(_field => { |
| | | _cell[_field] = (cell[_field] || cell[_field] === 0) ? cell[_field] : '' |
| | | }) |
| | | } |
| | | |
| | | return _cell |
| | | options.push(_cell) |
| | | }) |
| | | |
| | | item.oriOptions = [...item.oriOptions, ...options] |
| | |
| | | |
| | | let _formlist = formlist.map(item => { |
| | | if (['select', 'link', 'multiselect', 'radio', 'checkbox', 'checkcard'].includes(item.type) && result[item.field] && result[item.field].length > 0) { |
| | | let options = result[item.field].map(cell => { |
| | | let options = [] |
| | | result[item.field].forEach(cell => { |
| | | let _cell = { key: Utils.getuuid() } |
| | | |
| | | if (item.type !== 'checkcard') { |
| | | _cell.Value = cell[item.valueField] |
| | | _cell.Text = cell[item.valueText] |
| | | if ((!_cell.Value && _cell.Value !== 0) || (!_cell.Text && _cell.Text !== 0)) return |
| | | } else { |
| | | _cell.$value = cell[item.valueField] |
| | | _cell = {..._cell, ...cell} |
| | | if (!_cell.$value && _cell.$value !== 0) return |
| | | } |
| | | |
| | | if (item.type === 'link') { |
| | | _cell.ParentID = cell[item.linkField] |
| | | _cell.ParentID = cell[item.linkField] === undefined ? '' : cell[item.linkField] |
| | | } else if ((item.type === 'select' || item.type === 'radio') && item.linkSubField && item.linkSubField.length > 0) { |
| | | item.linkSubField.forEach(_field => { |
| | | _cell[_field] = (cell[_field] || cell[_field] === 0) ? cell[_field] : '' |
| | | }) |
| | | } |
| | | |
| | | return _cell |
| | | options.push(_cell) |
| | | }) |
| | | |
| | | item.oriOptions = [...item.oriOptions, ...options] |
| | |
| | | })( |
| | | <Select |
| | | showSearch |
| | | allowClear={true} |
| | | filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0} |
| | | onChange={(value) => {this.selectChange(item, value)}} |
| | | disabled={item.readonly === 'true'} |