| | |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * @description 监听到搜索条件复制时,触发搜索条件编辑 |
| | | */ |
| | | UNSAFE_componentWillReceiveProps (nextProps) { |
| | | const { searchlist } = this.state |
| | | // /** |
| | | // * @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()}) |
| | | } |
| | | } |
| | | // 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) |
| | |
| | | <Tooltip placement="bottomLeft" overlayClassName="middle" title={dict['model.tooltip.search.guide']}> |
| | | <Icon type="question-circle" /> |
| | | </Tooltip> |
| | | <FieldsComponent config={config} type="search" /> |
| | | <FieldsComponent config={{uuid: config.uuid, search: searchlist}} type="search" /> |
| | | <Switch checkedChildren={dict['model.switch.open']} unCheckedChildren={dict['model.switch.close']} defaultChecked={showField} onChange={this.onFieldChange} /> |
| | | <DragElement |
| | | list={searchlist} |