import React, { PureComponent } from 'react'; import { connect } from 'dva'; import { Form, Input, DatePicker, Select, Button, Card, InputNumber, Radio, Icon, Tooltip, } from 'antd'; import PageHeaderLayout from '../../layouts/PageHeaderLayout'; import styles from './style.less'; const FormItem = Form.Item; const { Option } = Select; const { RangePicker } = DatePicker; const { TextArea } = Input; @connect(state => ({ submitting: state.form.regularFormSubmitting, })) @Form.create() export default class BasicForms extends PureComponent { handleSubmit = (e) => { e.preventDefault(); this.props.form.validateFieldsAndScroll((err, values) => { if (!err) { this.props.dispatch({ type: 'form/submitRegularForm', payload: values, }); } }); } render() { const { submitting } = this.props; const { getFieldDecorator, getFieldValue } = this.props.form; 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: '请输入标题', }], })( )} {getFieldDecorator('date', { rules: [{ required: true, message: '请选择起止日期', }], })( )} {getFieldDecorator('goal', { rules: [{ required: true, message: '请输入目标描述', }], })(