From 432b788acf901b0720184b8ee8bc81a2e6fa47e0 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 28 九月 2021 18:22:02 +0800
Subject: [PATCH] 2021-09-28

---
 src/tabviews/zshare/topSearch/index.jsx |   27 +++++++++++++--------------
 1 files changed, 13 insertions(+), 14 deletions(-)

diff --git a/src/tabviews/zshare/topSearch/index.jsx b/src/tabviews/zshare/topSearch/index.jsx
index d2c6e39..c2cf4ad 100644
--- a/src/tabviews/zshare/topSearch/index.jsx
+++ b/src/tabviews/zshare/topSearch/index.jsx
@@ -366,7 +366,7 @@
   }
 
   resetSearch = (result) => {
-    let _searchlist = this.state.searchlist.map(item => {
+    let _searchlist = fromJS(this.state.searchlist).toJS().map(item => {
       if (['select', 'link', 'multiselect', 'checkcard'].includes(item.type) && result[item.field] && result[item.field].length > 0) {
         let options = []
         result[item.field].forEach(cell => {
@@ -394,23 +394,22 @@
 
         item.oriOptions = [...item.oriOptions, ...options]
       }
+
+      if (item.type === 'link') {
+        if (item.supInitVal) {
+          item.options = item.oriOptions.filter(option => option.ParentID === item.supInitVal || option.Value === '')
+        } else {
+          item.options = item.oriOptions
+        }
+      } else if (item.type === 'select' || item.type === 'multiselect' || item.type === 'checkcard') {
+        item.options = item.oriOptions
+      }
+
       return item
     })
 
     this.setState({
-      searchlist: _searchlist.map(item => {
-        if (item.type === 'link') {
-          if (item.supInitVal) {
-            item.options = item.oriOptions.filter(option => option.ParentID === item.supInitVal || option.Value === '')
-          } else {
-            item.options = item.oriOptions
-          }
-        } else if (item.type === 'select' || item.type === 'multiselect' || item.type === 'checkcard') {
-          item.options = item.oriOptions
-        }
-
-        return item
-      })
+      searchlist: _searchlist
     })
   }
 

--
Gitblit v1.8.0