From cb9ade2afd2a367ad767bc605ab7086c695dd010 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期五, 09 十二月 2022 15:53:32 +0800
Subject: [PATCH] 2022-12-09

---
 src/menu/datasource/verifycard/customscript/index.jsx |   33 +++++++++++++++++++++++++--------
 1 files changed, 25 insertions(+), 8 deletions(-)

diff --git a/src/menu/datasource/verifycard/customscript/index.jsx b/src/menu/datasource/verifycard/customscript/index.jsx
index 2b009a3..a673fea 100644
--- a/src/menu/datasource/verifycard/customscript/index.jsx
+++ b/src/menu/datasource/verifycard/customscript/index.jsx
@@ -1,7 +1,7 @@
 import React, {Component} from 'react'
 import PropTypes from 'prop-types'
 import { is, fromJS } from 'immutable'
-import { Form, Row, Col, Button, notification, Select } from 'antd'
+import { Form, Row, Col, Button, notification, Select, Tooltip } from 'antd'
 
 import Utils from '@/utils/utils.js'
 import CodeMirror from '@/templates/zshare/codemirror'
@@ -10,7 +10,6 @@
 
 class CustomForm extends Component {
   static propTpyes = {
-    dict: PropTypes.object,         // 瀛楀吀椤�
     defaultsql: PropTypes.string,   // 榛樿sql
     setting: PropTypes.object,      // 璁剧疆
     searches: PropTypes.array,      // 鎼滅储鏉′欢
@@ -101,6 +100,15 @@
     // 琛ㄥ崟鎻愪氦鏃舵鏌ヨ緭鍏ュ�兼槸鍚︽纭�
     this.props.form.validateFieldsAndScroll((err, values) => {
       if (!err) {
+        if (/^[\s\n]+$/.test(values.sql)) {
+          notification.warning({
+            top: 92,
+            message: '璇疯緭鍏ql!',
+            duration: 5
+          })
+          return
+        }
+
         values.uuid = this.state.editItem ? this.state.editItem.uuid : ''
 
         let _quot = values.sql.match(/'{1}/g)
@@ -152,7 +160,9 @@
             loading: false
           })
 
-          MKEmitter.emit('editLineId', values.uuid)
+          if (values.uuid) {
+            MKEmitter.emit('editLineId', values.uuid)
+          }
 
           this.props.form.setFieldsValue({
             sql: ' '
@@ -169,7 +179,9 @@
 
   selectScript = (value, option) => {
     let _sql = this.props.form.getFieldValue('sql')
-    if (_sql) {
+    if (_sql === ' ') {
+      _sql = ''
+    } else if (_sql) {
       _sql = _sql + ` 
 
       `
@@ -205,6 +217,8 @@
       }
     }
 
+    let urlFields = window.GLOB.urlFields ? window.GLOB.urlFields.join(', ') : ''
+
     return (
       <Form {...formItemLayout} className="modal-menu-setting-script">
         <Row gutter={24}>
@@ -220,7 +234,10 @@
           </Col>
           <Col span={24} className="sqlfield">
             <Form.Item label={'鍙敤瀛楁'}>
-              id, bid, loginuid, sessionuid, userid, username, fullname, RoleID, mk_departmentcode, mk_organization, login_city, appkey, time_id, orderBy, pageSize, pageIndex{usefulFields ? ', ' + usefulFields : ''}{window.GLOB.urlFields && window.GLOB.urlFields.length > 0 ? ', ' + window.GLOB.urlFields.join(', ') : ''}
+              <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={'绯荤粺鍙橀噺锛岀郴缁熶細瀹氫箟鍙橀噺骞惰祴鍊笺��'}><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, pageSize, pageIndex{usefulFields ? ', ' + usefulFields : ''}</Tooltip>
+              <Tooltip mouseLeaveDelay={0.3} mouseEnterDelay={0.3} placement="top" title={'url鍙橀噺锛岃鎸夌収@xxx@鏍煎紡浣跨敤銆�'}>{urlFields ? ', ' : ''}<span style={{color: '#13c2c2'}}>{urlFields}</span></Tooltip>
             </Form.Item>
           </Col>
           <Col span={10} style={{width: '43%'}}>
@@ -249,16 +266,16 @@
             </Button>
           </Col>
           <Col span={24} className="sql">
-            <Form.Item label={'sql'}>
+            <Form.Item label="sql">
               {getFieldDecorator('sql', {
                 initialValue: '',
                 rules: [
                   {
                     required: true,
-                    message: this.props.dict['form.required.input'] + 'sql!'
+                    message: '璇疯緭鍏ql!'
                   }
                 ]
-              })(<CodeMirror />)}
+              })(<CodeMirror/>)}
             </Form.Item>
           </Col>
         </Row>

--
Gitblit v1.8.0