From 49f09cc6f8ff8c30a75ed1a9d6f510b69b73962a Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 12 十二月 2023 21:05:37 +0800
Subject: [PATCH] 2023-12-12

---
 src/templates/sharecomponent/actioncomponent/verifyexcelout/datasource/index.jsx |   71 ++++++++---------------------------
 1 files changed, 17 insertions(+), 54 deletions(-)

diff --git a/src/templates/sharecomponent/actioncomponent/verifyexcelout/datasource/index.jsx b/src/templates/sharecomponent/actioncomponent/verifyexcelout/datasource/index.jsx
index 213f959..1bbd830 100644
--- a/src/templates/sharecomponent/actioncomponent/verifyexcelout/datasource/index.jsx
+++ b/src/templates/sharecomponent/actioncomponent/verifyexcelout/datasource/index.jsx
@@ -3,7 +3,7 @@
 import { Form, Row, Col, Input, Radio, Tooltip, notification, InputNumber } from 'antd'
 import { QuestionCircleOutlined } from '@ant-design/icons'
 
-import Utils from '@/utils/utils.js'
+import { checkSQL } from '@/utils/utils-custom.js'
 import asyncComponent from '@/utils/asyncComponent'
 import './index.scss'
 
@@ -44,56 +44,9 @@
             reject()
             return
           } else if (values.defaultSql === 'true' && values.dataresource) {
-            let _quot = values.dataresource.match(/'{1}/g)
-            let _lparen = values.dataresource.match(/\({1}/g)
-            let _rparen = values.dataresource.match(/\){1}/g)
+            let pass = checkSQL(values.dataresource)
 
-            _quot = _quot ? _quot.length : 0
-            _lparen = _lparen ? _lparen.length : 0
-            _rparen = _rparen ? _rparen.length : 0
-
-            if (_quot % 2 !== 0) {
-              notification.warning({
-                top: 92,
-                message: '鏁版嵁婧愪腑\'蹇呴』鎴愬鍑虹幇',
-                duration: 5
-              })
-              reject()
-              return
-            } else if (_lparen !== _rparen) {
-              notification.warning({
-                top: 92,
-                message: '鏁版嵁婧愪腑()蹇呴』鎴愬鍑虹幇',
-                duration: 5
-              })
-              reject()
-              return
-            } else if (/--/ig.test(values.dataresource)) {
-              notification.warning({
-                top: 92,
-                message: '鏁版嵁婧愪腑锛屼笉鍙嚭鐜板瓧绗� -- 锛屾敞閲婅鐢� /*鍐呭*/',
-                duration: 5
-              })
-              reject()
-              return
-            } else if (/,,/ig.test(values.dataresource)) {
-              notification.warning({
-                top: 92,
-                message: '鏁版嵁婧愪腑锛屼笉鍙嚭鐜拌繛缁殑鑻辨枃閫楀彿锛�,,锛�',
-                duration: 5
-              })
-              reject()
-              return
-            }
-
-            let error = Utils.verifySql(values.dataresource)
-
-            if (error) {
-              notification.warning({
-                top: 92,
-                message: '鏁版嵁婧愪腑涓嶅彲浣跨敤' + error,
-                duration: 5
-              })
+            if (!pass) {
               reject()
               return
             }
@@ -216,15 +169,25 @@
                 </Radio.Group>)}
               </Form.Item>
             </Col> : null}
-            {dataType === 'custom' && defaultSql === 'true' ? <Col className="short-label" span={8}>
-              <Form.Item label="涓婚敭">
+            {btnType !== 'print' && dataType === 'custom' && defaultSql === 'true' ? <Col className="short-label" span={8}>
+              <Form.Item label={
+                <Tooltip placement="topLeft" title="鍙嚜瀹氫箟涓婚敭锛岀┖鏃堕粯璁や负鏁版嵁婧愪富閿�傛敞锛氶�夎瀵煎嚭鏃朵娇鐢ㄣ��">
+                  <QuestionCircleOutlined className="mk-form-tip" />
+                  涓婚敭
+                </Tooltip>
+              }>
                 {getFieldDecorator('primaryKey', {
-                  initialValue: setting.primaryKey || 'ID',
+                  initialValue: setting.primaryKey || '',
                 })(<Input placeholder={''} autoComplete="off" />)}
               </Form.Item>
             </Col> : null}
             {dataType === 'custom' && defaultSql === 'true' ? <Col className="short-label" span={8}>
-              <Form.Item label="鎺掑簭鏂瑰紡">
+              <Form.Item label={
+                <Tooltip placement="topLeft" title="濡傛灉鍦ㄨ嚜瀹氫箟鑴氭湰涓娇鐢ㄤ簡@pageSize@鎴朄orderBy@锛岃鍦ㄦ暟鎹簮涓崟鐙啓鎺掑簭璇彞銆�">
+                  <QuestionCircleOutlined className="mk-form-tip" />
+                  鎺掑簭鏂瑰紡
+                </Tooltip>
+              }>
                 {getFieldDecorator('order', {
                   initialValue: setting.order || '',
                   rules: [

--
Gitblit v1.8.0