map.js 1.24 KB
Newer Older
ddcat1115's avatar
ddcat1115 committed
1 2 3 4 5 6 7 8 9 10 11 12 13
import React from 'react';
import { Input, Icon } from 'antd';
import styles from './index.less';

const map = {
  UserName: {
    component: Input,
    props: {
      size: 'large',
      prefix: <Icon type="user" className={styles.prefixIcon} />,
      placeholder: 'admin',
    },
    rules: [{
14
      required: true, message: 'Please enter username!',
ddcat1115's avatar
ddcat1115 committed
15 16 17 18 19 20 21 22 23 24 25
    }],
  },
  Password: {
    component: Input,
    props: {
      size: 'large',
      prefix: <Icon type="lock" className={styles.prefixIcon} />,
      type: 'password',
      placeholder: '888888',
    },
    rules: [{
26
      required: true, message: 'Please enter password!',
ddcat1115's avatar
ddcat1115 committed
27 28 29 30 31 32 33
    }],
  },
  Mobile: {
    component: Input,
    props: {
      size: 'large',
      prefix: <Icon type="mobile" className={styles.prefixIcon} />,
34
      placeholder: 'mobile number',
ddcat1115's avatar
ddcat1115 committed
35 36
    },
    rules: [{
37
      required: true, message: 'Please enter mobile number!',
ddcat1115's avatar
ddcat1115 committed
38
    }, {
39
      pattern: /^1\d{10}$/, message: 'Wrong mobile number format!',
ddcat1115's avatar
ddcat1115 committed
40 41 42 43 44 45 46
    }],
  },
  Captcha: {
    component: Input,
    props: {
      size: 'large',
      prefix: <Icon type="mail" className={styles.prefixIcon} />,
47
      placeholder: 'captcha',
ddcat1115's avatar
ddcat1115 committed
48 49
    },
    rules: [{
50
      required: true, message: 'Please enter Captcha!',
ddcat1115's avatar
ddcat1115 committed
51 52 53 54 55
    }],
  },
};

export default map;