From 4cc738e535d1a20701d206e12cf9de8cc5a01170 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期六, 01 六月 2024 15:24:12 +0800
Subject: [PATCH] Merge branch 'develop'

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

diff --git a/src/components/normalform/modalform/mkSelect/index.jsx b/src/components/normalform/modalform/mkSelect/index.jsx
index 840dd4a..abbd6ac 100644
--- a/src/components/normalform/modalform/mkSelect/index.jsx
+++ b/src/components/normalform/modalform/mkSelect/index.jsx
@@ -31,13 +31,11 @@
     MKEmitter.addListener('mkFC', this.mkFormControl)
   }
 
-  UNSAFE_componentWillReceiveProps (nextProps) {
-    const { config } = this.state
-
-    if (!is(fromJS(config.oriOptions), fromJS(nextProps.config.oriOptions))) {
+  UNSAFE_componentWillReceiveProps(nextProps) {
+    if (nextProps.config.timestamp && nextProps.config.timestamp !== this.state.config.timestamp) {
       this.setState({
         config: fromJS(nextProps.config).toJS(),
-        options: fromJS(nextProps.config.options).toJS()
+        options: fromJS(nextProps.config.options).toJS(),
       })
     }
   }
@@ -68,7 +66,7 @@
 
     const { config } = this.state
 
-    let options = config.oriOptions ? config.oriOptions.filter(option => option.ParentID === parentId) : []
+    let options = config.oriOptions ? config.oriOptions.filter(option => option.ParentID === parentId || option.ParentID === '') : []
     let val = options[0] ? options[0].value : ''
 
     this.setState({
@@ -159,8 +157,8 @@
         filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0}
         onChange={this.mutilselectChange}
       >
-        {options.map(option =>
-          <Select.Option key={option.value} disabled={option.disabled} value={option.value}>{option.label || option.text}</Select.Option>
+        {options.map((option, i) =>
+          <Select.Option key={i} disabled={option.disabled} value={option.value || option.field}>{option.label || option.text}</Select.Option>
         )}
       </Select>)
     }

--
Gitblit v1.8.0