king
2021-05-08 6afdec0062dacbded57e166230eb22cc55ced0c1
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}