From c98e45bfac25e9110ad0383faac54a54d98ea9d5 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 18 十一月 2021 20:47:04 +0800 Subject: [PATCH] 2021-11-18 --- src/menu/components/share/clockcomponent/index.jsx | 16 ++++++---------- 1 files changed, 6 insertions(+), 10 deletions(-) diff --git a/src/menu/components/share/clockcomponent/index.jsx b/src/menu/components/share/clockcomponent/index.jsx index 65549fc..c73e5ab 100644 --- a/src/menu/components/share/clockcomponent/index.jsx +++ b/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> ) -- Gitblit v1.8.0