api.js 5.6 KB

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