| | |
| | | |
| | | this.state = { |
| | | value: props.defaultValue, |
| | | showValue: props.showValue, |
| | | visible: false |
| | | } |
| | | } |
| | |
| | | const { config, lineId } = this.props |
| | | |
| | | let values = {[config.field]: record.$$uuid} |
| | | let showValue = '' |
| | | if (config.showField) { |
| | | showValue = record[config.showField] || '' |
| | | } |
| | | |
| | | if (config.linkSubField) { |
| | | config.linkSubField.forEach((m, i) => { |
| | |
| | | |
| | | this.props.onChange(values, record.$$uuid) |
| | | |
| | | this.setState({visible: false, value: record.$$uuid}) |
| | | this.setState({visible: false, value: record.$$uuid, showValue}) |
| | | |
| | | if (config.$ctrl) { |
| | | MKEmitter.emit('colBlur' + config.tableId, lineId, config.uuid) |
| | |
| | | } |
| | | |
| | | this.props.onChange(values, '') |
| | | this.setState({value: ''}) |
| | | this.setState({value: '', showValue: ''}) |
| | | |
| | | if (config.$ctrl) { |
| | | MKEmitter.emit('colBlur' + config.tableId, lineId, config.uuid) |
| | |
| | | |
| | | render() { |
| | | const { autoFocus, BID, lineId, config } = this.props |
| | | const { value, visible } = this.state |
| | | const { showValue, value, visible } = this.state |
| | | |
| | | return <> |
| | | {autoFocus ? <div className="mk-pop-select-mask" onClick={this.trigger}></div> : null} |
| | | <div className="mk-pop-select-wrap" onClick={this.trigger}> |
| | | {value} |
| | | {showValue || value} |
| | | {value && !autoFocus ? <CloseCircleFilled onClick={this.clear} /> : null} |
| | | <TableOutlined onClick={this.trigger}/> |
| | | </div> |