king
2021-05-08 6afdec0062dacbded57e166230eb22cc55ced0c1
src/templates/sharecomponent/searchcomponent/index.jsx
@@ -1,7 +1,7 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { is, fromJS } from 'immutable'
import { Icon, Tooltip, Modal, notification } from 'antd'
import { Icon, Tooltip, Modal, notification, Switch } from 'antd'
import moment from 'moment'
import Api from '@/api'
@@ -27,6 +27,7 @@
    searchlist: null,    // 搜索条件集
    sqlVerifing: false,  // sql验证中
    visible: false,      // 模态框控制
    showField: false,
    card: null           // 编辑中元素
  }
@@ -261,6 +262,15 @@
    })
  }
  onFieldChange = () => {
    const { showField } = this.state
    this.setState({
      showField: !showField
    })
  }
  /**
   * @description 组件销毁,清除state更新
   */
@@ -275,15 +285,17 @@
  }
  render() {
    const { dict, searchlist, visible, sqlVerifing, card } = this.state
    const { dict, searchlist, visible, sqlVerifing, card, showField } = this.state
    return (
      <div className={'model-table-search-list length' + searchlist.length}>
        <Tooltip placement="bottomLeft" overlayClassName="middle" title={dict['model.tooltip.search.guide']}>
          <Icon type="question-circle" />
        </Tooltip>
        <Switch checkedChildren={dict['model.switch.open']} unCheckedChildren={dict['model.switch.close']} defaultChecked={showField} onChange={this.onFieldChange} />
        <DragElement
          list={searchlist}
          showField={showField}
          handleList={this.handleList}
          handleMenu={this.handleSearch}
          deleteMenu={this.deleteElement}