king
2021-11-18 c98e45bfac25e9110ad0383faac54a54d98ea9d5
src/menu/components/share/clockcomponent/index.jsx
@@ -10,14 +10,12 @@
class ClockComponent extends Component {
  static propTpyes = {
    btnlog: PropTypes.array,
    updateConfig: PropTypes.func
  }
  state = {
    dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS,
    visible: false,
    timer: '',
    visible: false
  }
  shouldComponentUpdate (nextProps, nextState) {
@@ -25,11 +23,8 @@
  }
  trigger = () => {
    const { config } = this.props
    this.setState({
      visible: true,
      timer: config.timer || ''
      visible: true
    })
  }
@@ -40,12 +35,13 @@
      this.setState({
        visible: false
      })
      this.props.updateConfig({...config, timer: res.timer})
      this.props.updateConfig({...config, timer: res.timer, clearField: res.clearField || '', clearValue: res.clearValue || ''})
    })
  }
  render () {
    const { visible, loading, timer } = this.state
    const { config } = this.props
    const { visible, loading } = this.state
    return (
      <div className="clock-component-wrap">
@@ -60,7 +56,7 @@
          onCancel={() => this.setState({ visible: false })}
          destroyOnClose
        >
          <ClockForm timer={timer} inputSubmit={this.submit} wrappedComponentRef={(inst) => this.verifyRef = inst}/>
          <ClockForm config={config} inputSubmit={this.submit} wrappedComponentRef={(inst) => this.verifyRef = inst}/>
        </Modal>
      </div>
    )