king
2021-12-19 9ee3d1f9a09a865188baffdffb85f6ad329c7b09
src/menu/components/share/clockcomponent/index.jsx
@@ -3,21 +3,16 @@
import { is, fromJS } from 'immutable'
import { Icon, Modal } from 'antd'
import zhCN from '@/locales/zh-CN/model.js'
import enUS from '@/locales/en-US/model.js'
import ClockForm from './settingform'
import './index.scss'
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 +20,8 @@
  }
  trigger = () => {
    const { config } = this.props
    this.setState({
      visible: true,
      timer: config.timer || ''
      visible: true
    })
  }
@@ -40,12 +32,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 +53,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>
    )