From c18f79e01a2705d34d5ac2923a26913dba07ea14 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期六, 03 八月 2024 16:04:18 +0800 Subject: [PATCH] 2024-08-03 --- src/tabviews/custom/components/table/edit-table/normalTable/mkPopSelect/index.jsx | 17 +++++++++++------ 1 files changed, 11 insertions(+), 6 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..6493202 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 @@ -84,8 +84,8 @@ // 娴嬭瘯绯荤粺鎵撳嵃鏌ヨ璇彞 if (window.GLOB.debugger === true) { - console.info(`/*${config.label} 鏁版嵁婧�*/\n` + sql.replace(/\n\s{6}/ig, '\n')) - DateCount && console.info(`/*${config.label} 鎬绘暟鏌ヨ*/\n` + DateCount.replace(/\n\s{6}/ig, '\n')) + window.mkInfo(`/*${config.label} 鏁版嵁婧�*/\n` + sql.replace(/\n\s{6}/ig, '\n')) + DateCount && window.mkInfo(`/*${config.label} 鎬绘暟鏌ヨ*/\n` + DateCount.replace(/\n\s{6}/ig, '\n')) } param.LText = Utils.formatOptions(sql, param.exec_type) @@ -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