From c27d57333ed38c92f595219d2190ea63cef4d182 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 12 一月 2021 18:29:16 +0800
Subject: [PATCH] 2021-01-12

---
 src/templates/sharecomponent/actioncomponent/verifyexcelin/customscript/index.jsx |   32 ++++++++++++++++++++++++--------
 1 files changed, 24 insertions(+), 8 deletions(-)

diff --git a/src/templates/sharecomponent/actioncomponent/verifyexcelin/customscript/index.jsx b/src/templates/sharecomponent/actioncomponent/verifyexcelin/customscript/index.jsx
index 1e03a6b..3a5c827 100644
--- a/src/templates/sharecomponent/actioncomponent/verifyexcelin/customscript/index.jsx
+++ b/src/templates/sharecomponent/actioncomponent/verifyexcelin/customscript/index.jsx
@@ -122,19 +122,35 @@
           aaa:
         `
 
-        let _initsql = ''
-        this.props.scripts.forEach(script => {
-          if (this.state.editItem && this.state.editItem.uuid === script.uuid) return
-          if (script.status === 'false' || script.position !== 'init') return
+        let _initCustomScript = '' // 鍒濆鍖栬剼鏈�
+        let _prevCustomScript = '' // 榛樿sql鍓嶆墽琛岃剼鏈�
+        let _backCustomScript = '' // 榛樿sql鍚庢墽琛岃剼鏈�
 
-          _initsql += `
-            ${script.sql}
+        this.props.scripts.forEach(item => {
+          if (item.status === 'false') return
+
+          if (item.position === 'init') {
+            _initCustomScript += `
+            /* 鍒濆鍖栬剼鏈� */
+            ${values.uuid === item.uuid ? values.sql : item.sql}
             `
+          } else if (item.position === 'front') {
+            _prevCustomScript += `
+            /* 榛樿sql鍓嶈剼鏈� */
+            ${values.uuid === item.uuid ? values.sql : item.sql}
+            `
+          } else {
+            _backCustomScript += `
+            /* 榛樿sql鍚庤剼鏈� */
+            ${values.uuid === item.uuid ? values.sql : item.sql}
+            `
+          }
         })
 
         let param = {
           func: 's_debug_sql',
-          LText: this.state.verifySql + _initsql + values.sql + tail
+          exec_type: 'y',
+          LText: this.state.verifySql + _initCustomScript + _prevCustomScript + _backCustomScript + tail
         }
 
         param.LText = param.LText.replace(/@\$|\$@/ig, '')
@@ -146,7 +162,7 @@
 
         param.LText = Utils.formatOptions(param.LText)
         param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
-        param.secretkey = Utils.encrypt(param.LText, param.timestamp)
+        param.secretkey = Utils.encrypt('', param.timestamp)
         
         this.setState({loading: true})
         Api.getLocalConfig(param).then(res => {

--
Gitblit v1.8.0