From cc53c43e2088ac208d6d7ebbd0b0932fca24916b Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 13 一月 2023 12:52:19 +0800 Subject: [PATCH] 2023-01-13 --- src/tabviews/zshare/mutilform/index.jsx | 11 ++++++++++- src/templates/zshare/modalform/index.jsx | 6 +++++- src/tabviews/zshare/topSearch/index.jsx | 11 ++++++++++- src/menu/components/table/edit-table/columns/editColumn/index.jsx | 6 +++++- src/tabviews/custom/components/table/edit-table/normalTable/index.jsx | 10 +++++++++- src/templates/sharecomponent/searchcomponent/searchform/index.jsx | 6 +++++- 6 files changed, 44 insertions(+), 6 deletions(-) diff --git a/src/menu/components/table/edit-table/columns/editColumn/index.jsx b/src/menu/components/table/edit-table/columns/editColumn/index.jsx index 1fac697..88c227d 100644 --- a/src/menu/components/table/edit-table/columns/editColumn/index.jsx +++ b/src/menu/components/table/edit-table/columns/editColumn/index.jsx @@ -214,7 +214,11 @@ 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}) } diff --git a/src/tabviews/custom/components/table/edit-table/normalTable/index.jsx b/src/tabviews/custom/components/table/edit-table/normalTable/index.jsx index 993a997..bcf4ee3 100644 --- a/src/tabviews/custom/components/table/edit-table/normalTable/index.jsx +++ b/src/tabviews/custom/components/table/edit-table/normalTable/index.jsx @@ -1203,13 +1203,21 @@ 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) diff --git a/src/tabviews/zshare/mutilform/index.jsx b/src/tabviews/zshare/mutilform/index.jsx index 48a20c1..e69e00d 100644 --- a/src/tabviews/zshare/mutilform/index.jsx +++ b/src/tabviews/zshare/mutilform/index.jsx @@ -715,6 +715,7 @@ 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: ''} @@ -725,7 +726,15 @@ 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 { diff --git a/src/tabviews/zshare/topSearch/index.jsx b/src/tabviews/zshare/topSearch/index.jsx index 9c98c03..85fbb90 100644 --- a/src/tabviews/zshare/topSearch/index.jsx +++ b/src/tabviews/zshare/topSearch/index.jsx @@ -404,6 +404,7 @@ 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(), @@ -418,7 +419,15 @@ _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 { diff --git a/src/templates/sharecomponent/searchcomponent/searchform/index.jsx b/src/templates/sharecomponent/searchcomponent/searchform/index.jsx index 3ad9a27..6588635 100644 --- a/src/templates/sharecomponent/searchcomponent/searchform/index.jsx +++ b/src/templates/sharecomponent/searchcomponent/searchform/index.jsx @@ -419,7 +419,11 @@ 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}) } diff --git a/src/templates/zshare/modalform/index.jsx b/src/templates/zshare/modalform/index.jsx index db416fb..4a6f1e1 100644 --- a/src/templates/zshare/modalform/index.jsx +++ b/src/templates/zshare/modalform/index.jsx @@ -560,7 +560,11 @@ 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}) } -- Gitblit v1.8.0