From 6b699dc5a69457d76577d17903d54011a6561d97 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期三, 23 八月 2023 11:48:47 +0800
Subject: [PATCH] Merge branch 'master' into positec

---
 src/tabviews/basetable/index.jsx |  142 ++++++++++++++++++++---------------------------
 1 files changed, 60 insertions(+), 82 deletions(-)

diff --git a/src/tabviews/basetable/index.jsx b/src/tabviews/basetable/index.jsx
index a64ab5f..3eff170 100644
--- a/src/tabviews/basetable/index.jsx
+++ b/src/tabviews/basetable/index.jsx
@@ -341,50 +341,10 @@
               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) {
-                  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
-                    }
-                  }
-                }
+                cell = this.resetButton(item, cell)
 
                 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]
@@ -426,51 +386,12 @@
         item.action = item.action.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'
-          cell.$toolbtn = true
+          cell = this.resetButton(item, cell)
 
-          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
-              }
-            }
-          }
+          cell.$toolbtn = true
 
           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]
@@ -479,6 +400,62 @@
       
       return true
     })
+  }
+
+  resetButton = (item, cell) => {
+    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.controlField) {
+      if (/,/ig.test(cell.controlVal)) {
+        cell.controlVals = cell.controlVal.split(',')
+      } else {
+        cell.controlVals = [(cell.controlVal || '')]
+      }
+    }
+
+    if (cell.OpenType === 'excelOut') { // 瀵煎嚭
+      cell.$menuName = item.name
+
+      if (!cell.verify || !cell.verify.columns || cell.verify.columns.length === 0) {
+        cell.errorType = 'error1'
+      } else if (cell.intertype === 'system' && cell.verify.dataType !== 'custom' && item.setting.interType !== 'system') {
+        cell.errorType = 'error2'
+      }
+    }
+
+    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
   }
 
   getPrinter = (item, parentId) => {
@@ -511,6 +488,7 @@
         return component
       }
 
+      component.setting.arr_field = component.columns.map(col => col.field).join(',')
       component.setting.useMSearch = component.setting.useMSearch === 'true'
       if (component.setting.useMSearch) {
         if (!window.GLOB.SearchBox.has(component.$searchId)) {

--
Gitblit v1.8.0