From 2a347c8d91d6962f4302f0553c55a3b9f743baa5 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期三, 09 九月 2020 21:15:58 +0800
Subject: [PATCH] 2020-09-09

---
 src/tabviews/calendar/index.jsx |   64 ++++++++++++++++----------------
 1 files changed, 32 insertions(+), 32 deletions(-)

diff --git a/src/tabviews/calendar/index.jsx b/src/tabviews/calendar/index.jsx
index 6d43995..899056d 100644
--- a/src/tabviews/calendar/index.jsx
+++ b/src/tabviews/calendar/index.jsx
@@ -150,21 +150,37 @@
         return item
       })
 
-      // 鏁寸悊鏁版嵁婧愯嚜瀹氫箟鑴氭湰
-      let _customScript = ''
-      config.scripts && config.scripts.forEach(script => {
-        if (script.status !== 'false') {
-          _customScript += `
-          ${script.sql}
-          `
-        }
-      })
-
-      config.setting.customScript = _customScript
-
       // 鏁版嵁婧�
       if (config.setting.interType === 'inner' && !config.setting.innerFunc) {
         config.setting.interType = 'system'
+      }
+
+      if (config.setting.interType === 'system') {
+        // 鏁寸悊鏁版嵁婧愯嚜瀹氫箟鑴氭湰
+        let _customScript = ''
+        config.scripts && config.scripts.forEach(script => {
+          if (script.status !== 'false') {
+            _customScript += `
+            ${script.sql}
+            `
+          }
+        })
+
+        if (/\s/.test(config.setting.dataresource)) {
+          config.setting.dataresource = '(' + config.setting.dataresource + ') tb'
+        }
+    
+        if (this.props.dataManager) { // 鏁版嵁鏉冮檺
+          config.setting.dataresource = config.setting.dataresource.replace(/\$@/ig, '/*')
+          config.setting.dataresource = config.setting.dataresource.replace(/@\$/ig, '*/')
+          _customScript = _customScript.replace(/\$@/ig, '/*')
+          _customScript = _customScript.replace(/@\$/ig, '*/')
+        } else {
+          config.setting.dataresource = config.setting.dataresource.replace(/@\$|\$@/ig, '')
+          _customScript = _customScript.replace(/@\$|\$@/ig, '')
+        }
+
+        config.setting.customScript = _customScript
       }
 
       this.setState({
@@ -301,33 +317,17 @@
     const { arr_field, search, setting, config, calendarYear } = this.state
 
     let _search = Utils.joinMainSearchkey(search)
-
     _search = _search ? 'where ' + _search : ''
 
     let param = {
       func: 'sPC_Get_TableData',
       obj_name: 'data',
       arr_field: arr_field,
-      custom_script: setting.customScript || '',
-      default_sql: setting.default || 'true'
+      custom_script: setting.customScript,
+      default_sql: setting.execute || 'true'
     }
     
     let _dataresource = setting.dataresource
-
-    if (/\s/.test(_dataresource)) {
-      _dataresource = '(' + _dataresource + ') tb'
-    }
-
-    if (this.props.dataManager) { // 鏁版嵁鏉冮檺
-      _dataresource = _dataresource.replace(/\$@/ig, '/*')
-      _dataresource = _dataresource.replace(/@\$/ig, '*/')
-      param.custom_script = param.custom_script.replace(/\$@/ig, '/*')
-      param.custom_script = param.custom_script.replace(/@\$/ig, '*/')
-    } else {
-      _dataresource = _dataresource.replace(/@\$|\$@/ig, '')
-      param.custom_script = param.custom_script.replace(/@\$|\$@/ig, '')
-    }
-
     let regoptions = null
     if (setting.queryType === 'statistics' || param.custom_script) {
       let allSearch = Utils.getAllSearchOptions(search)
@@ -351,7 +351,7 @@
       })
     }
 
-    if (setting.queryType === 'statistics' && setting.default !== 'false') { // 缁熻鏁版嵁婧愶紝鍐呭鏇挎崲
+    if (setting.queryType === 'statistics' && setting.execute !== 'false') { // 缁熻鏁版嵁婧愶紝鍐呭鏇挎崲
       regoptions.forEach(item => {
         _dataresource = _dataresource.replace(item.reg, item.value)
       })
@@ -360,7 +360,7 @@
 
     let LText = ''
 
-    if (setting.default !== 'false') {
+    if (setting.execute !== 'false') {
       LText = `select ${arr_field} from ${_dataresource} ${_search}`
     }
 

--
Gitblit v1.8.0