import React from 'react';
import { connect } from 'dva';
import { routerRedux } from 'dva/router';
import { Card,Button, Form, Input, message, Row } from 'antd';
import { UploadEL } from '../../../components';
import styles from './inviteSupp.less';

const FormItem = Form.Item;

const formItemLayout = {
  labelCol: { span: 6 },
  wrapperCol: { span: 16 },
};

const colProps = {
  xs: 24,
  sm: 24,
  md: 24,
  lg: 24,
  xl: 24,
  style: {},
};

const ChangePW = ({
                    changePW,
                    dispatch,
                    form: {
                      setFieldsValue,
                      getFieldDecorator,
                      validateFieldsAndScroll,
                    },
                  }) => {
  function handleOk() {
    dispatch(routerRedux.push(`/register`));
  }

  return (
    <div>
      <Card title="邀请供应商"  id="file">
        <UploadEL api={'/dev/sfs-client/sfs/token'} dataKey={'rex'} listTypes={['text', 'picture', 'picture-card']} />

        <Form className={styles.form}>
          <FormItem label="供应商邮箱" {...formItemLayout}>
            {getFieldDecorator('from', {
              rules: [
                {
                  required: true,
                  message: '请输入旧密码',
                },
              ],
            })(<Input type="text" />)}
          </FormItem>
          <Row>
            <Button type="primary" onClick={handleOk} loading={null}>
              提交邀请
            </Button>
          </Row>
        </Form>
      </Card>
    </div>
  );
};

export default connect(({ changePW }) => ({ changePW }))(Form.create()(ChangePW));
