A2Psychz.ts 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. import http from "@/utils/http";
  2. import { AppDispatch } from "..";
  3. /**
  4. * 获取 机房管理 表格列表(存到仓库)
  5. */
  6. export const A2_APIgetlist = (data: any) => {
  7. return async (dispatch: AppDispatch) => {
  8. const res = await http.post("cms/room/pageList", data);
  9. if (res.code === 0) {
  10. const obj = {
  11. list: res.data.records,
  12. total: res.data.total,
  13. };
  14. // console.log(123,obj);
  15. dispatch({ type: "A2/getList", payload: obj });
  16. }
  17. };
  18. };
  19. /**
  20. * 获取 机房管理 表格列表(导出表格)
  21. */
  22. export const A2_APIgetlistDerive = (data:any) => {
  23. return http.post("cms/room/pageList", data);
  24. };
  25. /**
  26. * 删除表格单个
  27. */
  28. export const A2_APIremoves = (id: number) => {
  29. return http.get(`cms/room/remove/${id}`);
  30. };
  31. /**
  32. * 新增/编辑
  33. */
  34. export const A2_APIadd = (data: any) => {
  35. return http.post("cms/room/save", data);
  36. };
  37. /**
  38. * 通过id获取详情
  39. */
  40. export const A2_APIgetInfo = (id:number) => {
  41. return http.get(`cms/room/detail/${id}`);
  42. };
  43. /**
  44. * 机房管理-站址地区下拉框
  45. */
  46. export const A2_APIgetCity = () => {
  47. return http.get('cms/room/getCity');
  48. };