import React, { useState, useEffect } from 'react';
import { Modal, Form, Input, Button } from 'antd';


const CreateTypeForm = (props) => {
    const [form] = Form.useForm();
    form.setFieldsValue(props.values)
    return (
        <Modal
            width={350}
            visible={props.createModalVisible}
            bodyStyle={{ padding: '42px 40px 48px 45px' }}
            footer={null}
            onCancel={() => {
                props.onCancel();
            }}
            destroyOnClose={true}
        >
            <Form
                layout="Vertical"
                labelCol={{ span: 6 }}
                onFinish={props.onFinish}
                onCancel={props.onCancel}
                form={form}
            >
                <Form.Item name="id" hidden={true}>
                    <Input />
                </Form.Item>
                <Form.Item label='分类名称' name={'typeName'} >
                    <Input></Input>
                </Form.Item>
                <Form.Item>
                    <Button type="primary" htmlType="submit" >
                        保存
                    </Button>
                </Form.Item>
            </Form>
        </Modal>
    );
};

export default CreateTypeForm;