king
2023-11-27 aa53227bc006816a30258c6390084aa74defb4d1
src/components/normalform/modalform/mkRadio/index.jsx
@@ -19,10 +19,22 @@
  componentDidMount () {
    MKEmitter.addListener('mkFP', this.mkFormHandle)
    MKEmitter.addListener('mkFC', this.mkFormControl)
  }
  shouldComponentUpdate (nextProps, nextState) {
    return !is(fromJS(this.state), fromJS(nextState))
  }
  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()
      })
    }
  }
  componentWillUnmount () {
@@ -30,6 +42,16 @@
      return
    }
    MKEmitter.removeListener('mkFP', this.mkFormHandle)
    MKEmitter.removeListener('mkFC', this.mkFormControl)
  }
  mkFormControl = (type, field, value) => {
    if (field !== this.props.config.field) return
    if (type === 'input') {
      this.setState({value})
      this.props.onChange(value, {})
    }
  }
  mkFormHandle = (field, parentId) => {
@@ -45,7 +67,7 @@
      value: val
    })
    this.props.onChange(val)
    this.props.onChange(val, {})
    config.linkFields && config.linkFields.forEach((m, i) => {
      setTimeout(() => {