From a29d9d644a2a30e9ef4afcc6d728c20c218dc359 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 15 六月 2023 14:25:28 +0800 Subject: [PATCH] 2023-06-15 --- src/tabviews/zshare/topSearch/index.jsx | 64 +++++++++++--------------------- 1 files changed, 22 insertions(+), 42 deletions(-) diff --git a/src/tabviews/zshare/topSearch/index.jsx b/src/tabviews/zshare/topSearch/index.jsx index 2ee1aaa..bb8561d 100644 --- a/src/tabviews/zshare/topSearch/index.jsx +++ b/src/tabviews/zshare/topSearch/index.jsx @@ -25,9 +25,7 @@ class MainSearch extends Component { static propTpyes = { BID: PropTypes.any, // 鐖剁骇Id锛岀敤浜庢煡璇笅鎷夐�夋嫨椤� - searchlist: PropTypes.array, // 鎼滅储鏉′欢鍒楄〃 config: PropTypes.object, // 缁勪欢閰嶇疆淇℃伅(鑷畾涔夐〉闈�) - setting: PropTypes.object, // 缁勪欢閰嶇疆淇℃伅(鑷畾涔夐〉闈�) refreshdata: PropTypes.func // 鍒锋柊鏁版嵁 } @@ -43,7 +41,7 @@ sign = '' UNSAFE_componentWillMount () { - const { config, searchlist, setting } = this.props + const { config } = this.props let _searchlist = [] let fieldMap = new Map() @@ -56,43 +54,29 @@ let hasReqFields = false let forbid = false // header涓笉璁剧疆楂樼骇鎼滅储 - let _setting = {showAdv: false, show: false} + let _setting = {showAdv: false, show: false, style: null} - if (setting) { - _setting.show = setting.show !== 'false' - _setting.float = setting.float || 'left' - _setting.advanceType = setting.advanceType || 'modal' - _setting.advWidth = setting.advanceWidth || 1000 - _setting.placement = setting.drawerPlacement || 'right' - _setting.ratio = setting.searchRatio || 6 - _setting.labelwidth = setting.searchLwidth !== undefined ? setting.searchLwidth : 33.3 + if (config.wrap) { + _setting.show = config.wrap.show !== 'false' + _setting.advanceType = config.wrap.advanceType || 'modal' + _setting.advWidth = config.wrap.advanceWidth || 1000 + _setting.placement = config.wrap.drawerPlacement || 'right' + _setting.ratio = config.wrap.searchRatio || 6 + _setting.labelwidth = config.wrap.searchLwidth !== undefined ? config.wrap.searchLwidth : 33.3 _setting.labelCol = {style: {width: _setting.labelwidth + '%'}} _setting.wrapperCol = {style: {width: (100 - _setting.labelwidth) + '%'}} - _setting.style = null - } else if (config) { - if (config.wrap) { - _setting.show = config.wrap.show !== 'false' - _setting.advanceType = config.wrap.advanceType || 'modal' - _setting.advWidth = config.wrap.advanceWidth || 1000 - _setting.placement = config.wrap.drawerPlacement || 'right' - _setting.ratio = config.wrap.searchRatio || 6 - _setting.labelwidth = config.wrap.searchLwidth !== undefined ? config.wrap.searchLwidth : 33.3 - _setting.labelCol = {style: {width: _setting.labelwidth + '%'}} - _setting.wrapperCol = {style: {width: (100 - _setting.labelwidth) + '%'}} - _setting.borderRadius = config.wrap.borderRadius - } - _setting.style = null - - if (config.type === 'search') { - _setting.float = config.wrap.float || 'left' - _setting.style = config.style - } else if (config.type === 'table') { - _setting.float = 'left' - } else { - _setting.float = 'right' - _setting.show = false - forbid = true - } + _setting.borderRadius = config.wrap.borderRadius + } + + if (config.type === 'search') { + _setting.float = config.wrap.float || 'left' + _setting.style = config.style + } else if (config.type === 'table') { + _setting.float = 'left' + } else { + _setting.float = 'right' + _setting.show = false + forbid = true } if (_setting.advanceType === 'drawer' && _setting.advWidth) { @@ -110,11 +94,7 @@ } } - if (searchlist) { - _searchlist = fromJS(searchlist).toJS() - } else if (config) { - _searchlist = fromJS(config.search).toJS() - } + _searchlist = fromJS(config.search).toJS() _searchlist.forEach(item => { if (item.linkField) { -- Gitblit v1.8.0