import React from "react";
import { Form, Select, Input } from "antd";

export default function LoadFormConfig ({loadDataForm}) {
  return (
    <>
    <p style={{fontWeight: 600, borderLeft: '3px solid #1881DA', paddingLeft: '12px'}}>配置加载源源</p>
    <Form
      name="drawForm"
      form={loadDataForm}
      labelCol={{
        span: 2,
      }}
      wrapperCol={{
        span: 6,
      }}
      initialValues={{
        datasource_name: 'mysql'
      }}
    >
      <Form.Item
        label="选择数据源"
        name="datasource_name"
        rules={[
          {
            required: true,
            message: '请选择数据源!',
          },
        ]}
      >
        <Select options={[
          {label: 'My SQL', value: 'mysql'},
          {label: 'hive', value: 'hive'}
        ]} allowClear />
      </Form.Item>
      <Form.Item
        label="选择表"
        name="datasource_form"
        rules={[
          {
            required: true,
            message: '请选择表',
          },
        ]}
      >
        <Select options={[]} allowClear />
      </Form.Item>
      <Form.Item label="preSql" name="preSql" wrapperCol={{span: 10}}>
        <Input.TextArea rows={5}/>
      </Form.Item>
    </Form>
    </>
  )
}