From 7a75537c6fb888fe55515b89b6e02d0852d73332 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期五, 08 三月 2024 21:09:00 +0800
Subject: [PATCH] Merge branch 'develop'

---
 src/menu/datasource/verifycard/index.jsx |   38 ++++++++++++++++++++------------------
 1 files changed, 20 insertions(+), 18 deletions(-)

diff --git a/src/menu/datasource/verifycard/index.jsx b/src/menu/datasource/verifycard/index.jsx
index e103038..ceabb28 100644
--- a/src/menu/datasource/verifycard/index.jsx
+++ b/src/menu/datasource/verifycard/index.jsx
@@ -545,7 +545,7 @@
 
   submitDataSource = () => {
     const { config, mainSearch } = this.props
-    const { activeKey, setting, columns, subColumns, scripts, cols } = this.state
+    const { activeKey, setting, columns, subColumns, scripts, cols, median } = this.state
 
     if (config.subtype === 'dualdatacard') {
       let arr = columns.map(col => col.field.toLowerCase())
@@ -579,6 +579,25 @@
           message: '瀛楁闆嗕腑涓嶅彲浣跨敤' + _arr.join('銆�') + '锛佹敞锛氭瀛楁涓烘彁浜ゆ椂鐨勭郴缁熷瓧娈点��',
           duration: 5
         })
+        return Promise.reject()
+      }
+    }
+
+    if (median.interType === 'system') {
+      let _loading = false
+      if (this.scriptsForm && this.scriptsForm.state.editItem) {
+        _loading = true
+      } else if (this.scriptsForm && this.scriptsForm.props.form.getFieldValue('sql') && !/^\s+$/.test(this.scriptsForm.props.form.getFieldValue('sql'))) {
+        _loading = true
+      }
+  
+      if (_loading) {
+        notification.warning({
+          top: 92,
+          message: '瀛樺湪鏈繚瀛樿剼鏈紝璇风偣鍑荤‘瀹氫繚瀛橈紝鎴栫偣鍑诲彇娑堟斁寮冧慨鏀癸紒',
+          duration: 5
+        })
+        this.setState({activeKey: 'scripts'})
         return Promise.reject()
       }
     }
@@ -624,23 +643,6 @@
         }
         this.sqlverify(() => { resolve({setting, columns, subColumns, scripts, cols }) }, reject, 'submit')
       } else if (activeKey === 'scripts') {
-        let _loading = false
-        if (this.scriptsForm && this.scriptsForm.state.editItem) {
-          _loading = true
-        } else if (this.scriptsForm && this.scriptsForm.props.form.getFieldValue('sql') && !/^\s+$/.test(this.scriptsForm.props.form.getFieldValue('sql'))) {
-          _loading = true
-        }
-
-        if (_loading) {
-          notification.warning({
-            top: 92,
-            message: '瀛樺湪鏈繚瀛樿剼鏈紝璇风偣鍑荤‘瀹氫繚瀛橈紝鎴栫偣鍑诲彇娑堟斁寮冧慨鏀癸紒',
-            duration: 5
-          })
-          reject()
-          return
-        }
-
         this.sqlverify(() => { resolve({setting, columns, subColumns, scripts, cols }) }, reject, 'submit')
       }
     })

--
Gitblit v1.8.0