| | |
| | | |
| | | let resource = this.props.form.getFieldValue('dataSource') || '' |
| | | |
| | | resource = `select '' as ${field},'全部' as ${text} union all \n${resource}` |
| | | if (field === text) { |
| | | resource = `select '' as ${field} union all \n${resource}` |
| | | } else { |
| | | resource = `select '' as ${field},'全部' as ${text} union all \n${resource}` |
| | | } |
| | | |
| | | this.props.form.setFieldsValue({dataSource: resource}) |
| | | } |
| | |
| | | if (item.resourceType === '1' && result[item.uuid] && result[item.uuid].length > 0) { |
| | | let options = [] |
| | | let _map = new Map() |
| | | let all = false |
| | | result[item.uuid].forEach(cell => { |
| | | let _cell = {key: Utils.getuuid()} |
| | | |
| | | _cell.value = cell[item.valueField] |
| | | _cell.label = cell[item.valueText] |
| | | |
| | | if (!_cell.label && _cell.label !== 0) return |
| | | if (!_cell.label && _cell.label !== 0) { |
| | | if (!all) { |
| | | _cell.label = '全部' |
| | | all = true |
| | | } else { |
| | | return |
| | | } |
| | | } |
| | | |
| | | if (_map.has(_cell.value)) return |
| | | _map.set(_cell.value, 0) |
| | |
| | | if (['select', 'link', 'radio', 'checkbox', 'checkcard', 'multiselect', 'cascader'].includes(item.type) && result[item.field] && result[item.field].length > 0) { |
| | | let options = [] |
| | | let map = new Map() |
| | | let all = false |
| | | result[item.field].forEach(cell => { |
| | | let _cell = { key: Utils.getuuid() , ParentID: ''} |
| | | |
| | |
| | | if (item.type !== 'checkcard') { |
| | | _cell.value = cell[item.valueField] |
| | | _cell.label = cell[item.valueText] + '' |
| | | if (!_cell.label || map.has(_cell.ParentID + _cell.value)) return |
| | | if (map.has(_cell.ParentID + _cell.value)) return |
| | | if (!_cell.label) { |
| | | if (!all) { |
| | | _cell.label = '全部' |
| | | all = true |
| | | } else { |
| | | return |
| | | } |
| | | } |
| | | |
| | | map.set(_cell.ParentID + _cell.value, 0) |
| | | } else { |
| | |
| | | if (['select', 'link', 'multiselect', 'checkcard'].includes(item.type) && result[item.field] && result[item.field].length > 0) { |
| | | let options = [] |
| | | let map = new Map() |
| | | let all = false |
| | | result[item.field].forEach(cell => { |
| | | let _item = { |
| | | key: Utils.getuuid(), |
| | |
| | | _item.Value = cell[item.valueField] |
| | | _item.Text = cell[item.valueText] + '' |
| | | |
| | | if (!_item.Text || map.has(_item.ParentID + _item.Value)) return |
| | | if (map.has(_item.ParentID + _item.Value)) return |
| | | if (!_item.Text) { |
| | | if (!all) { |
| | | _item.Text = '全部' |
| | | all = true |
| | | } else { |
| | | return |
| | | } |
| | | } |
| | | |
| | | map.set(_item.ParentID + _item.Value, 0) |
| | | } else { |
| | |
| | | |
| | | let resource = this.props.form.getFieldValue('dataSource') || '' |
| | | |
| | | resource = `select '' as ${field},'全部' as ${text} union all \n${resource}` |
| | | if (field === text) { |
| | | resource = `select '' as ${field} union all \n${resource}` |
| | | } else { |
| | | resource = `select '' as ${field},'全部' as ${text} union all \n${resource}` |
| | | } |
| | | |
| | | this.props.form.setFieldsValue({dataSource: resource}) |
| | | } |
| | |
| | | |
| | | let resource = this.props.form.getFieldValue('dataSource') || '' |
| | | |
| | | resource = `select '' as ${field},'全部' as ${text} union all \n${resource}` |
| | | if (field === text) { |
| | | resource = `select '' as ${field} union all \n${resource}` |
| | | } else { |
| | | resource = `select '' as ${field},'全部' as ${text} union all \n${resource}` |
| | | } |
| | | |
| | | this.props.form.setFieldsValue({dataSource: resource}) |
| | | } |