// @flow
import {
  PROGRESS,
  POLICY_PROGRESS,
  INSURE_YEAR_TITLE,
  DATE_RANGE,
  INSURE_YEAR,
  GRAY_LABEL,
  TEXT_INPUT,
  APPLICANT_TITLE,
  APPLICANT_NAME,
  APPLICANT_ID_TYPE,
  APPLICANT_ID,
  APPLICANT_BIRTHDAY,
  APPLICANT_GENDER,
  APPLICANT_MOBILE,
  APPLICANT_EMAIL,
  INSURED_TITLE,
  INSURED_NAME,
  INSURED_ID_TYPE,
} from './keys';


export default {
  layout: {
    [POLICY_PROGRESS]: {// 组件的唯一标识，用来串联 layout, rules
      type: PROGRESS, // 组件类型
      data: [],
      index: 0,
    },
    [APPLICANT_TITLE]: {// 组件的唯一标识，用来串联 layout, rules
      type: GRAY_LABEL, // 组件类型
      text: '投保人信息', // 标题
    },
    [APPLICANT_NAME]: {
      type: TEXT_INPUT,
      text: '姓名', //标题
      value: '',
      onEndEditing: () => {
      }, //编辑完成
      mask: false,
      editable: true,
    },
    [APPLICANT_ID_TYPE]: {
      type: TEXT_INPUT,
      text: '证件类型', //标题
      value: '',
      onEndEditing: () => {
      }, //编辑完成
      mask: false,
      editable: true,
    },
    [APPLICANT_ID]: {
      type: TEXT_INPUT,
      text: '证件号码', //标题
      value: '',
      onEndEditing: () => {
      }, //编辑完成
      mask: false,
      editable: true,
    },
    [APPLICANT_BIRTHDAY]: {
      type: TEXT_INPUT,
      text: '出生日期', //标题
      value: '',
      onEndEditing: () => {
      }, //编辑完成
      mask: false,
      editable: true,
    },
    [APPLICANT_GENDER]: {
      type: TEXT_INPUT,
      text: '性别', //标题
      value: '',
      onEndEditing: () => {
      }, //编辑完成
      mask: false,
      editable: true,
    },
    [APPLICANT_MOBILE]: {
      type: TEXT_INPUT,
      text: '手机号码', //标题
      value: '',
      onEndEditing: () => {
      }, //编辑完成
      mask: false,
      editable: true,
    },
    [APPLICANT_EMAIL]: {
      type: TEXT_INPUT,
      text: '电子邮箱', //标题
      value: '',
      onEndEditing: () => {
      }, //编辑完成
      mask: false,
      editable: true,
    },
    [INSURED_TITLE]: {
      type: GRAY_LABEL, // 组件类型
      text: '被保人信息', //标题
    },
    [INSURED_NAME]: {
      type: TEXT_INPUT,
      text: '姓名', //标题
      value: '',
      onEndEditing: () => {
      }, //编辑完成
      mask: false,
      editable: true,
    },
    [INSURED_ID_TYPE]: {
      type: TEXT_INPUT,
      text: '证件类型', //标题
      value: '',
      onEndEditing: () => {
      }, //编辑完成
      mask: false,
      editable: true,
    },
    [INSURE_YEAR_TITLE]: {
      type: GRAY_LABEL,
      text: '承保信息',
    },
    [INSURE_YEAR]: {
      type: DATE_RANGE,
      text: '保险期限',
      begin: '',
      end: '',
    },
  },
  rules: {
    [INSURE_YEAR]: {
      range: [],
    },
  },
  keys: [POLICY_PROGRESS, APPLICANT_TITLE, APPLICANT_NAME, APPLICANT_ID_TYPE, APPLICANT_ID,
    APPLICANT_BIRTHDAY, APPLICANT_GENDER, APPLICANT_MOBILE, APPLICANT_EMAIL, INSURED_TITLE,
    INSURED_NAME, INSURED_ID_TYPE, INSURE_YEAR_TITLE, INSURE_YEAR],
};
