12345678910111213141516171819202122232425 |
- import axios from '@utils/ajax';
- import store from '@store';
- import { searchList } from '../actions/assistCheck';
- export const getSearchList = (val) => {
- if(val.trim() == ''){
- const data = [];
- return (dispatch) => dispatch(searchList(data));
- }
- let baseList = store.getState();
- let sex = baseList.patInfo.message.patientSex;
- return (dispatch) => {
- axios.json('/retrieval/getTagInfos',{
- type:'6',
- age:baseList.patInfo.message.patientAge,
- inputStr:val,
- sexType: sex == '男'?'1' : sex == '女'?'2':'3'
- })
- .then((res)=>{
- const data = res.data.data;
- dispatch(searchList(data));
- })
- }
- };
|