server.js 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. import { creatRequest } from '../../utils/request.js';
  2. const requestList = {
  3. // 获取条件树
  4. conditions: {
  5. method: 'GET',
  6. url: 'common/conditions',
  7. // successMessage: '',
  8. // needLoading: false // 还有这两个参数,但不是必传的,默认loading
  9. },
  10. // 查核组列表
  11. checkGroupList: {
  12. method: 'POST',
  13. url: 'situation/checkGroupList',
  14. },
  15. // 查核地图列表
  16. checkDeptList: {
  17. method: 'POST',
  18. url: 'situation/checkDeptList',
  19. },
  20. // 地图新增单位树
  21. deptList: {
  22. method: 'GET',
  23. url: 'common/deptList',
  24. },
  25. // 地图新增选择返回新增单位
  26. addDeptList: {
  27. method: 'POST',
  28. url: 'situation/addDeptList',
  29. },
  30. // 情境新增保存
  31. savePOST: {
  32. method: 'POST',
  33. url: 'situation',
  34. successMessage: '保存成功!'
  35. },
  36. // 情境新增保存
  37. savePUT: {
  38. method: 'PUT',
  39. url: 'situation',
  40. successMessage: '编辑成功!'
  41. },
  42. // 情境配置的明细(出参同创建入参)
  43. detialConfig: {
  44. method: 'GET',
  45. url: 'situation/config',
  46. },
  47. // 获取情境类型列表
  48. getSituationTypes: {
  49. method: 'GET',
  50. url: 'common/getSituationTypes',
  51. },
  52. //获取分页模板数据
  53. getTemplates:{
  54. method: 'GET',
  55. url: 'situation/getPageTemplateList',
  56. }
  57. };
  58. export const commServer = (key, data) => {
  59. let obj = requestList[key];
  60. return creatRequest(obj, data);
  61. }