king
2024-08-03 c18f79e01a2705d34d5ac2923a26913dba07ea14
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>