From 7e5200a09b2c6282382ec8725220f5561de139f6 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 23 二月 2024 18:05:53 +0800 Subject: [PATCH] Merge branch 'develop' --- src/components/normalform/modalform/mkSelect/index.jsx | 15 +++++++++++++-- 1 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/components/normalform/modalform/mkSelect/index.jsx b/src/components/normalform/modalform/mkSelect/index.jsx index 92784fe..a1b4479 100644 --- a/src/components/normalform/modalform/mkSelect/index.jsx +++ b/src/components/normalform/modalform/mkSelect/index.jsx @@ -31,6 +31,17 @@ MKEmitter.addListener('mkFC', this.mkFormControl) } + UNSAFE_componentWillReceiveProps (nextProps) { + const { config } = this.state + + if (!is(fromJS(config.oriOptions), fromJS(nextProps.config.oriOptions))) { + this.setState({ + config: fromJS(nextProps.config).toJS(), + options: fromJS(nextProps.config.options).toJS() + }) + } + } + shouldComponentUpdate (nextProps, nextState) { return !is(fromJS(this.state), fromJS(nextState)) } @@ -148,8 +159,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