From 53b68578c161561700bd77759629daa1608e05ca Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期三, 23 八月 2023 23:43:05 +0800 Subject: [PATCH] 2023-08-23 --- src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx | 69 +++++++++++++++------------------- 1 files changed, 31 insertions(+), 38 deletions(-) diff --git a/src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx b/src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx index a99543e..a262c40 100644 --- a/src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx +++ b/src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx @@ -300,54 +300,47 @@ searches = search } else { - let search = [] - + searches = fromJS(config.search || []).toJS() + if (config.setting && config.setting.useMSearch === 'true' && window.GLOB.customMenu) { let menu = fromJS(window.GLOB.customMenu).toJS() - let _search = null - let filterComponent = (box) => { + let filterComponent = (box, mainSearch) => { box.components.forEach(item => { - if (_search) return - - if (item.type === 'search') { - box.slist = [...box.slist, item.search] - } else if (item.uuid === config.uuid) { - _search = box.slist.pop() + if (item.type !== 'search') return + mainSearch = item.search + }) + let has = false + box.components.forEach(item => { + if (item.uuid === config.uuid) { + has = true } else if (item.type === 'group') { item.components.forEach(m => { if (m.uuid !== config.uuid) return - _search = box.slist.pop() - }) - } else if (item.type === 'tabs') { - item.subtabs.forEach(tab => { - tab.slist = [...box.slist] - filterComponent(tab) + has = true }) } }) - } - menu.slist = [] - filterComponent(menu) - - if (_search) { - search = _search - } else { - menu.components.forEach(item => { - if (item.type !== 'search') return - search = item.search - }) - } - } - - searches = fromJS(config.search || []).toJS() - - if (search.length > 0) { - let keys = searches.map(item => (item.field ? item.field.toLowerCase() : '')) - search.forEach(item => { - if (item.field && !keys.includes(item.field.toLowerCase())) { - searches.push(item) + + if (has) { + if (mainSearch) { + let keys = searches.map(item => (item.field ? item.field.toLowerCase() : '')) + mainSearch.forEach(item => { + if (item.field && !keys.includes(item.field.toLowerCase())) { + searches.push(item) + } + }) + } + } else { + box.components.forEach(item => { + if (item.type !== 'tabs') return + + item.subtabs.forEach(tab => { + filterComponent(tab, mainSearch) + }) + }) } - }) + } + filterComponent(menu, null) } } -- Gitblit v1.8.0