import React, { Component } from 'react'; import { connect } from 'dva'; import { formatMessage, FormattedMessage } from 'umi-plugin-react/locale'; import { Form, Input, DatePicker, Select, Button, Card, InputNumber, Radio, Icon, Tooltip, } from 'antd'; import PageHeaderWrapper from './components/PageHeaderWrapper'; import styles from './style.less'; import { FormComponentProps } from 'antd/lib/form'; import { Dispatch } from 'redux'; const FormItem = Form.Item; const { Option } = Select; const { RangePicker } = DatePicker; const { TextArea } = Input; interface PAGE_NAME_UPPER_CAMEL_CASEProps extends FormComponentProps { submitting: boolean; dispatch: Dispatch; } @connect(({ loading }: { loading: { effects: { [key: string]: boolean } } }) => ({ submitting: loading.effects['BLOCK_NAME_CAMEL_CASE/submitRegularForm'], })) class PAGE_NAME_UPPER_CAMEL_CASE extends Component { handleSubmit = (e: React.FormEvent) => { const { dispatch, form } = this.props; e.preventDefault(); form.validateFieldsAndScroll((err, values) => { if (!err) { dispatch({ type: 'BLOCK_NAME_CAMEL_CASE/submitRegularForm', payload: values, }); } }); }; render() { const { submitting } = this.props; const { form: { getFieldDecorator, getFieldValue }, } = this.props; const formItemLayout = { labelCol: { xs: { span: 24 }, sm: { span: 7 }, }, wrapperCol: { xs: { span: 24 }, sm: { span: 12 }, md: { span: 10 }, }, }; const submitFormLayout = { wrapperCol: { xs: { span: 24, offset: 0 }, sm: { span: 10, offset: 7 }, }, }; return ( }>
}> {getFieldDecorator('title', { rules: [ { required: true, message: formatMessage({ id: 'BLOCK_NAME.title.required' }), }, ], })()} }> {getFieldDecorator('date', { rules: [ { required: true, message: formatMessage({ id: 'BLOCK_NAME.date.required' }), }, ], })( , )} }> {getFieldDecorator('goal', { rules: [ { required: true, message: formatMessage({ id: 'BLOCK_NAME.goal.required' }), }, ], })(