From c98e45bfac25e9110ad0383faac54a54d98ea9d5 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 18 十一月 2021 20:47:04 +0800
Subject: [PATCH] 2021-11-18

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

diff --git a/src/templates/zshare/verifycard/customscript/index.jsx b/src/templates/zshare/verifycard/customscript/index.jsx
index 1914af3..2bf77c8 100644
--- a/src/templates/zshare/verifycard/customscript/index.jsx
+++ b/src/templates/zshare/verifycard/customscript/index.jsx
@@ -1,6 +1,7 @@
 import React, {Component} from 'react'
 import PropTypes from 'prop-types'
-import { Form, Row, Col, Button, notification, Modal, Tooltip, Icon, Radio, Select } from 'antd'
+import { Form, Row, Col, Button, notification, Modal, Tooltip, Radio, Select } from 'antd'
+import { QuestionCircleOutlined } from '@ant-design/icons'
 import moment from 'moment'
 
 import Utils from '@/utils/utils.js'
@@ -114,10 +115,36 @@
           }
         })
 
+        if (!values.uuid) {
+          if (values.position === 'init') {
+            _initCustomScript += `
+            /* 鍒濆鍖栬剼鏈� */
+            ${values.sql}
+            `
+          } else if (values.position === 'front') {
+            _prevCustomScript += `
+            /* 榛樿sql鍓嶈剼鏈� */
+            ${values.sql}
+            `
+          } else {
+            _backCustomScript += `
+            /* 榛樿sql鍚庤剼鏈� */
+            ${values.sql}
+            `
+          }
+        }
+
         let param = {
           func: 's_debug_sql',
           exec_type: 'y',
           LText: this.props.initsql + _initCustomScript + _prevCustomScript + _backCustomScript + tail
+        }
+
+        if (window.GLOB.funcs && window.GLOB.funcs.length > 0) {
+          window.GLOB.funcs.forEach(item => {
+            let reg = new RegExp('\\$ex@' + item.func_code + '@ex\\$', 'ig')
+            param.LText = param.LText.replace(reg, `/*$ex@${item.func_code}-begin*/\n${item.key_sql}\n/*@ex$-end*/`)
+          })
         }
 
         // 鏁版嵁鏉冮檺
@@ -171,6 +198,8 @@
   }
 
   selectScript = (value, option) => {
+    if (!value || !option) return
+
     let _sql = this.props.form.getFieldValue('sql')
     if (_sql) {
       _sql = _sql + ` 
@@ -211,9 +240,9 @@
               {btn.sql}
             </Form.Item>
           </Col> : null}
-          <Col span={16}>
-            <Form.Item label={'鎶ラ敊瀛楁'} style={{margin: 0}}>
-              ErrorCode, retmsg
+          <Col span={10}>
+            <Form.Item label={'鎶ラ敊瀛楁'} style={{margin: 0, whiteSpace: 'nowrap'}}>
+              ErrorCode锛堝鍔犲悗缂�NT琛ㄧず鏁版嵁涓嶅洖婊氾紝濡侲NT銆丯NT銆丗NT銆丯MNT锛�, retmsg
             </Form.Item>
           </Col>
           {usefulfields ? <Col span={24} className="sqlfield">
@@ -224,7 +253,7 @@
           <Col span={8} style={{whiteSpace: 'nowrap'}}>
             <Form.Item style={{marginBottom: 0}} label={
               <Tooltip placement="bottomLeft" title={'鑷畾涔夎剼鏈笌榛樿sql浣嶇疆鍏崇郴銆�'}>
-                <Icon type="question-circle" style={{color: '#c49f47', marginRight: '5px'}} />
+                <QuestionCircleOutlined className="mk-form-tip" />
                 鎵ц浣嶇疆
               </Tooltip>
             }>
@@ -244,7 +273,7 @@
               <Select
                 showSearch
                 filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0}
-                onChange={this.selectScript}
+                onSelect={this.selectScript}
                 getPopupContainer={() => document.getElementById('verify-custom-scripts')}
               >
                 <Select.Option key="default" value={this.props.defaultsql}>榛樿sql</Select.Option>
@@ -264,8 +293,8 @@
           </Col>
           <Col span={24} className="sql">
             <Form.Item label={
-              <Tooltip placement="topLeft" title={'鏁版嵁妫�鏌ユ浛鎹㈢ $check@ -> /* 鎴� \'\'銆� @check$ -> */ 鎴� \'\''}>
-                <Icon type="question-circle" />
+              <Tooltip placement="topLeft" title={'鏁版嵁妫�鏌ユ浛鎹㈢ $check@ -> \'\'銆� @check$ -> \'\'锛孍rrorCode绛変簬C鏃� $check@ -> /*銆� @check$ -> */'}>
+                <QuestionCircleOutlined className="mk-form-tip" />
                 sql
               </Tooltip>
             }>

--
Gitblit v1.8.0