gymnasiumBag.api.ts 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. import { defHttp } from '/@/utils/http/axios';
  2. enum Api {
  3. list = '/app/appSitePlace/queryUnfixedPageList',
  4. save = '/app/appSitePlace/savePack',
  5. edit = '/app/appSitePlace/editPack',
  6. deleteOne = '/app/appSitePlace/deleteUnfixed',
  7. detaile = '/app/appCourese/queryById',
  8. queryById = '/app/appSitePlace/queryPack',
  9. Business = '/app/appSitePlace/queryByOrgCode',
  10. getProject = '/app/appCategory/queryCategories',
  11. }
  12. export const list = (params) => defHttp.get({ url: Api.list, params });
  13. /**
  14. * 删除单个
  15. */
  16. export const deleteOne = (params, handleSuccess) => {
  17. return defHttp.delete({ url: Api.deleteOne, params }, { joinParamsToUrl: true }).then(() => {
  18. handleSuccess();
  19. });
  20. };
  21. /**
  22. * 保存或者更新
  23. * @param params
  24. */
  25. export const saveOrUpdate = (params, isUpdate) => {
  26. let url = isUpdate ? Api.edit : Api.save;
  27. return defHttp.post({ url: url, params });
  28. };
  29. export const getDetaile = (params) => {
  30. return defHttp.get({ url: Api.detaile, params });
  31. };
  32. export const queryById = (params) => {
  33. return defHttp.get({ url: Api.queryById, params });
  34. };
  35. /**
  36. * 营业名称
  37. * @param params type:0是学校,1是体育馆,不传查全部
  38. * @returns
  39. */
  40. export const Business = (params) => {
  41. return defHttp.post({ url: `${Api.Business}`, data: params });
  42. };
  43. export const getProject = () => {
  44. return defHttp.get({ url: Api.getProject });
  45. };