From 3b1c5118e37500a26021adb8a6c1c11b741d7bbc Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期一, 03 七月 2023 17:37:52 +0800
Subject: [PATCH] Merge branch 'master' into positec

---
 src/tabviews/custom/index.jsx |   57 +++++++++++++++++++++++++++++++++------------------------
 1 files changed, 33 insertions(+), 24 deletions(-)

diff --git a/src/tabviews/custom/index.jsx b/src/tabviews/custom/index.jsx
index c34c160..900ef50 100644
--- a/src/tabviews/custom/index.jsx
+++ b/src/tabviews/custom/index.jsx
@@ -359,6 +359,13 @@
           return false
         }
 
+        if (item.setting.supModule) {
+          let pid = item.setting.supModule.pop()
+          item.setting.supModule = pid || ''
+        } else {
+          item.setting.supModule = ''
+        }
+
         item.subtabs = item.subtabs.filter(tab => {
           if (
             tab.blacklist && tab.blacklist.length > 0 &&
@@ -368,35 +375,37 @@
           } else if (tab.hide === 'true') {
             return false
           }
+
+          if (item.setting.supModule) {
+            if (tab.controlVal === '@pass@') {
+              tab.$pass = true
+            } else if (/,/ig.test(tab.controlVal)) {
+              tab.controlVals = tab.controlVal.split(',')
+            } else {
+              tab.controlVals = [(tab.controlVal || '')]
+            }
+          }
+
           return true
         })
 
         if (item.setting.supModule) {
-          let pid = item.setting.supModule.pop()
-          item.setting.supModule = pid || ''
+          item.setting.controlField = item.setting.controlField.toLowerCase()
 
-          if (item.setting.supModule) {
-            item.setting.controlField = item.setting.controlField.toLowerCase()
-  
-            if (item.setting.supModule === 'preview') {
-              item.setting.supModule = ''
-              let val = ''
-              Object.keys(urlparam).forEach(key => {
-                if (key.toLowerCase() === item.setting.controlField) {
-                  val = urlparam[key]
-                }
-              })
-  
-              item.subtabs = item.subtabs.filter(tab => {
-                if (tab.controlVal === val) {
-                  return false
-                } else if (/,/ig.test(tab.controlVal)) {
-                  return !tab.controlVal.split(',').includes(val)
-                }
-      
-                return true
-              })
-            }
+          if (item.setting.supModule === 'preview') {
+            item.setting.supModule = ''
+            let val = ''
+            Object.keys(urlparam).forEach(key => {
+              if (key.toLowerCase() === item.setting.controlField) {
+                val = urlparam[key]
+              }
+            })
+
+            item.subtabs = item.subtabs.filter(tab => {
+              if (tab.$pass) return true
+    
+              return !tab.controlVals.includes(val)
+            })
           }
         }
 

--
Gitblit v1.8.0