king
2022-10-12 53b9fb93d0376eb02bb996935f1720b4e95cd897
src/components/normalform/index.jsx
@@ -6,7 +6,6 @@
import zhCN from '@/locales/zh-CN/model.js'
import enUS from '@/locales/en-US/model.js'
import ModalForm from './modalform'
import './index.scss'
class NormalFormComponent extends Component {
  static propTpyes = {
@@ -24,7 +23,7 @@
  }
  shouldComponentUpdate (nextProps, nextState) {
    return !is(fromJS(this.state), fromJS(nextState))
    return !is(fromJS(this.state), fromJS(nextState)) || !is(fromJS(this.props.children), fromJS(nextProps.children))
  }
  trigger = () => {
@@ -55,13 +54,19 @@
    })
  }
  cancel = () => {
    this.setState({ visible: false })
    this.props.cancel && this.props.cancel()
  }
  render () {
    const { title, width, children } = this.props
    const { title, width, children, double } = this.props
    const { visible, dict, formlist } = this.state
    return (
      <div className="normal-form-wrap">
        <span onClick={this.trigger}>{children}</span>
      <>
        {!double ? <span onClick={this.trigger}>{children}</span> : <span onDoubleClick={this.trigger}>{children}</span>}
        <Modal
          wrapClassName="popview-modal"
          title={title}
@@ -70,7 +75,7 @@
          maskClosable={false}
          okText={dict['model.confirm']}
          onOk={this.submit}
          onCancel={() => { this.setState({ visible: false }) }}
          onCancel={this.cancel}
          destroyOnClose
        >
          <ModalForm
@@ -79,7 +84,7 @@
            wrappedComponentRef={(inst) => this.Ref = inst}
          />
        </Modal>
      </div>
      </>
    )
  }
}