From a418a2ac66efeb45d7723517b282195d00cd7b37 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 13 七月 2023 22:45:20 +0800
Subject: [PATCH] Merge branch 'master' into positec

---
 src/tabviews/zshare/mutilform/index.jsx |   40 ++++++++++++++++++++++++++++++++++++----
 1 files changed, 36 insertions(+), 4 deletions(-)

diff --git a/src/tabviews/zshare/mutilform/index.jsx b/src/tabviews/zshare/mutilform/index.jsx
index 7623755..e04d23a 100644
--- a/src/tabviews/zshare/mutilform/index.jsx
+++ b/src/tabviews/zshare/mutilform/index.jsx
@@ -89,6 +89,7 @@
         } else {
           supvals.push('')
         }
+        supvals = Array.from(new Set(supvals))
         controlFields[item.supField] = controlFields[item.supField] || []
         controlFields[item.supField].push({field: item.field, values: supvals})
       }
@@ -413,9 +414,24 @@
 
         let cell = fieldMap.get(item.field)
 
-        // if (cell.hidden) return
-        
-        if (supItem.hidden || !item.values.includes(supItem.initval)) {
+        let _hidden = false
+
+        if (supItem.hidden) {
+          _hidden = true
+        } else {
+          let box = [...item.values]
+          if (supItem.type === 'multiselect' || (supItem.type === 'checkcard' && supItem.multiple === 'true')) {
+            box.push(...supItem.initval.split(','))
+          } else {
+            box.push(supItem.initval)
+          }
+  
+          if (box.length === Array.from(new Set(box)).length) {
+            _hidden = true
+          }
+        }
+
+        if (_hidden) {
           cell.hidden = true
           if (cell.empty === 'hidden') {
             cell.$hidden = true
@@ -954,7 +970,23 @@
 
       current.controlFields.forEach(cell => {
         let m = map.get(cell.field)
-        m.hidden = current.hidden || !cell.values.includes(val)
+
+        m.hidden = false
+
+        if (current.hidden) {
+          m.hidden = true
+        } else {
+          let box = [...cell.values]
+          if (current.type === 'multiselect' || (current.type === 'checkcard' && current.multiple === 'true')) {
+            box.push(...val.split(','))
+          } else {
+            box.push(val)
+          }
+  
+          if (box.length === Array.from(new Set(box)).length) {
+            m.hidden = true
+          }
+        }
 
         if (m.empty === 'hidden' && m.oriOptions.length === 0) {
           m.hidden = true

--
Gitblit v1.8.0