From c268999fa9a5894289e436165730525c18be93aa Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期一, 07 八月 2023 20:42:09 +0800
Subject: [PATCH] 2023-08-07

---
 src/tabviews/custom/index.jsx |   31 +++++++++++++++----------------
 1 files changed, 15 insertions(+), 16 deletions(-)

diff --git a/src/tabviews/custom/index.jsx b/src/tabviews/custom/index.jsx
index 136d9d5..99dabc0 100644
--- a/src/tabviews/custom/index.jsx
+++ b/src/tabviews/custom/index.jsx
@@ -168,11 +168,6 @@
       let userName = sessionStorage.getItem('User_Name') || ''
       let fullName = sessionStorage.getItem('Full_Name') || ''
 
-      if (sessionStorage.getItem('isEditState') === 'true') {
-        userName = sessionStorage.getItem('CloudUserName') || ''
-        fullName = sessionStorage.getItem('CloudFullName') || ''
-      }
-
       let regs = [
         { reg: /@userName@/ig, value: `'${userName}'` },
         { reg: /@fullName@/ig, value: `'${fullName}'` }
@@ -443,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
         })
 
@@ -498,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