From 0519dcda8b6fb2914987f8d4d58e1d14bcf98dc3 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期五, 30 六月 2023 14:33:06 +0800
Subject: [PATCH] 2023-06-30

---
 src/tabviews/zshare/actionList/exceloutbutton/index.jsx |   57 +++++++++++++++++++++++++++++++++++++++++++++------------
 1 files changed, 45 insertions(+), 12 deletions(-)

diff --git a/src/tabviews/zshare/actionList/exceloutbutton/index.jsx b/src/tabviews/zshare/actionList/exceloutbutton/index.jsx
index b96ad92..a31ae6b 100644
--- a/src/tabviews/zshare/actionList/exceloutbutton/index.jsx
+++ b/src/tabviews/zshare/actionList/exceloutbutton/index.jsx
@@ -220,7 +220,8 @@
           } else {
             this.execError(result)
           }
-        }, () => {
+        }, (error) => {
+          if (error && error.ErrCode === 'LoginError') return
           this.execError({})
         })
       } else if (btn.intertype === 'inner') { // 浣跨敤鍐呴儴鍑芥暟
@@ -233,7 +234,8 @@
           } else {
             this.execError(result)
           }
-        }, () => {
+        }, (error) => {
+          if (error && error.ErrCode === 'LoginError') return
           this.execError({})
         })
       } else if (btn.intertype === 'outer' && !btn.innerFunc) { // 浣跨敤澶栭儴鍑芥暟
@@ -285,7 +287,8 @@
           } else {
             this.execError(result)
           }
-        }, () => {
+        }, (error) => {
+          if (error && error.ErrCode === 'LoginError') return
           this.execError({})
         })
       } else if (btn.intertype === 'outer' && btn.innerFunc) {
@@ -349,7 +352,8 @@
           } else {
             this.execError(res)
           }
-        }, () => {
+        }, (error) => {
+          if (error && error.ErrCode === 'LoginError') return
           this.execError({})
         })
       } else {
@@ -437,13 +441,15 @@
           } else {
             this.execError(result)
           }
-        }, () => {
+        }, (error) => {
+          if (error && error.ErrCode === 'LoginError') return
           this.execError({})
         })
       } else {
         this.execError(res)
       }
-    }, () => {
+    }, (error) => {
+      if (error && error.ErrCode === 'LoginError') return
       this.execError({})
     })
   }
@@ -525,7 +531,8 @@
       } else {
         this.execError(result)
       }
-    }, () => {
+    }, (error) => {
+      if (error && error.ErrCode === 'LoginError') return
       this.execError({})
     })
   }
@@ -713,6 +720,21 @@
           })
         }
 
+        if (btn.verify.wrapText === 'true' && data) {
+          let lines = data.length + 1
+          let start = 2
+          if (btn.verify.merge === 'true') {
+            lines = data.length + 2
+          }
+          for (let n = 0; n < cols.length; n++) {
+            for (let m = start; m <= lines; m++) {
+              if (ws[cols[n] + m] && !ws[cols[n] + m].s) {
+                ws[cols[n] + m].s = {alignment: { wrapText: true }}
+              }
+            }
+          }
+        }
+
         // ws["A1"].s = {fill: { bgColor: { rgb: "FFFFAA"  }}, font: { color: { rgb: "1890FF" } }}
 
         const wb = XLSX.utils.book_new()
@@ -827,7 +849,8 @@
       } else {
         this.execError(res)
       }
-    }, () => {
+    }, (error) => {
+      if (error && error.ErrCode === 'LoginError') return
       this.updateStatus('over')
     })
   }
@@ -884,7 +907,7 @@
       defaultSql = btn.verify.defaultSql || 'true'
       _dataresource = btn.verify.dataresource || ''
       queryType = btn.verify.queryType
-      primaryKey = btn.verify.primaryKey || 'ID'
+      // primaryKey = btn.verify.primaryKey || 'ID'
 
       if (/\s/.test(_dataresource)) {
         _dataresource = '(' + _dataresource + ') tb'
@@ -993,9 +1016,9 @@
     if (btn.Ot === 'requiredOnce' && selectedData && selectedData.length > 0) {
       primaryId = selectedData.map(d => d.$$uuid || '').filter(Boolean).join(',')
       if (_search && primaryId) {
-        _search += ` and ${primaryKey} in (select ID from  dbo.SplitComma('${primaryId}'))`
+        _search += ` and ${primaryKey} in (select ID from dbo.SplitComma('${primaryId}'))`
       } else if (primaryId) {
-        _search = `where ${primaryKey} in (select ID from  dbo.SplitComma('${primaryId}'))`
+        _search = `where ${primaryKey} in (select ID from dbo.SplitComma('${primaryId}'))`
       }
     }
 
@@ -1103,7 +1126,17 @@
       MKEmitter.emit('refreshByButtonResult', btn.$menuId, btn.execSuccess, btn, '', [])
     }
     
-    btn.syncComponentId && MKEmitter.emit('reloadData', btn.syncComponentId)
+    if (btn.syncComponentId) {
+      if (btn.syncComponentId === 'multiComponent') {
+        btn.syncComponentIds.forEach((id, i) => {
+          setTimeout(() => {
+            MKEmitter.emit('reloadData', id)
+          }, 20 * i)
+        })
+      } else {
+        MKEmitter.emit('reloadData', btn.syncComponentId)
+      }
+    }
     
     if (btn.switchTab && btn.switchTab.length > 0) {
       let id = btn.switchTab[btn.switchTab.length - 1]

--
Gitblit v1.8.0