

import { Form, Icon, Input, Button, Card, message, Checkbox } from 'antd';
const FormItem = Form.Item
const formItemLayout = {
    //布局
    labelCol: { span: 6 },
    wrapperCol: { span: 14 },

};
class AddForm extends React.Component {
    handleSubmit = e => {
        e.preventDefault();
        this.props.form.validateFields((err, values) => {
            if (!err) {
                console.log('Received values of form: ', values);
            }
        });
    };

    render() {
        const { getFieldDecorator } = this.props.form;
        return (
            <Form onSubmit={this.handleSubmit} className="login-form" {...formItemLayout}>
                <FormItem label="名称">
                    {getFieldDecorator('title', {
                        rules: [
                            { required: true, message: '请输入名称!' }
                        ]
                    })(
                        <Input />
                    )}
                </FormItem>
                <FormItem >
                    <Button type="primary" htmlType="submit" style={{ marginLeft: '14em', marginTop: '30px' }}>
                        新增
                    </Button>
                </FormItem>
            </Form>
        );
    }
}

export default Form.create({})(AddForm);