From 52faefc67ffef29e3d208d2233c2547fc0ee47d3 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期六, 04 三月 2023 21:11:41 +0800
Subject: [PATCH] 2023-03-04

---
 src/templates/sharecomponent/actioncomponent/verifyexcelout/utils.jsx |   23 ++++++++++-------------
 1 files changed, 10 insertions(+), 13 deletions(-)

diff --git a/src/templates/sharecomponent/actioncomponent/verifyexcelout/utils.jsx b/src/templates/sharecomponent/actioncomponent/verifyexcelout/utils.jsx
index f1d391d..6e71f40 100644
--- a/src/templates/sharecomponent/actioncomponent/verifyexcelout/utils.jsx
+++ b/src/templates/sharecomponent/actioncomponent/verifyexcelout/utils.jsx
@@ -23,6 +23,10 @@
     })
     arr_field = arr_field.join(',')
 
+    if (!arr_field) {
+      arr_field = '*'
+    }
+
     let _customScript = ''
     scripts && scripts.forEach(script => {
       if (script.status === 'false') return
@@ -40,17 +44,9 @@
     if (verify.defaultSql === 'false') {
       _dataresource = ''
     }
-
-    if (window.GLOB.funcs && window.GLOB.funcs.length > 0) {
-      window.GLOB.funcs.forEach(item => {
-        let reg = new RegExp('\\$ex@' + item.func_code + '@ex\\$', 'ig')
-        _dataresource = _dataresource.replace(reg, `/*$ex@${item.func_code}-begin*/\n${item.key_sql}\n/*@ex$-end*/`)
-        _customScript = _customScript.replace(reg, `/*$ex@${item.func_code}-begin*/\n${item.key_sql}\n/*@ex$-end*/`)
-      })
-    }
     
-    _dataresource = _dataresource.replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id)@/ig, `'${timestamp}'`)
-    _customScript = _customScript.replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id)@/ig, `'${timestamp}'`)
+    _dataresource = _dataresource.replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id|typename)@/ig, `'${timestamp}'`)
+    _customScript = _customScript.replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id|typename)@/ig, `'${timestamp}'`)
     _dataresource = _dataresource.replace(/@\$|\$@/ig, '')
     _customScript = _customScript.replace(/@\$|\$@/ig, '')
 
@@ -105,15 +101,15 @@
     }
 
     // 鏁版嵁婧愬鐞�, 瀛樺湪鏄剧ず鍒楁椂 
-    if (arr_field && _dataresource) {
+    if (_dataresource) {
       if (/\s/.test(_dataresource)) {
         _dataresource = '(' + _dataresource + ') tb'
       }
 
       if (verify.order) {
-        _dataresource = `select ${arr_field} from (select ${arr_field} ,ROW_NUMBER() over(order by ${verify.order}) as rows from ${_dataresource} ${_search}) tmptable order by tmptable.rows`
+        _dataresource = `/*system_query*/select ${arr_field} from (select ${arr_field} ,ROW_NUMBER() over(order by ${verify.order}) as rows from ${_dataresource} ${_search}) tmptable order by tmptable.rows`
       } else {
-        _dataresource = `select ${arr_field} from ${_dataresource} ${_search}`
+        _dataresource = `/*system_query*/select ${arr_field} from ${_dataresource} ${_search}`
       }
     }
 
@@ -132,6 +128,7 @@
     }
     sql = sql.replace(/\n\s{8}/ig, '\n')
     console.info(sql)
+    sql = sql.replace(/\n/g, ' ')
 
     return sql
   }

--
Gitblit v1.8.0