From d59f518f466274b2caeb2e01c10c92deafe7c93b Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期三, 09 二月 2022 11:48:29 +0800 Subject: [PATCH] 2022-02-09 --- src/menu/components/share/clockcomponent/index.jsx | 24 +++++++++--------------- 1 files changed, 9 insertions(+), 15 deletions(-) diff --git a/src/menu/components/share/clockcomponent/index.jsx b/src/menu/components/share/clockcomponent/index.jsx index 65549fc..25da4eb 100644 --- a/src/menu/components/share/clockcomponent/index.jsx +++ b/src/menu/components/share/clockcomponent/index.jsx @@ -1,23 +1,19 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' import { is, fromJS } from 'immutable' -import { Icon, Modal } from 'antd' +import { Modal } from 'antd' +import { ClockCircleOutlined } from '@ant-design/icons' -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 +21,8 @@ } trigger = () => { - const { config } = this.props - this.setState({ - visible: true, - timer: config.timer || '' + visible: true }) } @@ -40,16 +33,17 @@ 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"> - <Icon type="clock-circle" title="瀹氭椂鍣�" onClick={this.trigger} /> + <ClockCircleOutlined title="瀹氭椂鍣�" onClick={this.trigger} /> <Modal title="瀹氭椂鍣ㄨ缃�" visible={visible} @@ -60,7 +54,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