import { SELECT_DRUG, SET_TREAT_INFO, SET_OTHER_DRUG, SET_DRUG_INFO, CLEAR_DRUG_INFO,SHOW_TREAT, HIDE_TREAT, CLEAR_TREAT, SHOW_DRUG_INFO, HIDE_DRUG_INFO, SET_GENERAL_TREAT, SET_TREATMENT, SET_SURGERY_TREAT, SET_RECOMMEND_BASIC, SET_DRUG_INFO_LIST,IS_FIRST_MAIN_DIAG,CLEAR_FIRST_MAIN_DIAG } from '../types/treat' import { selectDrug, setTreatInfo, setOtherDrug, setDrugInfo, clearDrugInfo, showTreat, hideTreat, clearTreat, showDrugInfo, hideDrugInfo, setTreatment, setGeneralTreat, setSurgeryTreat, setRecommendBasic, setDrugInfoList, isFirstMainDiag,clearFirstMainDiag } from '../actions/treat' const initState = { show: false, //治疗方案显示隐藏 showDrugInfo: false, //药品信息显示隐藏 isFirstMainDiag: true, //是否为第一次主诊断开单 generalTreat: '', surgeryTreat: '', treatment: [], // treatment:[ // { // id:1, // name:"支气管扩张剂", // hasInstroduce:true, // drugs:[ // { // id:2, // name:"多索茶碱", // rate:"50%", // isShow:"1", //1展示,0不展示 // forbidden:"0:正常,1:慎用,2:禁忌", // hasInstroduce:true, // selected: false // }, // { // id:3, // name:"二羟丙茶碱", // rate:"50%", // isShow:"0", // forbidden:"0:正常,1:慎用,2:禁忌", // hasInstroduce:false, // selected: false // }, // { // id:4, // name:"二羟丙茶碱11", // rate:"50%", // isShow:"1", // forbidden:"0:正常,1:慎用,2:禁忌", // hasInstroduce:false, // selected: false // } // ] // }, // { // id:5, // name:"支气管扩张剂2", // hasInstroduce:true, // drugs:[ // { // id:6, // name:"多索茶碱2", // rate:"50%", // isShow:"1", //1展示,0不展示 // forbidden:"0:正常,1:慎用,2:禁忌", // hasInstroduce:false, // selected: false // }, // { // id:7, // name:"二羟丙茶碱2", // rate:"50%", // isShow:"0", // forbidden:"0:正常,1:慎用,2:禁忌", // hasInstroduce:true, // selected: false // } // ] // } // ], lastTreat: { commonDisMedica: [ { medicitionName: '泮托拉唑', id: 145 }, { medicitionName: '奥美拉唑', id: 341 } ], chronicDisMedica: [ { medicitionName: '兰索拉唑', id: 342 }, { medicitionName: '山莨菪碱', id: 344 } ], }, adversReactionList:[ { id: 40772, name: '低血糖反应', tagName: '低血糖反应', showInfo: '0', controlType: 2, details: [ { name: "无", value: 0 }, { name: "偶尔", value: 0 }, { name: "频", value: 0 } ] }, { id: 40773, name: '胃肠道不良反应', tagName: '胃肠道不良反应', showInfo: '0', controlType: 2, details: [ { name: "腹胀 ", value: 0 }, { name: "厌食", value: 0 }, { name: "嗳气", value: 0 }, { name: "恶心", value: 0 }, { name: "呕吐", value: 0 } ] } ], treatDesc:{ title: '药品推荐', } } // const initTreat = { // show:false, // drugTreat:[ // { // type:'支气管扩张剂', // druglist:{ // common:[ // { // name: '多索茶碱', // rate: '80%', // desc: ['这是多索茶碱'], // select: false, // }, // { // name: '二羟丙茶碱', // rate: '60%', // desc: ['这是二羟丙茶碱'], // select: false, // } // ], // basic: [ // '注意休息,进食富有营养及维生素的流质或半流质食物', // '发热病人注意体液的补充,预防脱水', // ' 有发绀或低氧血症时,应吸入氧气' // ], // otherRecommend: [ // { // type: '化痰药(粘液溶解药)', // drugList: [ // { // name: '氨溴索', // rate: '80%' // } // ] // }, // { // type: '糖皮质激素类', // drugList: [ // { // name: '甲泼尼龙', // rate: '80%' // } // ] // }, // { // type: '抗胃酸药(质子泵抑制剂)', // drugList: [ // { // name: '泮托拉唑', // rate: '80%' // } // ] // } // ] // } // }, // { // type:'抗生素类(喹诺酮类!)', // druglist:{ // common:[ // { // name: '左氧氟沙星', // rate: '80%', // desc: '', // select: false // }, // { // name: '莫西沙星', // rate: '60%', // desc: '', // select: false // } // ], // basic: [ // ], // otherRecommend: [ // ] // } // }], // treatDesc:{ // title: '', // basic:[], // otherRecommend: [], // drugDesc:[], // } // } export default function(state=initState, action){ switch(action.type) { case SELECT_DRUG: return selectDrug(state, action); case SET_OTHER_DRUG: return setOtherDrug(state, action); case SET_DRUG_INFO: return setDrugInfo(state, action); case SHOW_TREAT: return showTreat(state, action); case HIDE_TREAT: return hideTreat(state, action); case CLEAR_TREAT: return clearTreat(state, action); case SET_TREATMENT: return setTreatment(state, action); case SET_GENERAL_TREAT: return setGeneralTreat(state, action); case SET_SURGERY_TREAT: return setSurgeryTreat(state, action); case SET_RECOMMEND_BASIC: return setRecommendBasic(state, action); case SHOW_DRUG_INFO: return showDrugInfo(state, action); case HIDE_DRUG_INFO: return hideDrugInfo(state, action); case SET_TREAT_INFO: return setTreatInfo(state, action); case CLEAR_DRUG_INFO: return clearDrugInfo(state, action); case SET_DRUG_INFO_LIST: return setDrugInfoList(state, action); case IS_FIRST_MAIN_DIAG: return isFirstMainDiag(state, action) case CLEAR_FIRST_MAIN_DIAG: return clearFirstMainDiag(state, action) default: return state } }