From 96989af7e330a08d376002b0759705a477039f61 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 19 十月 2023 19:46:41 +0800
Subject: [PATCH] Merge branch 'positec' into dms

---
 src/tabviews/zshare/actionList/exceloutbutton/index.jsx |  216 +++++++++++++++++++++--------------------------------
 1 files changed, 87 insertions(+), 129 deletions(-)

diff --git a/src/tabviews/zshare/actionList/exceloutbutton/index.jsx b/src/tabviews/zshare/actionList/exceloutbutton/index.jsx
index 0cab6e9..7e032ca 100644
--- a/src/tabviews/zshare/actionList/exceloutbutton/index.jsx
+++ b/src/tabviews/zshare/actionList/exceloutbutton/index.jsx
@@ -198,39 +198,25 @@
       } else if (btn.intertype === 'outer' && !btn.innerFunc) { // 浣跨敤澶栭儴鍑芥暟
         let param = this.getExcelCustomParam(viewParam.orderBy, viewParam.search)
 
-        if (window.GLOB.mkHS) {
-          if (btn.sysInterface === 'true' && window.GLOB.cloudServiceApi) {
-            param.rduri = window.GLOB.cloudServiceApi
-            param.userid = sessionStorage.getItem('CloudUserID') || ''
-            param.LoginUID = sessionStorage.getItem('CloudLoginUID') || ''
-          } else if (btn.sysInterface !== 'true') {
-            if (window.GLOB.systemType === 'production' && btn.proInterface) {
-              param.rduri = btn.proInterface
-            } else {
-              param.rduri = btn.interface
-            }
+        if (btn.sysInterface === 'true') {
+          if (window.GLOB.mainSystemApi) {
+            param.rduri = window.GLOB.mainSystemApi
+          }
+        } else if (btn.sysInterface === 'external') {
+          if (window.GLOB.systemType === 'production') {
+            param.$token = btn.exProInterface || ''
+          } else {
+            param.$token = btn.exInterface || ''
           }
         } else {
-          if (btn.sysInterface === 'true') {
-            if (window.GLOB.mainSystemApi) {
-              param.rduri = window.GLOB.mainSystemApi
-            }
-          } else if (btn.sysInterface === 'external') {
-            if (window.GLOB.systemType === 'production') {
-              param.$token = btn.exProInterface || ''
-            } else {
-              param.$token = btn.exInterface || ''
-            }
+          if (window.GLOB.systemType === 'production' && btn.proInterface) {
+            param.rduri = btn.proInterface
           } else {
-            if (window.GLOB.systemType === 'production' && btn.proInterface) {
-              param.rduri = btn.proInterface
-            } else {
-              param.rduri = btn.interface
-            }
-            let host = window.GLOB.baseurl.replace(/http(s):\/\//, '')
-            if (param.rduri.indexOf(host) === -1 && /\/dostars/.test(param.rduri)) {
-              param.$login = true
-            }
+            param.rduri = btn.interface
+          }
+          let host = window.GLOB.baseurl.replace(/http(s):\/\//, '')
+          if (param.rduri.indexOf(host) === -1 && /\/dostars/.test(param.rduri)) {
+            param.$login = true
           }
         }
   
@@ -259,39 +245,25 @@
             delete res.message
             delete res.status
 
-            if (window.GLOB.mkHS) {
-              if (btn.sysInterface === 'true' && window.GLOB.cloudServiceApi) {
-                res.rduri = window.GLOB.cloudServiceApi
-                res.userid = sessionStorage.getItem('CloudUserID') || ''
-                res.LoginUID = sessionStorage.getItem('CloudLoginUID') || ''
-              } else if (btn.sysInterface !== 'true') {
-                if (window.GLOB.systemType === 'production' && btn.proInterface) {
-                  res.rduri = btn.proInterface
-                } else {
-                  res.rduri = btn.interface
-                }
+            if (btn.sysInterface === 'true') {
+              if (window.GLOB.mainSystemApi) {
+                res.rduri = window.GLOB.mainSystemApi
+              }
+            } else if (btn.sysInterface === 'external') {
+              if (window.GLOB.systemType === 'production') {
+                res.$token = btn.exProInterface || ''
+              } else {
+                res.$token = btn.exInterface || ''
               }
             } else {
-              if (btn.sysInterface === 'true') {
-                if (window.GLOB.mainSystemApi) {
-                  res.rduri = window.GLOB.mainSystemApi
-                }
-              } else if (btn.sysInterface === 'external') {
-                if (window.GLOB.systemType === 'production') {
-                  res.$token = btn.exProInterface || ''
-                } else {
-                  res.$token = btn.exInterface || ''
-                }
+              if (window.GLOB.systemType === 'production' && btn.proInterface) {
+                res.rduri = btn.proInterface
               } else {
-                if (window.GLOB.systemType === 'production' && btn.proInterface) {
-                  res.rduri = btn.proInterface
-                } else {
-                  res.rduri = btn.interface
-                }
-                let host = window.GLOB.baseurl.replace(/http(s):\/\//, '')
-                if (res.rduri.indexOf(host) === -1 && /\/dostars/.test(res.rduri)) {
-                  res.$login = true
-                }
+                res.rduri = btn.interface
+              }
+              let host = window.GLOB.baseurl.replace(/http(s):\/\//, '')
+              if (res.rduri.indexOf(host) === -1 && /\/dostars/.test(res.rduri)) {
+                res.$login = true
               }
             }
   
@@ -345,39 +317,25 @@
         delete res.message
         delete res.status
 
-        if (window.GLOB.mkHS) {
-          if (btn.sysInterface === 'true' && window.GLOB.cloudServiceApi) {
-            res.rduri = window.GLOB.cloudServiceApi
-            res.userid = sessionStorage.getItem('CloudUserID') || ''
-            res.LoginUID = sessionStorage.getItem('CloudLoginUID') || ''
-          } else if (btn.sysInterface !== 'true') {
-            if (window.GLOB.systemType === 'production' && btn.proInterface) {
-              res.rduri = btn.proInterface
-            } else {
-              res.rduri = btn.interface
-            }
+        if (btn.sysInterface === 'true') {
+          if (window.GLOB.mainSystemApi) {
+            res.rduri = window.GLOB.mainSystemApi
+          }
+        } else if (btn.sysInterface === 'external') {
+          if (window.GLOB.systemType === 'production') {
+            res.$token = btn.exProInterface || ''
+          } else {
+            res.$token = btn.exInterface || ''
           }
         } else {
-          if (btn.sysInterface === 'true') {
-            if (window.GLOB.mainSystemApi) {
-              res.rduri = window.GLOB.mainSystemApi
-            }
-          } else if (btn.sysInterface === 'external') {
-            if (window.GLOB.systemType === 'production') {
-              res.$token = btn.exProInterface || ''
-            } else {
-              res.$token = btn.exInterface || ''
-            }
+          if (window.GLOB.systemType === 'production' && btn.proInterface) {
+            res.rduri = btn.proInterface
           } else {
-            if (window.GLOB.systemType === 'production' && btn.proInterface) {
-              res.rduri = btn.proInterface
-            } else {
-              res.rduri = btn.interface
-            }
-            let host = window.GLOB.baseurl.replace(/http(s):\/\//, '')
-            if (res.rduri.indexOf(host) === -1 && /\/dostars/.test(res.rduri)) {
-              res.$login = true
-            }
+            res.rduri = btn.interface
+          }
+          let host = window.GLOB.baseurl.replace(/http(s):\/\//, '')
+          if (res.rduri.indexOf(host) === -1 && /\/dostars/.test(res.rduri)) {
+            res.$login = true
           }
         }
 
@@ -433,40 +391,26 @@
     } else if (btn.intertype === 'outer' && !btn.innerFunc) { // 浣跨敤澶栭儴鍑芥暟
       param = this.getExcelCustomParam(viewParam.orderBy, viewParam.search, true, pageIndex, pageSize)
 
-      if (window.GLOB.mkHS) {
-        if (btn.sysInterface === 'true' && window.GLOB.cloudServiceApi) {
-          param.rduri = window.GLOB.cloudServiceApi
-          param.userid = sessionStorage.getItem('CloudUserID') || ''
-          param.LoginUID = sessionStorage.getItem('CloudLoginUID') || ''
-        } else if (btn.sysInterface !== 'true') {
-          if (window.GLOB.systemType === 'production' && btn.proInterface) {
-            param.rduri = btn.proInterface
-          } else {
-            param.rduri = btn.interface
-          }
+      if (btn.sysInterface === 'true') {
+        if (window.GLOB.mainSystemApi) {
+          param.rduri = window.GLOB.mainSystemApi
+        }
+      } else if (btn.sysInterface === 'external') {
+        if (window.GLOB.systemType === 'production') {
+          param.$token = btn.exProInterface || ''
+        } else {
+          param.$token = btn.exInterface || ''
         }
       } else {
-        if (btn.sysInterface === 'true') {
-          if (window.GLOB.mainSystemApi) {
-            param.rduri = window.GLOB.mainSystemApi
-          }
-        } else if (btn.sysInterface === 'external') {
-          if (window.GLOB.systemType === 'production') {
-            param.$token = btn.exProInterface || ''
-          } else {
-            param.$token = btn.exInterface || ''
-          }
+        if (window.GLOB.systemType === 'production' && btn.proInterface) {
+          param.rduri = btn.proInterface
         } else {
-          if (window.GLOB.systemType === 'production' && btn.proInterface) {
-            param.rduri = btn.proInterface
-          } else {
-            param.rduri = btn.interface
-          }
+          param.rduri = btn.interface
+        }
 
-          let host = window.GLOB.baseurl.replace(/http(s):\/\//, '')
-          if (param.rduri.indexOf(host) === -1 && /\/dostars/.test(param.rduri)) {
-            param.$login = true
-          }
+        let host = window.GLOB.baseurl.replace(/http(s):\/\//, '')
+        if (param.rduri.indexOf(host) === -1 && /\/dostars/.test(param.rduri)) {
+          param.$login = true
         }
       }
       
@@ -499,13 +443,11 @@
   /**
    * @description Excel 鐢熸垚
    */
-  exportExcel = (data, ErrCode, message) => {
+  exportExcel = (data, ErrCode, msg) => {
     const { btn } = this.props
     
     let imgCol = false
-    let columns = btn.verify.columns.filter(col => {
-      if (col.output === 'false') return false
-
+    let columns = btn.verify.columns.map(col => {
       if (col.type === 'image') {
         imgCol = true
       }
@@ -520,6 +462,7 @@
     if (data && data[0]) {
       let errors = []
       columns.forEach(col => {
+        if (col.output === 'false') return
         if (col.Column && data[0][col.Column] === undefined) {
           errors.push(col.Text)
         }
@@ -565,7 +508,13 @@
   
           columns.forEach((col, i) => {
             let val = item[col.Column]
-            if (col.type === 'number' && typeof(val) === 'number') {
+            if (col.output === 'false') {
+              if (col.type === 'number') {
+                val = 0
+              } else {
+                val = ''
+              }
+            } else if (col.type === 'number' && typeof(val) === 'number') {
               if (col.abs === 'true') {
                 val = Math.abs(val)
               }
@@ -583,7 +532,7 @@
 
         this.table2excel(column, table)
 
-        this.execSuccess({ErrCode: ErrCode || 'S', message: message || '瀵煎嚭鎴愬姛锛�'})
+        this.execSuccess({ErrCode: ErrCode || 'S', message: msg || '瀵煎嚭鎴愬姛锛�'})
       } else {
         let letters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
         let cols = []
@@ -650,7 +599,13 @@
           columns.forEach((col, i) => {
             let val = item[col.Column]
 
-            if (col.type === 'number' && typeof(val) === 'number') {
+            if (col.output === 'false') {
+              if (col.type === 'number') {
+                val = 0
+              } else {
+                val = ''
+              }
+            } else if (col.type === 'number' && typeof(val) === 'number') {
               if (col.abs === 'true') {
                 val = Math.abs(val)
               }
@@ -720,7 +675,7 @@
   
         XLSX.writeFile(wb, `${btn.$menuName || ''}${moment().format('YYYYMMDDHHmmss')}.xlsx`)
   
-        this.execSuccess({ErrCode: ErrCode || 'S', message: message || '瀵煎嚭鎴愬姛锛�'})
+        this.execSuccess({ErrCode: ErrCode || 'S', message: msg || '瀵煎嚭鎴愬姛锛�'})
       }
     } catch (e) {
       this.execError({ErrCode: 'N', message: 'Excel鐢熸垚澶辫触锛�'})
@@ -822,7 +777,7 @@
       _setting.arr_field = _setting.arr_field.join(',')
       _setting.execute = btn.verify.defaultSql !== 'false'
       _setting.dataresource = btn.verify.dataresource || ''
-      _setting.primaryKey = _setting.primaryKey || setting.primaryKey || 'ID'
+      _setting.primaryKey = btn.verify.primaryKey || setting.primaryKey || 'ID'
 
       if (!_setting.execute) {
         _setting.dataresource = ''
@@ -869,8 +824,11 @@
       _orderBy = btn.verify.order || ''
     } else {
       _setting = {...setting}
+      _setting.$name = btn.logLabel
       _setting.laypage = pagination
       _setting.arr_field = _setting.all_field || _setting.arr_field
+
+      delete _setting.sub_field
     }
 
     let primaryId = ''

--
Gitblit v1.8.0