import { json } from "@utils/ajax"; import { GET_SEARCH_RESULT } from '@store/types/diagnosticSearch'; export const getSearchList = (val) => { if(val.trim() == ''){ const data = []; return (dispatch) => dispatch({ type: GET_SEARCH_RESULT, searchResult: [] }) } return (dispatch, getState) => { const state = getState(); json('/api/icss/retrieval/getTagInfos',{ type:'6', age:state.patInfo.message.patientAge, inputStr:val, sexType: state.patInfo.message.sex }) .then((res)=>{ const data = res.data.data; dispatch({ type: GET_SEARCH_RESULT, searchResult: data }) }) } };