From a8d8d2fdb83f21e76f90cb13ea91ad6e9bf98a9b Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期一, 24 三月 2025 10:53:52 +0800
Subject: [PATCH] Merge branch 'master' into positec

---
 src/menu/datasource/index.jsx            |   10 +++++-----
 src/menu/datasource/verifycard/index.jsx |   12 ++++++------
 2 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/src/menu/datasource/index.jsx b/src/menu/datasource/index.jsx
index 661db31..591a092 100644
--- a/src/menu/datasource/index.jsx
+++ b/src/menu/datasource/index.jsx
@@ -93,13 +93,13 @@
     } else if (config.type === 'interface') {
       menu.components.forEach(item => {
         if (item.type !== 'search') return
-        search = item.search
+        search = item.search || []
       })
     } else {
       let filterComponent = (box, mainSearch) => {
         box.components.forEach(item => {
           if (item.type !== 'search') return
-          mainSearch = item.search
+          mainSearch = item.search || []
         })
         let has = false
         box.components.forEach(item => {
@@ -136,10 +136,10 @@
   }
 
   verifySubmit = () => {
-    const { config } = this.props
+    const { config, mainSearch } = this.props
 
     this.setState({loading: true})
-    this.verifyRef.submitDataSource().then((res, hasMSearch) => {
+    this.verifyRef.submitDataSource().then((res) => {
 
       let MenuType = sessionStorage.getItem('MenuType')
 
@@ -340,7 +340,7 @@
         }, 150)
       }
 
-      if (config.type === 'interface' && res.setting && res.setting.useMSearch === 'true' && !hasMSearch) {
+      if (config.type === 'interface' && res.setting && res.setting.useMSearch === 'true' && mainSearch.length === 0) {
         Modal.warning({
           title: '鏁版嵁婧愪腑浣跨敤浜嗗閮ㄦ悳绱紝浣嗘悳绱㈡潯浠跺皻鏈坊鍔狅紒',
           centered: true
diff --git a/src/menu/datasource/verifycard/index.jsx b/src/menu/datasource/verifycard/index.jsx
index 3e7cbd2..5877c89 100644
--- a/src/menu/datasource/verifycard/index.jsx
+++ b/src/menu/datasource/verifycard/index.jsx
@@ -270,7 +270,7 @@
       searches: formatSearch(search),
       searchKey: '',
       debugId: _setting.debugId || '',
-      hasMainSearch: mainSearch && mainSearch.length,
+      hasMainSearch: mainSearch && mainSearch.length > 0,
       oriConfig: fromJS({
         scripts,
         columns: columns,
@@ -574,7 +574,7 @@
 
   submitDataSource = () => {
     const { config, mainSearch } = this.props
-    const { activeKey, setting, columns, subColumns, scripts, cols, median, searches, hasMainSearch } = this.state
+    const { activeKey, setting, columns, subColumns, scripts, cols, median, searches } = this.state
 
     if (config.subtype === 'dualdatacard') {
       let arr = columns.map(col => col.field.toLowerCase())
@@ -645,7 +645,7 @@
             searches: _searches,
             setting: res
           }, () => {
-            this.sqlverify(() => { resolve({setting: res, columns, subColumns, scripts, cols, searches: _searches }, hasMainSearch) }, reject, 'submit')
+            this.sqlverify(() => { resolve({setting: res, columns, subColumns, scripts, cols, searches: _searches }) }, reject, 'submit')
           })
         }, () => {
           reject()
@@ -660,7 +660,7 @@
           reject()
           return
         }
-        this.sqlverify(() => { resolve({setting, columns, subColumns, scripts, cols, searches }, hasMainSearch) }, reject, 'submit')
+        this.sqlverify(() => { resolve({setting, columns, subColumns, scripts, cols, searches }) }, reject, 'submit')
       } else if (activeKey === 'subcolumns') {
         if (this.subdatasource && this.subdatasource.state.editingKey) {
           notification.warning({
@@ -671,9 +671,9 @@
           reject()
           return
         }
-        this.sqlverify(() => { resolve({setting, columns, subColumns, scripts, cols, searches }, hasMainSearch) }, reject, 'submit')
+        this.sqlverify(() => { resolve({setting, columns, subColumns, scripts, cols, searches }) }, reject, 'submit')
       } else if (activeKey === 'scripts') {
-        this.sqlverify(() => { resolve({setting, columns, subColumns, scripts, cols, searches }, hasMainSearch) }, reject, 'submit')
+        this.sqlverify(() => { resolve({setting, columns, subColumns, scripts, cols, searches }) }, reject, 'submit')
       }
     })
   }

--
Gitblit v1.8.0