From 09e0de52a398dd08a0dc3f4b43e4589d211e9c27 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 30 十二月 2021 12:44:45 +0800
Subject: [PATCH] 2021-12-30

---
 src/menu/components/share/searchcomponent/index.jsx |   31 +++++++++++--------------------
 1 files changed, 11 insertions(+), 20 deletions(-)

diff --git a/src/menu/components/share/searchcomponent/index.jsx b/src/menu/components/share/searchcomponent/index.jsx
index 93b09e4..5c18abf 100644
--- a/src/menu/components/share/searchcomponent/index.jsx
+++ b/src/menu/components/share/searchcomponent/index.jsx
@@ -1,7 +1,6 @@
 import React, {Component} from 'react'
 import PropTypes from 'prop-types'
 import { is, fromJS } from 'immutable'
-import {connect} from 'react-redux'
 import { Modal, notification } from 'antd'
 import moment from 'moment'
 
@@ -25,7 +24,7 @@
   }
 
   state = {
-    dict: localStorage.getItem('lang') !== 'en-US' ? zhCN : enUS,
+    dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS,
     searchlist: null,    // 鎼滅储鏉′欢闆�
     sqlVerifing: false,  // sql楠岃瘉涓�
     visible: false,      // 妯℃�佹鎺у埗
@@ -103,12 +102,14 @@
     let linkableFields = []
 
     searchlist.forEach(item => {
-      if (item.uuid !== card.uuid && (item.type === 'select' || item.type === 'link')) {
-        linkableFields.push({
-          value: item.field,
-          text: item.label
-        })
-      }
+      if (item.uuid === card.uuid) return
+      if (!['select', 'link', 'checkcard'].includes(item.type)) return
+      if (item.type === 'checkcard' && item.multiple === 'true') return
+      
+      linkableFields.push({
+        value: item.field,
+        text: item.label
+      })
     })
 
     this.setState({
@@ -211,7 +212,7 @@
         return
       }
 
-      if ((res.type === 'select' || res.type === 'multiselect' || res.type === 'link') && res.resourceType === '1' && /\s/.test(res.dataSource)) {
+      if (['select', 'multiselect', 'link', 'checkcard'].includes(res.type) && res.resourceType === '1' && /\s/.test(res.dataSource)) {
         this.setState({
           sqlVerifing: true
         })
@@ -319,14 +320,4 @@
   }
 }
 
-const mapStateToProps = (state) => {
-  return {
-    menu: state.customMenu
-  }
-}
-
-const mapDispatchToProps = () => {
-  return {}
-}
-
-export default connect(mapStateToProps, mapDispatchToProps)(SearchComponent)
\ No newline at end of file
+export default SearchComponent
\ No newline at end of file

--
Gitblit v1.8.0