| | |
| | | let _searchlist = fromJS(this.state.searchlist).toJS().map(item => { |
| | | if (['select', 'link', 'multiselect', 'checkcard'].includes(item.type) && result[item.field] && result[item.field].length > 0) { |
| | | let options = [] |
| | | let map = new Map() |
| | | result[item.field].forEach(cell => { |
| | | let _item = { |
| | | key: Utils.getuuid() |
| | | } |
| | | |
| | | if (item.type !== 'checkcard') { |
| | | _item.Value = cell[item.valueField] |
| | | _item.Text = cell[item.valueText] |
| | | if (!_item.Text && _item.Text !== 0) { |
| | | return |
| | | } |
| | | } else { |
| | | _item.$value = cell[item.cardValField] |
| | | _item = {..._item, ...cell} |
| | | key: Utils.getuuid(), |
| | | ParentID: '' |
| | | } |
| | | |
| | | if (item.linkField) { |
| | | _item.ParentID = cell[item.linkField] |
| | | } |
| | | |
| | | if (item.type !== 'checkcard') { |
| | | _item.Value = cell[item.valueField] |
| | | _item.Text = cell[item.valueText] + '' |
| | | |
| | | if (!_item.Text || map.has(_item.ParentID + _item.Value)) return |
| | | |
| | | map.set(_item.ParentID + _item.Value, 0) |
| | | } else { |
| | | _item.$value = cell[item.cardValField] |
| | | _item = {..._item, ...cell} |
| | | |
| | | if (map.has(_item.ParentID + _item.$value)) return |
| | | |
| | | map.set(_item.ParentID + _item.$value, 0) |
| | | } |
| | | |
| | | options.push(_item) |
| | | }) |
| | | |