From d59f518f466274b2caeb2e01c10c92deafe7c93b Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期三, 09 二月 2022 11:48:29 +0800 Subject: [PATCH] 2022-02-09 --- src/templates/zshare/verifycard/callbackcustomscript/index.jsx | 53 ++++++++++++++++++++++++++++++++++++++--------------- 1 files changed, 38 insertions(+), 15 deletions(-) diff --git a/src/templates/zshare/verifycard/callbackcustomscript/index.jsx b/src/templates/zshare/verifycard/callbackcustomscript/index.jsx index 062947f..0b5316b 100644 --- a/src/templates/zshare/verifycard/callbackcustomscript/index.jsx +++ b/src/templates/zshare/verifycard/callbackcustomscript/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' @@ -12,6 +13,8 @@ static propTpyes = { dict: PropTypes.object, // 瀛楀吀椤� btn: PropTypes.object, // 鎸夐挳淇℃伅 + initsql: PropTypes.string, // 鍒濆鍖栬剼鏈� + usefulfields: PropTypes.string, // 鍙敤瀛楁 systemScripts: PropTypes.array, // 绯荤粺鑴氭湰 customScripts: PropTypes.array, // 鑷畾涔夎剼鏈� scriptsChange: PropTypes.func // 琛ㄥ崟 @@ -82,8 +85,6 @@ return } - let prev = `declare @ErrorCode nvarchar(50),@retmsg nvarchar(4000) - ` let tail = ` aaa: ` @@ -107,14 +108,36 @@ } }) + if (!values.uuid) { + if (values.position === 'front') { + _prevCustomScript += ` + /* 榛樿sql鍓嶈剼鏈� */ + ${values.sql} + ` + } else { + _backCustomScript += ` + /* 榛樿sql鍚庤剼鏈� */ + ${values.sql} + ` + } + } + let param = { func: 's_debug_sql', exec_type: 'y', - LText: prev + _prevCustomScript + _backCustomScript + tail + LText: this.props.initsql + _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*/`) + }) } // 鏁版嵁鏉冮檺 param.LText = param.LText.replace(/@\$|\$@/ig, '') + // check param.LText = param.LText.replace(/\$check@|@check\$/ig, '') @@ -184,7 +207,7 @@ } render() { - const { systemScripts, btn } = this.props + const { usefulfields, systemScripts, btn } = this.props const { getFieldDecorator } = this.props.form const formItemLayout = { labelCol: { @@ -205,15 +228,20 @@ {btn.cbTable} </Form.Item> </Col> - <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"> + <Form.Item label={'鍙敤瀛楁'}> + {usefulfields} + </Form.Item> + </Col> : null} <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> }> @@ -252,12 +280,7 @@ </Button> </Col> <Col span={24} className="sql"> - <Form.Item label={ - <Tooltip placement="topLeft" title={'鏁版嵁妫�鏌ユ浛鎹㈢ $check@ -> /* 鎴� \'\'銆� @check$ -> */ 鎴� \'\''}> - <Icon type="question-circle" /> - sql - </Tooltip> - }> + <Form.Item label="sql"> {getFieldDecorator('sql', { initialValue: '', rules: [ -- Gitblit v1.8.0