medicalInfo.js 662 B

12345678910111213141516171819202122232425262728
  1. import { json } from "@utils/ajax";
  2. import { GET_SEARCH_RESULT } from '@store/types/medicalInfo';
  3. export const getSearchList = (val) => {
  4. if(val.trim() == ''){
  5. const data = [];
  6. return (dispatch) => dispatch({
  7. type: GET_SEARCH_RESULT,
  8. searchResult: []
  9. })
  10. }
  11. return (dispatch, getState) => {
  12. json('/retrieval/getStaticKnowledge',{
  13. inputStr:val,
  14. inputIds:[]
  15. })
  16. .then((res)=>{
  17. const data = res.data.data;
  18. dispatch({
  19. type: GET_SEARCH_RESULT,
  20. searchResult: data
  21. })
  22. })
  23. }
  24. };