From f3d4db769ba9b51b799d981511a710fd443d0e08 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期一, 21 四月 2025 12:18:03 +0800
Subject: [PATCH] Merge branch 'master' into positec

---
 src/templates/zshare/customscript/index.jsx |   37 ++++++++-----------------------------
 1 files changed, 8 insertions(+), 29 deletions(-)

diff --git a/src/templates/zshare/customscript/index.jsx b/src/templates/zshare/customscript/index.jsx
index b3a0de2..e2da7de 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 => {
@@ -349,12 +328,12 @@
             </Col> : null}
             <Col span={16}>
               <Form.Item label={'鎶ラ敊瀛楁'} style={{margin: 0}}>
-                ErrorCode, retmsg
+                errorcode, retmsg
               </Form.Item>
             </Col>
             <Col span={24} className="sqlfield">
               <Form.Item label={'鍙敤瀛楁'}>
-                <Tooltip mouseLeaveDelay={0.3} mouseEnterDelay={0.3} placement="top" title={'鍏叡鍊硷紝璇锋寜鐓xxx@鏍煎紡浣跨敤銆�'}><span style={{color: '#1890ff'}}>BID, ID, LoginUID, SessionUid, UserID, Appkey, time_id</span></Tooltip>,&nbsp;
+                <Tooltip mouseLeaveDelay={0.3} mouseEnterDelay={0.3} placement="top" title={'鍏叡鍊硷紝璇锋寜鐓xxx@鏍煎紡浣跨敤銆�'}><span style={{color: '#1890ff'}}>BID, ID, LoginUID, SessionUid, UserID, Appkey, lang, time_id</span></Tooltip>,&nbsp;
                 <Tooltip mouseLeaveDelay={0.3} mouseEnterDelay={0.3} placement="top" title={'绯荤粺鍙橀噺锛岀郴缁熶細瀹氫箟鍙橀噺骞惰祴鍊笺��'}><span style={{color: '#fa8c16'}}>UserName, FullName, RoleID, mk_departmentcode, mk_organization, mk_user_type, mk_nation, mk_province, mk_city, mk_district, mk_address</span></Tooltip>,&nbsp;
                 <Tooltip mouseLeaveDelay={0.3} mouseEnterDelay={0.3} placement="top" title={'鎺掑簭銆佸垎椤典互鍙婃悳绱㈡潯浠跺彉閲忥紝璇锋寜鐓xxx@鏍煎紡浣跨敤銆�'}>orderBy{setting.laypage === 'true' ? ', pageSize, pageIndex': ''}{usefulFields ? ', ' + usefulFields : ''}</Tooltip>
                 {urlFields ?<Tooltip mouseLeaveDelay={0.3} mouseEnterDelay={0.3} placement="top" title={'url鍙橀噺锛岃鎸夌収@xxx@鏍煎紡浣跨敤銆�'}>, <span style={{color: '#13c2c2'}}>{urlFields}</span></Tooltip> : ''}

--
Gitblit v1.8.0