From e9e8b1c7b481415714fff9a0d83099fd5a7d6ff0 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 18 五月 2023 17:25:11 +0800
Subject: [PATCH] 2023-05-18

---
 src/tabviews/basetable/index.jsx |   80 ++++++++++++++++++++--------------------
 1 files changed, 40 insertions(+), 40 deletions(-)

diff --git a/src/tabviews/basetable/index.jsx b/src/tabviews/basetable/index.jsx
index e6a783a..816de31 100644
--- a/src/tabviews/basetable/index.jsx
+++ b/src/tabviews/basetable/index.jsx
@@ -316,6 +316,8 @@
             return false
           } else if (col.Hide === 'true') {
             return false
+          } else if (col.type === 'action') {
+            col.type = 'custom'
           }
           
           if (col.type === 'number') {
@@ -334,8 +336,39 @@
               return false
             }
           } else if (col.type === 'custom') {
-            col.elements = col.elements.map(cell => {
-              if (['text', 'number', 'formula'].includes(cell.eleType)) {
+            col.elements = col.elements.filter(cell => {
+              if (cell.eleType === 'button') {
+                if (cell.hidden === 'true') return false
+          
+                cell.logLabel = item.$menuname + '-' + cell.label
+                cell.Ot = cell.Ot || 'requiredSgl'
+                cell.ContainerId = this.state.ContainerId
+                cell.syncComponentId = cell.syncComponent ? (cell.syncComponent.pop() || '') : ''
+                cell.$menuId = item.uuid
+                cell.$MenuID = this.props.MenuID
+                cell.$view = 'popview'
+
+                if (cell.syncComponentId === item.setting.supModule) {
+                  cell.syncComponentId = ''
+                  if (cell.execSuccess === 'line' || cell.execSuccess === 'grid') {
+                    cell.execSuccess = 'mainline'
+                  }
+                }
+
+                if (cell.OpenType === 'funcbutton' && cell.funcType === 'print' && cell.verify) { // 鎵撳嵃鏈鸿缃�
+                  cell = this.getPrinter(cell, item.uuid)
+                }
+
+                if (cell.controlField) {
+                  if (/,/ig.test(cell.controlVal)) {
+                    cell.controlVals = cell.controlVal.split(',')
+                  } else {
+                    cell.controlVals = [(cell.controlVal || '')]
+                  }
+                }
+
+                return skip || permAction[cell.uuid]
+              } else if (['text', 'number', 'formula'].includes(cell.eleType)) {
                 if (!cell.height) {
                   cell.innerHeight = 'auto'
                 }
@@ -346,8 +379,12 @@
                   }
                 }
               }
-              return cell
+              return true
             })
+
+            if (col.elements.length === 0) {
+              return false
+            }
           }
     
           if (col.linkmenu && col.linkmenu.length > 0) {
@@ -399,43 +436,6 @@
           return skip || permAction[cell.uuid]
         })
       }
-
-      item.cols = item.cols.filter(col => {
-        if (col.type !== 'action') return true
-        col.elements = col.elements.filter(cell => {
-          if (cell.hidden === 'true') return false
-          
-          cell.logLabel = item.$menuname + '-' + cell.label
-          cell.Ot = cell.Ot || 'requiredSgl'
-          cell.ContainerId = this.state.ContainerId
-          cell.syncComponentId = cell.syncComponent ? (cell.syncComponent.pop() || '') : ''
-          cell.$menuId = item.uuid
-          cell.$MenuID = this.props.MenuID
-          cell.$view = 'popview'
-
-          if (cell.syncComponentId === item.setting.supModule) {
-            cell.syncComponentId = ''
-            if (cell.execSuccess === 'line' || cell.execSuccess === 'grid') {
-              cell.execSuccess = 'mainline'
-            }
-          }
-
-          if (cell.OpenType === 'funcbutton' && cell.funcType === 'print' && cell.verify) { // 鎵撳嵃鏈鸿缃�
-            cell = this.getPrinter(cell, item.uuid)
-          }
-
-          if (cell.controlField) {
-            if (/,/ig.test(cell.controlVal)) {
-              cell.controlVals = cell.controlVal.split(',')
-            } else {
-              cell.controlVals = [(cell.controlVal || '')]
-            }
-          }
-
-          return skip || permAction[cell.uuid]
-        })
-        return col.elements.length !== 0
-      })
       
       return true
     })

--
Gitblit v1.8.0