| | |
| | | state = { |
| | | dict: localStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, |
| | | visible: false, |
| | | loading: false |
| | | loading: false, |
| | | name: '' |
| | | } |
| | | |
| | | shouldComponentUpdate (nextProps, nextState) { |
| | |
| | | } |
| | | |
| | | trigger = () => { |
| | | const { config } = this.props |
| | | |
| | | this.setState({ |
| | | visible: true, |
| | | loading: false |
| | | loading: false, |
| | | name: window.GLOB.UserComponentMap.get(config.uuid) || config.name || '' |
| | | }) |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | render () { |
| | | const { visible, dict, loading } = this.state |
| | | const { visible, dict, loading, name } = this.state |
| | | |
| | | return ( |
| | | <div className="user-component-wrap"> |
| | |
| | | onCancel={this.cancel} |
| | | destroyOnClose |
| | | > |
| | | <UserForm dict={dict} inputSubmit={this.submit} wrappedComponentRef={(inst) => this.verifyRef = inst}/> |
| | | <UserForm dict={dict} name={name} inputSubmit={this.submit} wrappedComponentRef={(inst) => this.verifyRef = inst}/> |
| | | </Modal> |
| | | </div> |
| | | ) |