A1Project.ts 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. import http from "@/utils/http";
  2. import { AppDispatch } from "..";
  3. /**
  4. * 获取列表
  5. */
  6. export const A1_APIgetList = (data: any) => {
  7. return async (dispatch: AppDispatch) => {
  8. const res = await http.post("cms/project/pageList", data);
  9. if (res.code === 0) {
  10. const obj = {
  11. list: res.data.records,
  12. total: res.data.total,
  13. };
  14. dispatch({ type: "A1/getList", payload: obj });
  15. }
  16. };
  17. };
  18. /**
  19. * 新增、编辑 项目
  20. */
  21. export const A1_APIaddProject = (data: any) => {
  22. return http.post("cms/project/save", data);
  23. };
  24. /**
  25. * 通过id获取项目详情
  26. */
  27. export const A1_APIgetInfoById = (id: number) => {
  28. return http.get(`cms/project/detail/${id}`);
  29. };
  30. /**
  31. * 通过id删除项目
  32. */
  33. export const A1_APIdelProject = (id: number) => {
  34. return http.get(`cms/project/remove/${id}`);
  35. };
  36. /**
  37. * 通过id获取下载列表
  38. */
  39. export const A1_APIgetDownList = (id: number) => {
  40. return http.get(`cms/inside/download/echoList/${id}`);
  41. };
  42. // -------------------------- 项目文件 --------------------------
  43. /**
  44. * 项目文件---------获取 左侧一级 写死目录
  45. */
  46. export const A1_APIOgetHardCoded = () => {
  47. return async (dispatch: AppDispatch) => {
  48. const res = await http.get("cms/item/getHardCoded");
  49. if (res.code === 0) {
  50. dispatch({ type: "A1/outLeftArr", payload: res.data });
  51. }
  52. };
  53. };
  54. /**
  55. * 项目文件---------新增、修改
  56. */
  57. export const A1_APIOadd = (data: any) => {
  58. return http.post("cms/item/save", data);
  59. };
  60. /**
  61. * 项目文件---------获取列表
  62. */
  63. export const A1_APIOgetList = (data: any) => {
  64. return async (dispatch: AppDispatch) => {
  65. const res = await http.post("cms/item/pageList", data);
  66. if (res.code === 0) {
  67. const obj = {
  68. list: res.data.records,
  69. total: res.data.total,
  70. };
  71. dispatch({ type: "A1/outTableArr", payload: obj });
  72. }
  73. };
  74. };
  75. /**
  76. * 项目文件---------批量下载
  77. */
  78. export const A1_APIOdownload = (ids: string | number) => {
  79. return http.get(`cms/item/download/${ids}`);
  80. };
  81. /**
  82. * 项目文件---------删除文件
  83. */
  84. export const A1_APIOdel = (id: number) => {
  85. return http.get(`cms/item/remove/${id}`);
  86. };
  87. /**
  88. * 项目文件---------批量上传点击确定
  89. */
  90. export const A1_APIOupFileIds = (ids: string) => {
  91. return http.post(`cms/item/update/display?fileId=${ids}`);
  92. };
  93. /**
  94. * 项目文件---------获取列表 ---- 文件移动的展示
  95. */
  96. export const A1_APIOgetListMove = (projectId: number, parentId: number) => {
  97. return http.post("cms/item/pageList", {
  98. pageNum: 0,
  99. pageSize: 99999,
  100. projectId,
  101. parentId,
  102. });
  103. };
  104. /**
  105. * 项目文件---------移动文件
  106. */
  107. export const A1_APIOmove = (id: number, parentId: number) => {
  108. return http.get(`cms/item/move/${id}/${parentId}`);
  109. };
  110. /**
  111. * 项目文件(内控文件)---------上传文件成功 还没有点确定 的时候的 真删除
  112. */
  113. export const A1_APIremoveSure = (fileIds: string[]) => {
  114. return http.post("cms/dict/delFile", { fileIds });
  115. };
  116. // -------------------------- 项目成员 --------------------------
  117. /**
  118. * 项目成员---------获取列表
  119. */
  120. export const A1_APIUgeiList = (projectId: number, val: string) => {
  121. return http.get(`cms/member/getList/${projectId}?searchKey=${val}`);
  122. };