A7_1charity.ts 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. import http from "@/utils/http";
  2. import { AppDispatch } from "..";
  3. import { A7_1topValueType } from "@/pages/A7_1charity";
  4. /**
  5. * 获取 慈善堂 列表
  6. */
  7. export const A7_1_APIgetList = (data: any) => {
  8. return async (dispatch: AppDispatch) => {
  9. const res = await http.post("cms/charity/pageList", data);
  10. if (res.code === 0) {
  11. const obj = {
  12. list: res.data.records,
  13. total: res.data.total,
  14. };
  15. dispatch({
  16. type: "A7_1/getList",
  17. payload: obj,
  18. });
  19. }
  20. };
  21. };
  22. /**
  23. * 慈善堂 - 详情
  24. */
  25. export const A7_1_APIgetInfo = (id: number) => {
  26. return http.get(`cms/charity/detail/${id}`);
  27. };
  28. /**
  29. * 慈善堂 - 新增、编辑
  30. */
  31. export const A7_1_APIsave = (data: any) => {
  32. return http.post("cms/charity/save", data);
  33. };
  34. /**
  35. * 慈善堂 刊物 - 删除
  36. */
  37. export const A7_1_APIdel = (id: number) => {
  38. return http.get(`cms/charity/removes/${id}`);
  39. };
  40. /**
  41. * 获取主题列表
  42. */
  43. export const A7_1_APIgetListByTheme = (type: A7_1topValueType) => {
  44. return http.get(`cms/charityTopic/getList?type=${type}`);
  45. };
  46. /**
  47. * 主题 - 删除
  48. */
  49. export const A7_1_APIthemeDel = (id: number) => {
  50. return http.get(`cms/charityTopic/removes/${id}`);
  51. };
  52. /**
  53. * 主题 - 排序
  54. */
  55. export const A7_1_APIthemeSort = (id1: number, id2: number) => {
  56. return http.get(`cms/charityTopic/sort/${id1}/${id2}`);
  57. };
  58. /**
  59. * 主题 - 新增、编辑
  60. */
  61. export const A7_1_APIthemeSave = (data: any) => {
  62. return http.post("cms/charityTopic/save", data);
  63. };