From 8b6f9a84e5eb704b25c105cce31904381bd81107 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 29 十一月 2022 18:41:58 +0800
Subject: [PATCH] 2022-11-29

---
 src/tabviews/zshare/actionList/excelInbutton/index.jsx |  104 +++++++++++++++++++++++++++++++++++++++++++--------
 1 files changed, 87 insertions(+), 17 deletions(-)

diff --git a/src/tabviews/zshare/actionList/excelInbutton/index.jsx b/src/tabviews/zshare/actionList/excelInbutton/index.jsx
index 01747a5..09ee076 100644
--- a/src/tabviews/zshare/actionList/excelInbutton/index.jsx
+++ b/src/tabviews/zshare/actionList/excelInbutton/index.jsx
@@ -14,12 +14,13 @@
 import MkIcon from '@/components/mk-icon'
 // import './index.scss'
 
+const { confirm } = Modal
+
 class ExcelInButton extends Component {
   static propTpyes = {
     BID: PropTypes.string,            // 涓昏〃ID
     BData: PropTypes.any,             // 涓昏〃鏁版嵁
     selectedData: PropTypes.any,      // 瀛愯〃涓�夋嫨鏁版嵁
-    Tab: PropTypes.any,               // 濡傛灉褰撳墠鍏冪礌涓烘爣绛炬椂锛宼ab涓烘爣绛句俊鎭�
     btn: PropTypes.object,            // 鎸夐挳
     setting: PropTypes.any,           // 椤甸潰閫氱敤璁剧疆
     disabled: PropTypes.any,          // 琛屾寜閽鐢�
@@ -117,13 +118,13 @@
    * @description 瑙﹀彂鎸夐挳鎿嶄綔
    */
   actionTrigger = (triggerId, record, type) => {
-    const { setting, Tab, BID, btn, selectedData } = this.props
+    const { setting, BID, btn, selectedData } = this.props
     const { loading, disabled } = this.state
 
     if (loading || disabled) return
     if (triggerId && btn.uuid !== triggerId) return
 
-    if (((Tab && Tab.supMenu) || setting.supModule) && !BID) {
+    if (setting.supModule && !BID) {
       notification.warning({
         top: 92,
         message: '闇�瑕佷笂绾т富閿�硷紒',
@@ -338,29 +339,86 @@
       
       param.excel_in_type = 'true'
       param.LText1 = Utils.formatOptions(result.insert)
-      param.LText2 = Utils.formatOptions(result.bottom)
-      param.LText = Utils.formatOptions(result.sql)
       param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
+      param.LText2 = result.bottom
+      param.LText = result.sql
+
+      let unCheckParam = null
+
+      if (/\$check@|@check\$/ig.test(param.LText2) || /\$check@|@check\$/ig.test(param.LText)) {
+        unCheckParam = fromJS(param).toJS()
+        param.LText = param.LText.replace(/\$check@|@check\$/ig, '')
+        param.LText2 = param.LText2.replace(/\$check@|@check\$/ig, '')
+      }
+
+      param.LText2 = Utils.formatOptions(param.LText2)
+      param.LText = Utils.formatOptions(param.LText)
       param.secretkey = Utils.encrypt(param.LText, param.timestamp)
       if (window.GLOB.mkHS && param.timestamp) { // 浜戠楠岃瘉
         param.open_key = Utils.encryptOpenKey(param.secretkey, param.timestamp)
       }
 
       param.menuname = btn.logLabel
-
+      
       if (window.GLOB.probation) {
         param.s_debug_type = 'Y'
       }
 
-      Api.genericInterface(param).then((res) => {
-        if (res.status) {
-          this.execSuccess(res)
-        } else {
-          this.execError(res)
+      if (unCheckParam) {
+        unCheckParam.LText = unCheckParam.LText.replace(/\$check@/ig, '/*').replace(/@check\$/ig, '*/')
+        unCheckParam.LText = Utils.formatOptions(unCheckParam.LText)
+        unCheckParam.LText2 = unCheckParam.LText2.replace(/\$check@/ig, '/*').replace(/@check\$/ig, '*/')
+        unCheckParam.LText2 = Utils.formatOptions(unCheckParam.LText2)
+
+        unCheckParam.secretkey = Utils.encrypt(unCheckParam.LText, unCheckParam.timestamp)
+
+        unCheckParam.menuname = btn.logLabel
+
+        if (window.GLOB.probation) {
+          unCheckParam.s_debug_type = 'Y'
         }
-      }, () => {
-        this.execError({})
-      })
+
+        Api.genericInterface(param).then(res => {
+          if (res.status) {
+            this.execSuccess(res)
+          } else if (res.ErrCode === 'C') {
+            const _this = this
+            confirm({
+              title: '缁х画鎵ц锛�',
+              content: res.message,
+              onOk() {
+                return new Promise(resolve => {
+                  Api.genericInterface(unCheckParam).then(result => {
+                    if (result.status) {
+                      _this.execSuccess(result)
+                    } else {
+                      _this.execError(result)
+                    }
+                    resolve()
+                  })
+                })
+              },
+              onCancel() {
+                _this.execError(res)
+              }
+            })
+          } else {
+            this.execError(res)
+          }
+        }, () => {
+          this.execError({})
+        })
+      } else {
+        Api.genericInterface(param).then((res) => {
+          if (res.status) {
+            this.execSuccess(res)
+          } else {
+            this.execError(res)
+          }
+        }, () => {
+          this.execError({})
+        })
+      }
     } else if (btn.intertype === 'inner' && btn.innerFunc) { // 鑷畾涔夊瓨鍌ㄨ繃绋�
       param.func = btn.innerFunc
 
@@ -422,14 +480,26 @@
             }
           }
         } else {
-          if (btn.sysInterface === 'true' && window.GLOB.mainSystemApi) {
-            param.rduri = window.GLOB.mainSystemApi
-          } else if (btn.sysInterface !== 'true') {
+          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 (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
+            }
           }
         }
 

--
Gitblit v1.8.0