api.js 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  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, mode) => {
  14. return $httpWithMsg.post(`${QUESTION_API}/gen/paper/${mode}`, datas);
  15. };
  16. // export const questionGroupStructListApi = (datas) => {
  17. // return $httpWithMsg.post(`${QUESTION_API}/paper/build`, datas);
  18. // };
  19. import folderPropStruct from "./datas/folderPropStruct.json";
  20. export const questionGroupStructListApi = (datas) => {
  21. return Promise.resolve({ data: folderPropStruct, filter: datas });
  22. };
  23. // edit paper
  24. export const paperDetailInfoApi = (paperId) => {
  25. return $httpWithMsg.post(`${QUESTION_API}/paper/${paperId}`, {});
  26. };
  27. export const paperSaveApi = (paper) => {
  28. return $httpWithMsg.post(`${QUESTION_API}/paper`, paper);
  29. };
  30. export const paperDeleteApi = (paperId) => {
  31. return $httpWithMsg.delete(`${QUESTION_API}/paper/${paperId}`, {});
  32. };
  33. // paper-info
  34. export const paperAuditInfoApi = ({ paperId, curPage, pageSize }) => {
  35. return $httpWithMsg.get(
  36. `${QUESTION_API}/paper/audit/page/${curPage}/${pageSize}`,
  37. {
  38. params: {
  39. paperId,
  40. },
  41. }
  42. );
  43. };
  44. export const paperBlueInfoApi = ({ paperId, coursePropertyId, rootOrgId }) => {
  45. return $httpWithMsg.get(`${QUESTION_API}/paper/blue`, {
  46. params: {
  47. id: paperId,
  48. coursePropertyId,
  49. rootOrgId,
  50. },
  51. });
  52. };
  53. export const paperQtypeInfoApi = ({ paperId, type }) => {
  54. return $httpWithMsg.get(`${QUESTION_API}/paper/question/type`, {
  55. params: {
  56. id: paperId,
  57. type,
  58. },
  59. });
  60. };
  61. export const paperBaseInfoApi = ({ paperId }) => {
  62. return $httpWithMsg.get(`${QUESTION_API}/paper/basic/composition`, {
  63. params: {
  64. id: paperId,
  65. },
  66. });
  67. };
  68. export const paperDetailUpdateApi = (paperId, datas) => {
  69. return $httpWithMsg.post(
  70. `${QUESTION_API}/updatePaperDetail/${paperId}`,
  71. datas
  72. );
  73. };
  74. export const paperDetailMoveApi = ({ paperId, detailId, vector }) => {
  75. return $httpWithMsg.put(
  76. `${QUESTION_API}/paperDetail/${paperId}/${detailId}/${vector}`,
  77. {}
  78. );
  79. };
  80. export const paperDetailDeleteApi = ({ paperId, detailId }) => {
  81. return $httpWithMsg.delete(
  82. `${QUESTION_API}/paperDetail/${paperId}/${detailId}`,
  83. {}
  84. );
  85. };
  86. export const paperQuestionMoveApi = ({ detailId, unitid, vector }) => {
  87. return $httpWithMsg.put(
  88. `${QUESTION_API}/paperDetailUnit/${detailId}/${unitid}/${vector}`,
  89. {}
  90. );
  91. };
  92. export const paperQuestionDeleteApi = (unitid) => {
  93. return $httpWithMsg.delete(`${QUESTION_API}/paperDetailUnit/${unitid}`, {});
  94. };
  95. export const paperQuestionUnitDeleteApi = ({ unitid, questionId }) => {
  96. return $httpWithMsg.delete(
  97. `${QUESTION_API}/paper/deleteQuestion/${unitid}/${questionId}`,
  98. {}
  99. );
  100. };
  101. // audit-paper
  102. export const auditPaperWaitPageListApi = (datas) => {
  103. return $httpWithMsg.get(`${QUESTION_API}/find_pending_trial_paper`, {
  104. params: datas,
  105. });
  106. };
  107. export const auditPaperAuditedPageListApi = (datas) => {
  108. return $httpWithMsg.get(`${QUESTION_API}/find_my_audit_paper`, {
  109. params: datas,
  110. });
  111. };
  112. export const auditPaperApplyPageListApi = (datas) => {
  113. return $httpWithMsg.get(`${QUESTION_API}/find_my_paper_status`, {
  114. params: datas,
  115. });
  116. };
  117. export const auditPaperUnsubmitPageListApi = (datas) => {
  118. return $httpWithMsg.get(`${QUESTION_API}/find_will_submit_paper`, {
  119. params: datas,
  120. });
  121. };
  122. export const auditPaperApi = (datas) => {
  123. // auditResult,auditRemark,paperIds
  124. return $httpWithMsg.post(`${QUESTION_API}/paper/audit`, datas);
  125. };
  126. export const withdrawPaperApi = (paperIds) => {
  127. return $httpWithMsg.post(
  128. `${QUESTION_API}/paper/withdraw`,
  129. {},
  130. { params: { paperIds } }
  131. );
  132. };
  133. export const submitPaperApi = (paperIds) => {
  134. return $httpWithMsg.post(
  135. `${QUESTION_API}/paper/submit`,
  136. {},
  137. { params: { paperIds } }
  138. );
  139. };
  140. // build-paper
  141. export const paperSimpleTypeDistributeApi = (courseId) => {
  142. return $httpWithMsg.post(
  143. `${QUESTION_API}/gen/paper/simple/type/distribute`,
  144. {},
  145. { params: { courseId } }
  146. );
  147. };
  148. export const paperSimpleCountDistributeApi = (params) => {
  149. return $httpWithMsg.post(
  150. `${QUESTION_API}/gen/paper/simple/count/distribute`,
  151. {},
  152. { params }
  153. );
  154. };