| | |
| | | |
| | | componentDidMount () { |
| | | MKEmitter.addListener('submitStyle', this.getStyle) |
| | | MKEmitter.addListener('plusSearch', this.plusSearch) |
| | | } |
| | | |
| | | /** |
| | |
| | | return |
| | | } |
| | | MKEmitter.removeListener('submitStyle', this.getStyle) |
| | | MKEmitter.removeListener('plusSearch', this.plusSearch) |
| | | } |
| | | |
| | | shouldComponentUpdate (nextProps, nextState) { |
| | |
| | | }) |
| | | } |
| | | |
| | | updatefields = (config) => { |
| | | this.setState({card: config}, ()=> { |
| | | this.props.updateConfig(config) |
| | | }) |
| | | plusSearch = (MenuId, item, type) => { |
| | | const { card } = this.state |
| | | |
| | | if (MenuId !== card.uuid) return |
| | | |
| | | let _card = fromJS(card).toJS() |
| | | |
| | | if (type === 'simple') { |
| | | _card.search.push(item) |
| | | this.setState({ |
| | | card: _card, |
| | | }, () => { |
| | | this.props.updateConfig(_card) |
| | | }) |
| | | } else if (type === 'multil') { |
| | | _card.search.push(...item) |
| | | this.setState({ |
| | | card: _card, |
| | | }, () => { |
| | | this.props.updateConfig(_card) |
| | | }) |
| | | } |
| | | } |
| | | |
| | | getWrapForms = () => { |
| | |
| | | |
| | | return ( |
| | | <div className={`main-search-edit-list ${card.wrap.float} ${card.wrap.show || ''}`} onClick={this.clickComponent} id={card.uuid} style={_style}> |
| | | <FieldsComponent config={card} type="search" updatefield={this.updatefields} /> |
| | | <FieldsComponent config={card} type="search" /> |
| | | <Switch checkedChildren={dict['model.switch.open']} size="small" unCheckedChildren={dict['model.switch.close']} defaultChecked={showField} onChange={this.onFieldChange} /> |
| | | <DragElement |
| | | list={card.search} |