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


const createtypeRelevanceForm = (props) => {
    return (
        <Modal
            width={800}
            visible={props.createModalVisible}
            bodyStyle={{ padding: '32px 40px 48px' }}
            footer={null}
            onCancel={() => {
                props.onCancel();
            }}
            destroyOnClose
        >
            <Form
                layout="Vertical"
                labelCol={{ span: 6 }}
                initialValues={props.values}
                onFinish={props.onFinish}
                onCancel={props.onCancel}
            >
                <Form.Item name="id" hidden={true}>
                    <Input />
                </Form.Item>
                <Form.Item label='商品类别' name={'goodsSmallType'} rules={[{ required: true }]}  initialValue={props.values.goodsSmallType}>
                    <Select style={{ width: '300px' }}
                    >
                        {
                            (props.Support.allSmallType || []).map((item, index) => {
                                return (
                                    <Select.Option index={index} value={item.id} key={item.id}>
                                        {item.goodsType_Name}
                                    </Select.Option>
                                );
                            })

                        }
                    </Select>
                </Form.Item>
                <Form.Item label='做法类别' name={'makeTypeId'} rules={[{ required: true }]} initialValues={props.values.practiceTypeId}>
                    <Select style={{ width: '300px' }}
                    >
                        {
                            (props.Support.allType || []).map((item, index) => {
                                return (
                                    <Select.Option index={index} value={item.id} key={item.id}>
                                        {item.typeName}
                                    </Select.Option>
                                );
                            })

                        }
                    </Select>
                </Form.Item>
                {
                    ()=>{
                        if(props.domrelevanceType == 1){

                        }
                        if(props.domrelevanceType == 2){

                        }
                    }
                }
                <Form.Item>
                    <Button type="primary" htmlType="submit" >
                        保存
                    </Button>
                </Form.Item>
            </Form>
        </Modal>
    );
};

export default createtypeRelevanceForm;
