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