king
2024-06-07 8040a18c4b2a848d252bf01838f06c7aec1be9f3
src/components/normalform/modalform/mkSelect/index.jsx
@@ -1,4 +1,4 @@
import React, {Component} from 'react'
import React, { Component } from 'react'
import { is, fromJS } from 'immutable'
import { Select } from 'antd'
@@ -115,24 +115,7 @@
    const { value, config, options } = this.state
    if (config.type !== 'multiselect') {
      if (config.extendName) {
        return (
          <Select
            showSearch
            allowClear
            value={value}
            dropdownMatchSelectWidth={config.dropdown !== 'false'}
            filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0 ||
              option.props.extend.toLowerCase().indexOf(input.toLowerCase()) >= 0}
            onSelect={this.selectChange}
            onChange={(val) => val === undefined && this.selectChange('')}
          >
            {options.map((option, i) =>
              <Select.Option key={i} disabled={option.disabled} title={option.label || option.text} extend={option[config.extendName] || ''} value={option.value || option.field || ''}>{option.label || option.text}</Select.Option>
            )}
          </Select>
        )
      } else {
      if (config.joint) {
        return (
          <Select
            showSearch
@@ -142,13 +125,30 @@
            filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0}
            onSelect={this.selectChange}
            onChange={(val) => val === undefined && this.selectChange('')}
            getPopupContainer={() => document.getElementById('normal-form-field')}
          >
            {options.map((option, i) =>
              <Select.Option key={i} disabled={option.disabled} value={option.value || option.field || ''}>{option.label || option.text}</Select.Option>
              <Select.Option key={i} disabled={option.disabled} value={option.field || ''}>{`${option.label}(${option.field})`}</Select.Option>
            )}
          </Select>
        )
      }
      return (
        <Select
          showSearch
          allowClear
          value={value}
          dropdownMatchSelectWidth={config.dropdown !== 'false'}
          filterOption={(input, option) => (option.props.children + option.props.extend).toLowerCase().indexOf(input.toLowerCase()) >= 0}
          onSelect={this.selectChange}
          onChange={(val) => val === undefined && this.selectChange('')}
          getPopupContainer={() => document.getElementById('normal-form-field')}
        >
          {options.map((option, i) =>
            <Select.Option key={i} disabled={option.disabled} title={option.label || option.text} extend={config.extendName ? (option[config.extendName] || '') : ''} value={option.value || option.field || ''}>{option.label || option.text}</Select.Option>
          )}
        </Select>
      )
    } else {
      return (<Select
        showSearch
@@ -156,6 +156,7 @@
        defaultValue={value}
        filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0}
        onChange={this.mutilselectChange}
        getPopupContainer={() => document.getElementById('normal-form-field')}
      >
        {options.map((option, i) =>
          <Select.Option key={i} disabled={option.disabled} value={option.value || option.field}>{option.label || option.text}</Select.Option>