king
2022-09-06 bdfec44c9f3a37dbbe05bf14a252ffec04132a86
src/templates/sharecomponent/searchcomponent/index.jsx
@@ -1,8 +1,7 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { is, fromJS } from 'immutable'
import { Tooltip, Modal, notification, Switch } from 'antd'
import { QuestionCircleOutlined } from '@ant-design/icons'
import { Modal, notification, Switch } from 'antd'
import moment from 'moment'
import Api from '@/api'
@@ -45,22 +44,6 @@
      searchlist: fromJS(this.props.config.search).toJS()
    })
  }
  // /**
  //  * @description 监听到搜索条件复制时,触发搜索条件编辑
  //  */
  // UNSAFE_componentWillReceiveProps (nextProps) {
  //   const { searchlist } = this.state
  //   if (!is(fromJS(nextProps.config.search), fromJS(this.props.config.search)) && !is(fromJS(nextProps.config.search), fromJS(searchlist))) {
  //     let len = nextProps.config.search.length
  //     let item = nextProps.config.search[len - 1]
  //     if (item && item.focus) {
  //       this.handleSearch(item)
  //     }
  //     this.setState({searchlist: fromJS(nextProps.config.search).toJS()})
  //   }
  // }
  componentDidMount () {
    MKEmitter.addListener('plusSearch', this.plusSearch)
@@ -257,7 +240,7 @@
          param.rduri = window.GLOB.mainSystemApi
        }
        
        Api.getLocalConfig(param).then(result => {
        Api.genericInterface(param).then(result => {
          if (result.status) {
            this.setState({
              sqlVerifing: false,
@@ -371,9 +354,6 @@
    return (
      <div className={'model-table-search-list length' + searchlist.length + (showField ? ' show-field' : '')}>
        <Tooltip placement="bottomLeft" overlayClassName="middle" title="在左侧工具栏《搜索》中,选择对应搜索框拖至此处添加;或点击按钮《添加搜索条件》批量添加,选择批量添加时,需提前选择使用表。">
          <QuestionCircleOutlined style={{color: '#c49f47', position: 'relative', left: '-15px', top: '5px'}} />
        </Tooltip>
        <FieldsComponent config={{uuid: config.uuid, search: searchlist}} type="search" />
        <Switch className="switch-field-show" checkedChildren={dict['model.switch.open']} unCheckedChildren={dict['model.switch.close']} defaultChecked={showField} onChange={this.onFieldChange} />
        <DragElement