From 94339c7aa85dfc23a32790455629509f42096c2e Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 26 十一月 2020 00:20:53 +0800 Subject: [PATCH] 2020-11-26 --- src/tabviews/zshare/mutilform/index.jsx | 23 +++++++++++++++-------- 1 files changed, 15 insertions(+), 8 deletions(-) diff --git a/src/tabviews/zshare/mutilform/index.jsx b/src/tabviews/zshare/mutilform/index.jsx index 30b79f4..0fcddd3 100644 --- a/src/tabviews/zshare/mutilform/index.jsx +++ b/src/tabviews/zshare/mutilform/index.jsx @@ -123,11 +123,11 @@ 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 || '绌�' }) } @@ -406,26 +406,29 @@ 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] @@ -500,26 +503,29 @@ 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] @@ -916,6 +922,7 @@ })( <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'} -- Gitblit v1.8.0