server.js 747 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. import { creatRequest } from '../../utils/request.js';
  2. const requestList = {
  3. //计划列表
  4. planList:{
  5. method:'GET',
  6. url: 'plan/list'
  7. },
  8. //分配单位查核人员
  9. batchDistribute:{
  10. method:'POST',
  11. url: 'plan/batchDistribute'
  12. },
  13. //删除计划外查核
  14. delOutofPlan:{
  15. method:'POST',
  16. url: 'plan/delCheckTask'
  17. }
  18. };
  19. export const commServer = ({ key, data }) => {
  20. let obj = requestList[key];
  21. if(key=='delOutofPlan'){
  22. return creatRequest({
  23. method:'POST',
  24. url: `plan/delCheckTask?checkId=${data}`
  25. },{});
  26. }
  27. if(key=='planList'){
  28. return creatRequest({
  29. method:'GET',
  30. url: `plan/list?situationId=${data.situationId}&type=${data.type}`
  31. });
  32. }
  33. return creatRequest(obj, data);
  34. }