api.js 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. import { $httpWithMsg } from "../../plugins/axios";
  2. import { QUESTION_API } from "@/constants/constants";
  3. // common select
  4. export const courseQueryApi = (name, enable) => {
  5. return $httpWithMsg.get(`${QUESTION_API}/course/query`, {
  6. params: {
  7. name,
  8. enable: enable || undefined,
  9. },
  10. });
  11. };
  12. // build paper
  13. export const buildPaperApi = (datas) => {
  14. // return $httpWithMsg.post(`${QUESTION_API}/paper/build`, datas);
  15. return Promise.resolve(datas);
  16. };
  17. // export const questionGroupStructListApi = (datas) => {
  18. // return $httpWithMsg.post(`${QUESTION_API}/paper/build`, datas);
  19. // };
  20. import folderPropStruct from "./datas/folderPropStruct.json";
  21. export const questionGroupStructListApi = (datas) => {
  22. return Promise.resolve({ data: folderPropStruct, filter: datas });
  23. };
  24. // edit paper
  25. export const paperDetailInfoApi = (paperId) => {
  26. return $httpWithMsg.post(`${QUESTION_API}/paper/${paperId}`, {});
  27. };
  28. export const paperSaveApi = (paper) => {
  29. return $httpWithMsg.post(`${QUESTION_API}/paper`, paper);
  30. };
  31. export const paperDeleteApi = (paperId) => {
  32. return $httpWithMsg.delete(`${QUESTION_API}/paper/${paperId}`, {});
  33. };
  34. // paper-info
  35. export const paperAuditInfoApi = ({ paperId, curPage, pageSize }) => {
  36. return $httpWithMsg.get(
  37. `${QUESTION_API}/paper/audit/page/${curPage}/${pageSize}`,
  38. {
  39. params: {
  40. paperId,
  41. },
  42. }
  43. );
  44. };
  45. export const paperBlueInfoApi = ({ paperId, coursePropertyId, rootOrgId }) => {
  46. return $httpWithMsg.get(`${QUESTION_API}/paper/blue`, {
  47. params: {
  48. id: paperId,
  49. coursePropertyId,
  50. rootOrgId,
  51. },
  52. });
  53. };
  54. export const paperQtypeInfoApi = ({ paperId, type }) => {
  55. return $httpWithMsg.get(`${QUESTION_API}/paper/question/type`, {
  56. params: {
  57. id: paperId,
  58. type,
  59. },
  60. });
  61. };
  62. export const paperBaseInfoApi = ({ paperId }) => {
  63. return $httpWithMsg.get(`${QUESTION_API}/paper/basic/composition`, {
  64. params: {
  65. id: paperId,
  66. },
  67. });
  68. };
  69. export const paperDetailUpdateApi = (paperId, datas) => {
  70. return $httpWithMsg.post(
  71. `${QUESTION_API}/updatePaperDetail/${paperId}`,
  72. datas
  73. );
  74. };
  75. export const paperDetailMoveApi = ({ paperId, detailId, vector }) => {
  76. return $httpWithMsg.put(
  77. `${QUESTION_API}/paperDetail/${paperId}/${detailId}/${vector}`,
  78. {}
  79. );
  80. };
  81. export const paperDetailDeleteApi = ({ paperId, detailId }) => {
  82. return $httpWithMsg.delete(
  83. `${QUESTION_API}/paperDetail/${paperId}/${detailId}`,
  84. {}
  85. );
  86. };
  87. export const paperQuestionMoveApi = ({ detailId, unitid, vector }) => {
  88. return $httpWithMsg.put(
  89. `${QUESTION_API}/paperDetailUnit/${detailId}/${unitid}/${vector}`,
  90. {}
  91. );
  92. };
  93. export const paperQuestionDeleteApi = (unitid) => {
  94. return $httpWithMsg.delete(`${QUESTION_API}/paperDetailUnit/${unitid}`, {});
  95. };
  96. export const paperQuestionUnitDeleteApi = ({ unitid, questionId }) => {
  97. return $httpWithMsg.delete(
  98. `${QUESTION_API}/paper/deleteQuestion/${unitid}/${questionId}`,
  99. {}
  100. );
  101. };
  102. // audit-paper
  103. export const auditPaperWaitPageListApi = (datas) => {
  104. return $httpWithMsg.get(`${QUESTION_API}/paper/audit/page`, {
  105. params: datas,
  106. });
  107. };
  108. export const auditPaperAuditedPageListApi = (datas) => {
  109. return $httpWithMsg.get(`${QUESTION_API}/paper/audit/page`, {
  110. params: datas,
  111. });
  112. };
  113. export const auditPaperApplyPageListApi = (datas) => {
  114. return $httpWithMsg.get(`${QUESTION_API}/paper/audit/page`, {
  115. params: datas,
  116. });
  117. };
  118. export const auditPaperApi = (datas) => {
  119. // auditResult,auditRemark,paperIds
  120. return $httpWithMsg.post(`${QUESTION_API}/paper/audit`, datas);
  121. };