import {CONFIRN_CHECKBOX,CLEAR_CHECKBOX,SHOW_CHECKBOX,CHECKED,RADIO,NOSPECIAL} from '../types/checkBox';
import {SHOW_MIXBOX,CHECK_MIXBOX} from '../types/currentIll';
import {confirn,showCheckBox,checked,noSpecial} from '../actions/checkBox'
import {clearMix,radio,showMixCheckBox,confirnMix,mixChecked,mixNoSpecial} from '../actions/mixCheckBox'

const initState = {
  //showCheckBox:false,
  selectVal:[],//多选选中的值
  radioVals:[],//单选选中的值
  radioFlag:false,//解决点击单选状态不更新
  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
        }
      ],
  radioItems:[
    {
      id:0,
      type:'radio',
      name:1,
      items:[
        {
          id:11,
          prefix:'',
          showText:'',
          value:'听诊区未闻及明显心脏杂音',
          isSelect:false,
          hasDrop:true,
          disabled:false
        },
        {
          id:12,
          prefix:'',
          showText:'添加症状',
          isSelect:false,
          value:'阵发',
          hasDrop:true,
          disabled:false
        },
        {
          id:13,
          prefix:'',
          showText:'',
          value:'加重',
          isSelect:false,
          hasDrop:true,
          disabled:false
        },
        {
          id:14,
          prefix:'',
          showText:'添加病程变化',
          value:'间断',
          isSelect:false,
          hasDrop:false,
          disabled:false
        },
      ]
    },
    {
      id:1,
      type:'radio',
      name:2,
      items:[
        {
          id:21,
          prefix:'',
          showText:'',
          value:'收缩期收缩期收缩',
          isSelect:false,
          hasDrop:true,
          disabled:false
        },
        {
          id:22,
          prefix:'',
          showText:'未闻及',
          isSelect:false,
          value:'舒张期',
          hasDrop:true,
          disabled:false
        }
      ]
    },
    {
      id:2,
      type:'radio',
      name:3,
      items:[
        {
          id:31,
          prefix:'',
          showText:'',
          value:'收缩期收缩期收缩',
          isSelect:false,
          hasDrop:true,
          disabled:false
        },
        {
          id:32,
          prefix:'',
          showText:'添加症状',
          isSelect:false,
          value:'舒张期',
          hasDrop:true,
          disabled:false
        },
        {
          id:33,
          prefix:'',
          showText:'',
          value:'全期',
          isSelect:false,
          hasDrop:true,
          disabled:false
        }
      ]
    },
    {
      id:3,
      type:'radio',
      name:3,
      items:[
        {
          id:31,
          prefix:'',
          showText:'',
          value:'收缩期收缩期收缩',
          isSelect:false,
          hasDrop:true,
          disabled:false
        },
        {
          id:32,
          prefix:'',
          showText:'添加症状',
          isSelect:false,
          value:'舒张期',
          hasDrop:true,
          disabled:false
        },
        {
          id:33,
          prefix:'',
          showText:'',
          value:'全期',
          isSelect:false,
          hasDrop:true,
          disabled:false
        }
      ]
    },
    
      ],
  mixDatas:[
    {
      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 confirnMix(state,action);
    case CLEAR_CHECKBOX:
      return clearMix(state,action);
    case SHOW_MIXBOX:
      return showMixCheckBox(state,action);
    case CHECK_MIXBOX://点击复选框选项
      return mixChecked(state,action);
    case RADIO:
      return radio(state,action);
    case NOSPECIAL:
      return mixNoSpecial(state,action);
    default:
      return state;
  }
}