From 6afdec0062dacbded57e166230eb22cc55ced0c1 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期六, 08 五月 2021 14:30:21 +0800
Subject: [PATCH] 2021-05-08

---
 src/menu/components/search/main-search/index.jsx |   15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/src/menu/components/search/main-search/index.jsx b/src/menu/components/search/main-search/index.jsx
index ae2e5b9..4eacfae 100644
--- a/src/menu/components/search/main-search/index.jsx
+++ b/src/menu/components/search/main-search/index.jsx
@@ -1,7 +1,7 @@
 import React, { Component } from 'react'
 import PropTypes from 'prop-types'
 import { is, fromJS } from 'immutable'
-import { Modal, notification, Popover, Icon } from 'antd'
+import { Modal, notification, Popover, Icon, Switch } from 'antd'
 import moment from 'moment'
 
 import Api from '@/api'
@@ -34,6 +34,7 @@
     searchlist: null,    // 鎼滅储鏉′欢闆�
     sqlVerifing: false,  // sql楠岃瘉涓�
     visible: false,      // 妯℃�佹鎺у埗
+    showField: false,
     editcard: null       // 缂栬緫涓厓绱�
   }
 
@@ -339,6 +340,14 @@
     })
   }
 
+  onFieldChange = () => {
+    const { showField } = this.state
+
+    this.setState({
+      showField: !showField
+    })
+  }
+
   clickComponent = (e) => {
     if (sessionStorage.getItem('style-control') === 'true' || sessionStorage.getItem('style-control') === 'component') {
       e.stopPropagation()
@@ -347,13 +356,15 @@
   }
 
   render() {
-    const { dict, card, visible, sqlVerifing } = this.state
+    const { dict, card, visible, sqlVerifing, showField } = this.state
     let _style = resetStyle(card.style)
 
     return (
       <div className={`main-search-edit-list ${card.wrap.float} ${card.wrap.show || ''}`} onClick={this.clickComponent} id={card.uuid} style={_style}>
+        <Switch checkedChildren={dict['model.switch.open']} size="small" unCheckedChildren={dict['model.switch.close']} defaultChecked={showField} onChange={this.onFieldChange} />
         <DragElement
           list={card.search}
+          showField={showField}
           handleList={this.handleList}
           handleMenu={this.handleSearch}
           deleteMenu={this.deleteElement}

--
Gitblit v1.8.0