| | |
| | | * @description 搜索条件删除 |
| | | */ |
| | | deleteElement = (cell) => { |
| | | let _this = this |
| | | let that = this |
| | | |
| | | confirm({ |
| | | content: `确定删除 - ${cell.label} ?`, |
| | | onOk() { |
| | | let _card = fromJS(_this.state.card).toJS() |
| | | let _card = fromJS(that.state.card).toJS() |
| | | _card.search = _card.search.filter(item => item.uuid !== cell.uuid) |
| | | |
| | | _this.updateComponent(_card) |
| | | that.updateComponent(_card) |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | |
| | | match: 'like', |
| | | focus: true |
| | | } |
| | | |
| | | if (card.search.length) { |
| | | item.ratio = card.search[card.search.length - 1].ratio |
| | | } |
| | | |
| | | card.search.push(item) |
| | | |
| | | this.setState({card}, () => { |
| | |
| | | |
| | | if (type === 'simple') { |
| | | _card.search.push(item) |
| | | |
| | | this.updateComponent(_card) |
| | | this.handleSearch(item) |
| | | } else if (type === 'replace') { |
| | | delete item.focus |
| | | _card.search = _card.search.map(cell => { |
| | | if (cell.field && cell.field.toLowerCase() === item.field.toLowerCase()) { |
| | | return item |
| | | } |
| | | return cell |
| | | }) |
| | | |
| | | this.updateComponent(_card) |
| | | this.handleSearch(item) |
| | |
| | | let _style = resetStyle(card.style) |
| | | |
| | | return ( |
| | | <div className={`main-search-edit-list ${card.wrap.float} ${showField ? 'show-field' : ''} mk-size-${card.wrap.searchSize || ''}`} onClick={this.clickComponent} id={card.uuid} style={_style}> |
| | | <div className={`main-search-edit-list ${card.wrap.float} ${showField ? 'show-field' : ''} mk-order-${card.wrap.searchSize || ''}`} onClick={this.clickComponent} id={card.uuid} style={_style}> |
| | | <FieldsComponent config={card} type="search" /> |
| | | <Switch checkedChildren="开" size="small" unCheckedChildren="关" defaultChecked={showField} onChange={this.onFieldChange} /> |
| | | <DragElement |
| | |
| | | title="搜索条件-编辑" |
| | | wrapClassName="mk-scroll-modal" |
| | | visible={visible} |
| | | width={850} |
| | | width={950} |
| | | maskClosable={false} |
| | | onOk={this.handleSubmit} |
| | | confirmLoading={sqlVerifing} |