import React, { Component } from 'react';
import { connect } from 'dva';
import { Form, Input, Button, Checkbox } from 'antd';
import { UserOutlined, LockOutlined } from '@ant-design/icons';

import styles from './style.less';

@connect(({ BLOCK_NAME_CAMEL_CASE }) => BLOCK_NAME_CAMEL_CASE)
class Page extends Component {
  componentDidMount() {
    const { dispatch } = this.props;
    dispatch({
      type: 'BLOCK_NAME_CAMEL_CASE/fetch',
    });
  }
  onFinish = (values) => {
    console.log(values)
  }
  render() {
    const { text } = this.props;
    return (
      <div className={styles.container}>
        <div className={styles.login_block}>
          <img className={styles.bg_img_sub1} src="http://hropublic.oss-cn-beijing.aliyuncs.com/workai-blocks/img/login-sub1.png" alt="" />
          <div className={styles.login_wrap}>
            <Form
              name="normal_login"
              className="login-form"
              initialValues={{ remember: true }}
              onFinish={this.onFinish}
            >
              <Form.Item
                name="username"
                rules={[{ required: true, message: 'Please input your Username!' }]}
              >
                <Input placeholder="Username" />
              </Form.Item>
              <Form.Item
                name="password"
                rules={[{ required: true, message: 'Please input your Password!' }]}
              >
                <Input
                  prefix={<LockOutlined className="site-form-item-icon" />}
                  type="password"
                  placeholder="Password"
                />
              </Form.Item>
              <Form.Item>
                <Form.Item name="remember" valuePropName="checked" noStyle>
                  <Checkbox>记住账号</Checkbox>
                </Form.Item>

                <a className="login-form-forgot" href="">
                  忘记密码
        </a>
              </Form.Item>

              <Form.Item>
                <Button type="primary" htmlType="submit" className={styles.login_form_button}>
                  登录
        </Button>
         <a href="">现在去注册!</a>
              </Form.Item>
            </Form>
          </div>
        </div>
      </div>
    );
  }
}

export default Page;