| | |
| | | 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' |
| | |
| | | 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) |
| | |
| | | |
| | | 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 |