api.js 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  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(
  18. `${QUESTION_API}/gen/paper/auto/distribute`,
  19. {},
  20. { params: datas }
  21. );
  22. };
  23. // import folderPropStruct from "./datas/folderPropStruct.json";
  24. // export const questionGroupStructListApi = (datas) => {
  25. // return Promise.resolve({ data: folderPropStruct, filter: datas });
  26. // };
  27. // edit paper
  28. export const paperDetailInfoApi = (paperId) => {
  29. return $httpWithMsg.get(`${QUESTION_API}/paper/${paperId}`, {});
  30. };
  31. export const paperSaveApi = (paper) => {
  32. return $httpWithMsg.post(`${QUESTION_API}/paper`, paper);
  33. };
  34. export const paperDeleteApi = (paperId) => {
  35. return $httpWithMsg.delete(`${QUESTION_API}/paper/${paperId}`, {});
  36. };
  37. // paper-info
  38. export const paperAuditInfoApi = ({ paperId, curPage, pageSize }) => {
  39. return $httpWithMsg.get(
  40. `${QUESTION_API}/paper/audit/page/${curPage}/${pageSize}`,
  41. {
  42. params: {
  43. paperId,
  44. },
  45. }
  46. );
  47. };
  48. export const paperBlueInfoApi = ({ paperId, coursePropertyId, rootOrgId }) => {
  49. return $httpWithMsg.get(`${QUESTION_API}/paper/blue`, {
  50. params: {
  51. id: paperId,
  52. coursePropertyId,
  53. rootOrgId,
  54. },
  55. });
  56. };
  57. export const paperQtypeInfoApi = ({ paperId, type }) => {
  58. return $httpWithMsg.get(`${QUESTION_API}/paper/question/type`, {
  59. params: {
  60. id: paperId,
  61. type,
  62. },
  63. });
  64. };
  65. export const paperBaseInfoApi = ({ paperId }) => {
  66. return $httpWithMsg.get(`${QUESTION_API}/paper/basic/composition`, {
  67. params: {
  68. id: paperId,
  69. },
  70. });
  71. };
  72. export const paperDetailUpdateApi = (paperId, datas) => {
  73. return $httpWithMsg.post(
  74. `${QUESTION_API}/updatePaperDetail/${paperId}`,
  75. datas
  76. );
  77. };
  78. export const paperDetailMoveApi = ({ paperId, detailId, vector }) => {
  79. return $httpWithMsg.put(
  80. `${QUESTION_API}/paperDetail/${paperId}/${detailId}/${vector}`,
  81. {}
  82. );
  83. };
  84. export const paperDetailDeleteApi = ({ paperId, detailId }) => {
  85. return $httpWithMsg.delete(
  86. `${QUESTION_API}/paperDetail/${paperId}/${detailId}`,
  87. {}
  88. );
  89. };
  90. export const paperQuestionMoveApi = ({ detailId, unitid, vector }) => {
  91. return $httpWithMsg.put(
  92. `${QUESTION_API}/paperDetailUnit/${detailId}/${unitid}/${vector}`,
  93. {}
  94. );
  95. };
  96. export const paperQuestionDeleteApi = (unitid) => {
  97. return $httpWithMsg.delete(`${QUESTION_API}/paperDetailUnit/${unitid}`, {});
  98. };
  99. export const paperQuestionUnitDeleteApi = ({ unitid, questionId }) => {
  100. return $httpWithMsg.delete(
  101. `${QUESTION_API}/paper/deleteQuestion/${unitid}/${questionId}`,
  102. {}
  103. );
  104. };
  105. // audit-paper
  106. export const auditPaperWaitPageListApi = (datas) => {
  107. return $httpWithMsg.post(
  108. `${QUESTION_API}/find_pending_trial_paper`,
  109. {},
  110. {
  111. params: datas,
  112. }
  113. );
  114. };
  115. export const auditPaperAuditedPageListApi = (datas) => {
  116. return $httpWithMsg.post(
  117. `${QUESTION_API}/find_my_audit_paper`,
  118. {},
  119. {
  120. params: datas,
  121. }
  122. );
  123. };
  124. export const auditPaperApplyPageListApi = (datas) => {
  125. return $httpWithMsg.post(
  126. `${QUESTION_API}/find_my_paper_status`,
  127. {},
  128. {
  129. params: datas,
  130. }
  131. );
  132. };
  133. export const auditPaperUnsubmitPageListApi = (datas) => {
  134. return $httpWithMsg.post(
  135. `${QUESTION_API}/find_will_submit_paper`,
  136. {},
  137. {
  138. params: datas,
  139. }
  140. );
  141. };
  142. export const auditPaperApi = (datas) => {
  143. // auditResult,auditRemark,paperIds
  144. return $httpWithMsg.post(
  145. `${QUESTION_API}/paper/audit`,
  146. {},
  147. { params: datas }
  148. );
  149. };
  150. export const withdrawPaperApi = (paperIds) => {
  151. return $httpWithMsg.post(
  152. `${QUESTION_API}/paper/withdraw`,
  153. {},
  154. { params: { paperIds } }
  155. );
  156. };
  157. export const submitPaperApi = (paperIds) => {
  158. return $httpWithMsg.post(
  159. `${QUESTION_API}/paper/submit`,
  160. {},
  161. { params: { paperIds } }
  162. );
  163. };
  164. // build-paper
  165. export const paperSimpleTypeDistributeApi = (courseId) => {
  166. return $httpWithMsg.post(
  167. `${QUESTION_API}/gen/paper/simple/type/distribute`,
  168. {},
  169. { params: { courseId } }
  170. );
  171. };
  172. export const paperSimpleCountDistributeApi = (params) => {
  173. return $httpWithMsg.post(
  174. `${QUESTION_API}/gen/paper/simple/count/distribute`,
  175. {},
  176. { params }
  177. );
  178. };
  179. // paper-recycle
  180. export function paperRecycleListApi(data = {}) {
  181. return $httpWithMsg.post(
  182. `${QUESTION_API}/paper/recycle_find`,
  183. {},
  184. { params: data }
  185. );
  186. }
  187. export function recoverPaperApi(recycleParamList) {
  188. return $httpWithMsg.post(
  189. `${QUESTION_API}/paper/recycle_recover`,
  190. recycleParamList
  191. );
  192. }
  193. export function thoroughDeletePaperApi(recycleParamList) {
  194. return $httpWithMsg.post(
  195. `${QUESTION_API}/paper/recycle_clear`,
  196. recycleParamList
  197. );
  198. }
  199. export function clearPaperRecycleApi() {
  200. return $httpWithMsg.post(`${QUESTION_API}/paper/recycle_clear_all`, {});
  201. }