assistCheck.js 1003 B

1234567891011121314151617181920212223242526272829303132
  1. import axios from '@utils/ajax';
  2. import store from '@store';
  3. import { searchList } from '../actions/assistCheck';
  4. export const getSearchList = (val) => {
  5. if(val.trim() == ''){
  6. const data = [];
  7. return (dispatch) => dispatch(searchList(data,''));
  8. }
  9. let baseList = store.getState();
  10. let sex = baseList.patInfo.message.patientSex;
  11. return (dispatch) => {
  12. axios.json('/demo/retrieval/index',{
  13. "age": 10,
  14. "inputStr": val,
  15. "sex": 1,
  16. "type": '3'
  17. })
  18. .then((res)=>{
  19. const data = res.data.data;let curDate=[];
  20. let arr = data.pacsNames;
  21. for (var key in arr) {
  22. let obj = {}
  23. obj['uniqueName'] = arr[key];
  24. obj['detailName'] = arr[key];
  25. obj['name'] = arr[key];
  26. curDate.push(obj)
  27. }
  28. dispatch(searchList(curDate,val.trim()));
  29. })
  30. }
  31. };