king
2021-09-28 342d3498191f1683059fe586209ec920545e0bf9
src/templates/sharecomponent/searchcomponent/index.jsx
@@ -9,13 +9,15 @@
import zhCN from '@/locales/zh-CN/model.js'
import enUS from '@/locales/en-US/model.js'
import { getSearchForm } from '@/templates/zshare/formconfig'
import asyncComponent from '@/utils/asyncComponent'
import MKEmitter from '@/utils/events.js'
import SearchForm from './searchform'
import DragElement from './dragsearch'
import './index.scss'
const { confirm } = Modal
const FieldsComponent = asyncComponent(() => import('@/templates/sharecomponent/fieldscomponent'))
class SearchComponent extends Component {
  static propTpyes = {
@@ -311,22 +313,34 @@
  }
  shouldComponentUpdate (nextProps, nextState) {
    return !is(fromJS(this.state), fromJS(nextState)) || this.props.config.setting.show !== nextProps.config.setting.show
    if (!is(fromJS(this.state), fromJS(nextState))) {
      return true
    } else if (this.props.config.wrap) {
      return this.props.config.wrap.show !== nextProps.config.wrap.show
    } else {
      return this.props.config.setting.show !== nextProps.config.setting.show
    }
  }
  render() {
    const { config } = this.props
    const { dict, searchlist, visible, sqlVerifing, card, showField } = this.state
    let show = config.setting.show
    if (config.wrap) {
      show = config.wrap.show
    }
    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>
        <FieldsComponent config={config} type="search" />
        <Switch checkedChildren={dict['model.switch.open']} unCheckedChildren={dict['model.switch.close']} defaultChecked={showField} onChange={this.onFieldChange} />
        <DragElement
          list={searchlist}
          show={config.setting.show}
          show={show}
          showField={showField}
          handleList={this.handleList}
          handleMenu={this.handleSearch}