From c0e017668d780c40f85230f227ea0160b5d22d4d Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 20 二月 2024 14:13:00 +0800
Subject: [PATCH] Merge branch 'master' into positec

---
 src/templates/zshare/customscript/index.jsx |   33 ++++++---------------------------
 1 files changed, 6 insertions(+), 27 deletions(-)

diff --git a/src/templates/zshare/customscript/index.jsx b/src/templates/zshare/customscript/index.jsx
index b3a0de2..50e6ad5 100644
--- a/src/templates/zshare/customscript/index.jsx
+++ b/src/templates/zshare/customscript/index.jsx
@@ -7,7 +7,7 @@
 
 import Utils from '@/utils/utils.js'
 import Api from '@/api'
-import { checkSQL } from '@/utils/utils-custom.js'
+import { checkSQL, getSearchFields } from '@/utils/utils-custom.js'
 import CodeMirror from '@/templates/zshare/codemirror'
 import asyncComponent from '@/utils/asyncComponent'
 import MKEmitter from '@/utils/events.js'
@@ -93,31 +93,9 @@
   UNSAFE_componentWillMount() {
     const { searches, scripts, urlFields } = this.props
 
-    let _usefulFields = []
-    searches.forEach(item => {
-      if (['dateweek', 'datemonth'].includes(item.type)) {
-        _usefulFields.push(item.key)
-        _usefulFields.push(item.key + '1')
-      } else if (item.type === 'daterange') {
-        let _skey = item.key
-        let _ekey = item.key + '1'
-
-        if (/,/.test(item.key)) {
-          _skey = item.key.split(',')[0]
-          _ekey = item.key.split(',')[1]
-        }
-        _usefulFields.push(_skey)
-        _usefulFields.push(_ekey)
-      } else if (item.type === 'date' && _usefulFields.includes(item.key)) {
-        _usefulFields.push(item.key + '1')
-      } else {
-        _usefulFields.push(item.key.replace(/,/ig, ', '))
-      }
-    })
-
     this.setState({
       urlFields: urlFields ? urlFields.join(', ') : '',
-      usefulFields: _usefulFields.join(', '),
+      usefulFields: getSearchFields(searches),
       scripts: fromJS(scripts).toJS()
     })
   }
@@ -135,17 +113,18 @@
     }
     let _scriptSql = `Select distinct func+Remark as funcname,longparam, s.Sort from聽 s_custom_script s inner join (select OpenID from sapp where ID=@Appkey@) p on s.openid = case when s.appkey='' then s.openid else p.OpenID end order by s.Sort`
 
-    _scriptSql = Utils.formatOptions(_scriptSql)
+    _scriptSql = Utils.formatOptions(_scriptSql, 'x')
 
     let _sParam = {
       func: 'sPC_Get_SelectedList',
       LText: _scriptSql,
       obj_name: 'data',
-      arr_field: 'funcname,longparam'
+      arr_field: 'funcname,longparam',
+      exec_type: 'x'
     }
     
     _sParam.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
-    _sParam.secretkey = Utils.encrypt(_sParam.LText, _sParam.timestamp)
+    _sParam.secretkey = Utils.encrypt('', _sParam.timestamp)
     _sParam.open_key = Utils.encryptOpenKey(_sParam.secretkey, _sParam.timestamp) // 浜戠鏁版嵁楠岃瘉
     
     Api.getCloudConfig(_sParam).then(res => {

--
Gitblit v1.8.0