import axios from '@utils/ajax';

import { initHistory } from '@store/actions/historyTemplates';
import store from '@store';

export const initItemList = (item) => {
    let baseList = store.getState();
    // let whichSign = baseList.typeConfig.typeConfig;
    let state = baseList.patInfo.message;
    const param = {
      "hospitalId": state.hospitalId,
      "patientId": state.patientId,
      "disName":item?item.name : 'dis',
      "disType":item?1:0
    }
    /*return (dispatch) => {
        axios.json('/inquiryInfo/hisInquirys',param).then((res)=>{
            const data =res.data;
            if(data.code == 0){
                dispatch(initHistory(data.data));
            }else{
                console.log(data)
            }
        })
    }*/
    return axios.json('/inquiryInfo/hisInquirys',param);
};

export function setInitHistory(data){
  return (dispatch) => {
    dispatch(initHistory(data));
  }
}
