From 71e3da644eca32a5aa40503e903efb0640748093 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期五, 21 七月 2023 17:00:59 +0800
Subject: [PATCH] 2023-07-21

---
 src/tabviews/zshare/topSearch/index.jsx |   19 +++++++++----------
 1 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/src/tabviews/zshare/topSearch/index.jsx b/src/tabviews/zshare/topSearch/index.jsx
index a92e5cb..77ce4ca 100644
--- a/src/tabviews/zshare/topSearch/index.jsx
+++ b/src/tabviews/zshare/topSearch/index.jsx
@@ -11,6 +11,7 @@
 import asyncComponent from '@/utils/asyncComponent'
 import asyncSpinComponent from '@/utils/asyncSpinComponent'
 import Utils from '@/utils/utils.js'
+import MKEmitter from '@/utils/events.js'
 import MKInput from './mkInput'
 import './index.scss'
 
@@ -25,8 +26,7 @@
 class MainSearch extends Component {
   static propTpyes = {
     BID: PropTypes.any,          // 鐖剁骇Id锛岀敤浜庢煡璇笅鎷夐�夋嫨椤�
-    config: PropTypes.object,    // 缁勪欢閰嶇疆淇℃伅(鑷畾涔夐〉闈�)
-    refreshdata: PropTypes.func  // 鍒锋柊鏁版嵁
+    config: PropTypes.object,    // 缁勪欢閰嶇疆淇℃伅
   }
 
   state = {
@@ -51,8 +51,6 @@
     let advanceValues = []
     let linkFields = {}
     let record = {}
-    let hasReqFields = false
-
     let forbid = false // header涓笉璁剧疆楂樼骇鎼滅储
     let _setting = {showAdv: false, show: false, style: null}
     
@@ -112,10 +110,6 @@
 
       if (fieldMap.has(item.field)) {
         item.field = item.field + '@tail@'
-      }
-
-      if (item.required) {
-        hasReqFields = true
       }
 
       if (item.advanced && !forbid) {
@@ -221,7 +215,7 @@
 
     this.setState({
       setting: _setting,
-      hasReqFields,
+      hasReqFields: config.$s_req,
       advanceValues,
       searchlist: _list
     }, () => {
@@ -691,7 +685,12 @@
           this.sign = ''
         }, 2000)
         
-        this.props.refreshdata(searches)
+        if (this.props.refreshdata) {
+          this.props.refreshdata(searches)
+        } else {
+          window.GLOB.SearchBox.set(this.props.config.$searchId, searches)
+          MKEmitter.emit('searchRefresh', this.props.config.$searchId)
+        }
       })
     })
   }

--
Gitblit v1.8.0