From 4e570c993e66a47ead0f83de76b63b0a2f8c5446 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期一, 05 六月 2023 17:28:16 +0800
Subject: [PATCH] 2023-06-05

---
 src/tabviews/custom/popview/index.jsx |   63 +++++++++++++------------------
 1 files changed, 26 insertions(+), 37 deletions(-)

diff --git a/src/tabviews/custom/popview/index.jsx b/src/tabviews/custom/popview/index.jsx
index aba165f..92c41c2 100644
--- a/src/tabviews/custom/popview/index.jsx
+++ b/src/tabviews/custom/popview/index.jsx
@@ -302,9 +302,7 @@
         item.search = Utils.initSearchVal(item.search)
       }
 
-      let mutil = false
       if (item.wrap && item.wrap.supType === 'multi') { // 鏁版嵁鍗″涓婄骇缁勪欢
-        mutil = true
         item.setting.supModule = item.supNodes[0].componentId
       } else if (item.setting && item.setting.supModule && typeof(item.setting.supModule) !== 'string') {
         let pid = item.setting.supModule.pop()
@@ -322,13 +320,6 @@
 
           cell = this.resetButton(item, cell, Tab)
           cell.$toolbtn = true
-
-          if (!mutil && cell.syncComponentId && cell.syncComponentId === item.setting.supModule) {
-            cell.syncComponentId = ''
-            if (cell.execSuccess === 'line' || cell.execSuccess === 'grid') {
-              cell.execSuccess = 'mainline'
-            }
-          }
 
           return true
         })
@@ -371,13 +362,6 @@
                   if (cell.hidden === 'true' || cell.OpenType === 'popview') return false
             
                   cell = this.resetButton(item, cell, Tab)
-
-                  if (cell.syncComponentId && cell.syncComponentId === item.setting.supModule) {
-                    cell.syncComponentId = ''
-                    if (cell.execSuccess === 'line' || cell.execSuccess === 'grid') {
-                      cell.execSuccess = 'mainline'
-                    }
-                  }
                 } else {
                   cell = this.resetElement(cell)
                 }
@@ -430,13 +414,6 @@
               if (cell.hidden === 'true' || cell.OpenType === 'popview') return false
 
               cell = this.resetButton(item, cell, Tab)
-
-              if (!mutil && cell.syncComponentId && cell.syncComponentId === item.setting.supModule) {
-                cell.syncComponentId = ''
-                if (cell.execSuccess === 'line' || cell.execSuccess === 'grid') {
-                  cell.execSuccess = 'mainline'
-                }
-              }
             } else {
               cell = this.resetElement(cell)
             }
@@ -451,13 +428,6 @@
               if (cell.hidden === 'true' || cell.OpenType === 'popview') return false
 
               cell = this.resetButton(item, cell, Tab)
-
-              if (!mutil && cell.syncComponentId && cell.syncComponentId === item.setting.supModule) {
-                cell.syncComponentId = ''
-                if (cell.execSuccess === 'line' || cell.execSuccess === 'grid') {
-                  cell.execSuccess = 'mainline'
-                }
-              }
             } else {
               cell = this.resetElement(cell)
             }
@@ -478,13 +448,6 @@
             if (cell.hidden === 'true' || cell.OpenType === 'popview') return false
 
             cell = this.resetButton(item, cell, Tab)
-
-            if (cell.syncComponentId && cell.syncComponentId === item.wrap.supModule) {
-              cell.syncComponentId = ''
-              if (cell.execSuccess === 'line' || cell.execSuccess === 'grid') {
-                cell.execSuccess = 'mainline'
-              }
-            }
           } else {
             cell = this.resetElement(cell)
           }
@@ -598,6 +561,32 @@
       }
     }
 
+    if (cell.syncComponentId) {
+      if (cell.syncComponentId === item.setting.supModule) {
+        cell.syncComponentId = ''
+        if (cell.execSuccess === 'line' || cell.execSuccess === 'grid') {
+          cell.execSuccess = 'mainline'
+        }
+      } else if (cell.syncComponentId === 'multiComponent') {
+        let ids = cell.syncComponents.map(m => {
+          return m.syncComId.pop() || ''
+        })
+
+        if (item.setting.supModule && ids.includes(item.setting.supModule)) {
+          if (cell.execSuccess === 'line' || cell.execSuccess === 'grid') {
+            cell.execSuccess = 'mainline'
+          }
+          ids = ids.filter(id => id !== item.setting.supModule)
+        }
+        
+        if (ids.length === 0) {
+          cell.syncComponentId = ''
+        } else {
+          cell.syncComponentIds = ids
+        }
+      }
+    }
+
     return cell
   }
 

--
Gitblit v1.8.0