From f6626b05f1275cc2f8ca77f773d4f6a6af1b0a89 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期一, 21 十一月 2022 16:11:55 +0800
Subject: [PATCH] 2022-11-21

---
 src/menu/datasource/index.jsx |   17 +++++++++++------
 1 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/src/menu/datasource/index.jsx b/src/menu/datasource/index.jsx
index e0bb557..52a1544 100644
--- a/src/menu/datasource/index.jsx
+++ b/src/menu/datasource/index.jsx
@@ -5,7 +5,6 @@
 import { SettingOutlined } from '@ant-design/icons'
 
 import VerifyCard from './verifycard'
-import MKEmitter from '@/utils/events.js'
 import './index.scss'
 
 class DataSource extends Component {
@@ -140,8 +139,6 @@
       visible: true,
       mainSearch: search
     })
-
-    MKEmitter.emit('modalStatus', '鏁版嵁婧�')
   }
 
   verifySubmit = () => {
@@ -187,14 +184,22 @@
             }
           })
         })
+      } else {
+        res.scripts.forEach(item => {
+          if (item.status === 'false') return
+
+          if (/exec\s/ig.test(item.sql)) {
+            maxScript = 1000
+          } else if (item.sql.length > maxScript) {
+            maxScript = item.sql.length
+          }
+        })
       }
 
       res.setting.maxScript = maxScript
 
       this.setState({loading: false, visible: false})
       this.props.updateConfig({...config, ...res})
-
-      MKEmitter.emit('modalStatus', false)
     }, () => {
       this.setState({loading: false})
     })
@@ -216,7 +221,7 @@
           okText="鎻愪氦"
           onOk={this.verifySubmit}
           confirmLoading={loading}
-          onCancel={() => { MKEmitter.emit('modalStatus', false);this.setState({ visible: false }) }}
+          onCancel={() => {this.setState({ visible: false }) }}
           destroyOnClose
         >
           <VerifyCard

--
Gitblit v1.8.0