From cc1a76df575c18f0d0ee96e8658461efdce3a918 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 17 一月 2023 18:01:01 +0800
Subject: [PATCH] 2023-01-17

---
 src/components/normalform/modalform/mkSelect/index.jsx |   48 ++++++++++++++++++++++++++++++++++--------------
 1 files changed, 34 insertions(+), 14 deletions(-)

diff --git a/src/components/normalform/modalform/mkSelect/index.jsx b/src/components/normalform/modalform/mkSelect/index.jsx
index 25c5984..92784fe 100644
--- a/src/components/normalform/modalform/mkSelect/index.jsx
+++ b/src/components/normalform/modalform/mkSelect/index.jsx
@@ -106,20 +106,40 @@
     const { value, config, options } = this.state
 
     if (config.type !== 'multiselect') {
-      return (
-        <Select
-          showSearch
-          allowClear
-          value={value}
-          filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0}
-          onSelect={this.selectChange}
-          onChange={(val) => val === undefined && this.selectChange('')}
-        >
-          {options.map(option =>
-            <Select.Option key={option.value || option.field} disabled={option.disabled} value={option.value || option.field}>{option.label || option.text}</Select.Option>
-          )}
-        </Select>
-      )
+      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 {
+        return (
+          <Select
+            showSearch
+            allowClear
+            value={value}
+            dropdownMatchSelectWidth={config.dropdown !== 'false'}
+            filterOption={(input, option) => option.props.children.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} value={option.value || option.field || ''}>{option.label || option.text}</Select.Option>
+            )}
+          </Select>
+        )
+      }
     } else {
       return (<Select
         showSearch

--
Gitblit v1.8.0