map.js 1.36 KB
Newer Older
ddcat1115's avatar
ddcat1115 committed
1 2 3 4 5 6 7 8 9 10 11 12
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',
    },
jim's avatar
jim committed
13 14 15 16 17 18
    rules: [
      {
        required: true,
        message: 'Please enter username!',
      },
    ],
ddcat1115's avatar
ddcat1115 committed
19 20 21 22 23 24 25 26 27
  },
  Password: {
    component: Input,
    props: {
      size: 'large',
      prefix: <Icon type="lock" className={styles.prefixIcon} />,
      type: 'password',
      placeholder: '888888',
    },
jim's avatar
jim committed
28 29 30 31 32 33
    rules: [
      {
        required: true,
        message: 'Please enter password!',
      },
    ],
ddcat1115's avatar
ddcat1115 committed
34 35 36 37 38 39
  },
  Mobile: {
    component: Input,
    props: {
      size: 'large',
      prefix: <Icon type="mobile" className={styles.prefixIcon} />,
40
      placeholder: 'mobile number',
ddcat1115's avatar
ddcat1115 committed
41
    },
jim's avatar
jim committed
42 43 44 45 46 47 48 49 50 51
    rules: [
      {
        required: true,
        message: 'Please enter mobile number!',
      },
      {
        pattern: /^1\d{10}$/,
        message: 'Wrong mobile number format!',
      },
    ],
ddcat1115's avatar
ddcat1115 committed
52 53 54 55 56 57
  },
  Captcha: {
    component: Input,
    props: {
      size: 'large',
      prefix: <Icon type="mail" className={styles.prefixIcon} />,
58
      placeholder: 'captcha',
ddcat1115's avatar
ddcat1115 committed
59
    },
jim's avatar
jim committed
60 61 62 63 64 65
    rules: [
      {
        required: true,
        message: 'Please enter Captcha!',
      },
    ],
ddcat1115's avatar
ddcat1115 committed
66 67 68 69
  },
};

export default map;