From 73083e2eef00c34c2db62ddea12baa6e44ba1dd6 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 08 二月 2024 00:31:07 +0800 Subject: [PATCH] 2024-02-08 --- src/tabviews/custom/components/table/edit-table/normalTable/mkPopSelect/index.jsx | 13 +++++++++---- 1 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/tabviews/custom/components/table/edit-table/normalTable/mkPopSelect/index.jsx b/src/tabviews/custom/components/table/edit-table/normalTable/mkPopSelect/index.jsx index 29e7463..d74157b 100644 --- a/src/tabviews/custom/components/table/edit-table/normalTable/mkPopSelect/index.jsx +++ b/src/tabviews/custom/components/table/edit-table/normalTable/mkPopSelect/index.jsx @@ -234,6 +234,7 @@ this.state = { value: props.defaultValue, + showValue: props.showValue, visible: false } } @@ -275,6 +276,10 @@ 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) => { @@ -284,7 +289,7 @@ 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) @@ -329,7 +334,7 @@ } this.props.onChange(values, '') - this.setState({value: ''}) + this.setState({value: '', showValue: ''}) if (config.$ctrl) { MKEmitter.emit('colBlur' + config.tableId, lineId, config.uuid) @@ -350,12 +355,12 @@ 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> -- Gitblit v1.8.0