import {CONFIRN_CHECKBOX,CLEAR_CHECKBOX,SHOW_CHECKBOX,CHECKED,FIRST,THEN,NOSPECIAL} from '../types/checkBox';
import {confirn,clear,showCheckBox,checked,firstChoo,thenChoo,noSpecial} from '../actions/checkBox'

const initState = {
  showCheckBox:false,
  selectVal:[],
  isClear:false,
  type:null,
  firstC:false,
  firstArr:[],
  thenC:false,
  thenArr:[],
  change:null,
  noSpecial:false,
  noSpecialFlag:0,//0默认，1选中标签，2选中无殊
  showDrop:false,
  checks:[
        {
          id:1,
          name:'个人史无殊',
          value:'个人史无殊',
          isSelect:false,
          style:null,
          mutual:0 ,//互斥
          disabled:false,
          first:false,//初为
          then:false,//后为
          changeForT:false
        },
        {
          id:2,
          name:'出生地',
          value:'出生地',
          isSelect:false,
          style:null,
          mutual:1,
          disabled:false,
          first:false,
          then:false,
          changeForT:false
        },
        {
          id:3,
          name:'职业',
          value:'职业',
          isSelect:false,
          style:null,
          mutual:1,
          disabled:false,
          first:false,
          then:false,
          changeForT:false
        },
        {
          id:4,
          name:'烟酒嗜好',
          value:'烟酒嗜好',
          isSelect:false,
          style:null,
          mutual:1,
          disabled:false,
          first:false,
          then:false,
          changeForT:false
        },
        {
          id:5,
          name:'疫区拘留',
          value:'疫区拘留',
          isSelect:false,
          style:null,
          mutual:1,
          disabled:false,
          first:false,
          then:false,
          changeForT:false
        },
        {
          id:6,
          name:'疫区拘留11',
          value:'疫区拘留11',
          isSelect:false,
          style:null,
          mutual:1,
          disabled:false,
          first:false,
          then:false,
          changeForT:false
        },
        {
          id:7,
          name:'疫区拘留22',
          value:'疫区拘留22',
          isSelect:false,
          style:null,
          mutual:1,
          disabled:false,
          first:false,
          then:false,
          changeForT:false
        }
      ],
      datas:[
        {
          id:11,
          prefix:'',
          showText:'主诉通用特征',
          value:'反复',
          suffix:'',
          hasDrop:true,
          showDrop:false
        },
        {
          id:22,
          prefix:'',
          showText:'添加症状',
          suffix:'',
          hasDrop:true,
          showDrop:false
        },
        {
          id:33,
          prefix:'',
          showText:'主诉时间',
          suffix:'',
          hasDrop:true,
          showDrop:false
        },
        {
          id:44,
          prefix:'',
          showText:'添加病程变化',
          suffix:'',
          hasDrop:false,
          showDrop:false
        },
      ]
};

export default function (state = initState, action) {
    switch (action.type) {
    case CONFIRN_CHECKBOX:
      return confirn(state,action);
    case CLEAR_CHECKBOX:
      return clear(state,action);
    case SHOW_CHECKBOX:
      return showCheckBox(state,action);
    case CHECKED://点击复选框选项
      return checked(state,action);
    case FIRST:
      return firstChoo(state,action);
    case THEN:
      return thenChoo(state,action);
    case NOSPECIAL:
      return noSpecial(state,action);
    default:
      return state;
  }
}