From 42ddba4c235e1db44e17b525698f89450a4289a4 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期一, 07 八月 2023 16:44:11 +0800 Subject: [PATCH] 2023-08-07 --- src/tabviews/custom/index.jsx | 26 +++++++++++++++----------- 1 files changed, 15 insertions(+), 11 deletions(-) diff --git a/src/tabviews/custom/index.jsx b/src/tabviews/custom/index.jsx index 1bc8338..99dabc0 100644 --- a/src/tabviews/custom/index.jsx +++ b/src/tabviews/custom/index.jsx @@ -438,16 +438,22 @@ let _searchId = searchId - tab.components.forEach(cell => { - if (cell.type !== 'search') return - _searchId = cell.uuid - window.GLOB.SearchBox.set(cell.uuid, cell.$searches) - if (cell.$s_req) { - window.GLOB.SearchBox.set(cell.uuid + 'required', true) - } - }) + if (tab.components.findIndex(cell => cell.type === 'search') > -1) { + _searchId = tab.uuid + } tab.components = this.filterComponent(tab.components, roleId, permAction, balMap, skip, urlparam, pageId, interfaces, popview, cache, time, MenuName, _searchId, tab.uuid) + + if (_searchId === tab.uuid) { + tab.components.forEach(cell => { + if (cell.type !== 'search') return + window.GLOB.SearchBox.set(_searchId, cell.$searches) + if (cell.$s_req) { + window.GLOB.SearchBox.set(_searchId + 'required', true) + } + }) + } + return tab }) @@ -493,9 +499,7 @@ } // 鎼滅储鏉′欢鍒濆鍖� - if (item.type === 'search' && item.search.length === 0) { - return false - } else if (item.search) { + if (item.search) { Utils.initSearchVal(item) item.$searches = Utils.initMainSearch(item.search) -- Gitblit v1.8.0