examwork-exam.js 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. import { httpApp } from "@/plugins/axiosIndex";
  2. import { pickBy } from "lodash-es";
  3. import { object2QueryString } from "@/utils/utils";
  4. export function searchExams({
  5. name = "",
  6. enable = "",
  7. mode = "",
  8. pageNumber = 1,
  9. pageSize = 10,
  10. }) {
  11. const data = pickBy(
  12. { name, enable, mode, pageNumber, pageSize },
  13. (v) => v !== ""
  14. );
  15. return httpApp.post("/api/admin/exam/query?" + object2QueryString(data));
  16. }
  17. export function getExamDetail({ id }) {
  18. return httpApp.post("/api/admin/exam/detail?" + object2QueryString({ id }));
  19. }
  20. export function toggleEnableExam({ id, enable }) {
  21. return httpApp.post("/api/admin/exam/toggle", { id, enable });
  22. }
  23. export function copyExam({ sourceId, name, code }) {
  24. return httpApp.post("/api/admin/exam/copy", { sourceId, name, code });
  25. }
  26. export function saveExam({
  27. id = "",
  28. breakExpireSeconds = 0,
  29. breakResumeCount = 0,
  30. cameraPhotoUpload = 0,
  31. code = "",
  32. createId = 0,
  33. createTime = "",
  34. enable = "",
  35. enableIpLimit = 0,
  36. endTime = "",
  37. entryAuthenticationPolicy = "",
  38. examCount = 0,
  39. forceFinish = 0,
  40. inProcessFaceStrangerIgnore = 0,
  41. inProcessFaceVerify = 0,
  42. inProcessLivenessFixedRange = [],
  43. inProcessLivenessJudgePolicy = "",
  44. inProcessLivenessVerify = 0,
  45. ipAllow = "",
  46. maxDurationSeconds = 0,
  47. minDurationSeconds = 0,
  48. mode = "",
  49. monitorRecord = 0,
  50. monitorVideoSource = [],
  51. name = "",
  52. objectiveScorePolicy = "",
  53. openingSeconds = 0,
  54. // "orgId = 0,
  55. postNotice = "",
  56. preNotice = "",
  57. preNoticeStaySeconds = 0,
  58. prepareSeconds = 0,
  59. progress = 0,
  60. recordSelectStrategy = "",
  61. reexamAuditing = 0,
  62. scoreStatus = "",
  63. shortCode = "",
  64. showObjectiveScore = 0,
  65. startTime = "",
  66. mobilePhotoUpload = 0,
  67. }) {
  68. const data = pickBy(
  69. {
  70. id,
  71. breakExpireSeconds,
  72. breakResumeCount,
  73. cameraPhotoUpload,
  74. code,
  75. createId,
  76. createTime,
  77. enable,
  78. enableIpLimit,
  79. endTime,
  80. entryAuthenticationPolicy,
  81. examCount,
  82. forceFinish,
  83. inProcessFaceStrangerIgnore,
  84. inProcessFaceVerify,
  85. inProcessLivenessFixedRange,
  86. inProcessLivenessJudgePolicy,
  87. inProcessLivenessVerify,
  88. ipAllow,
  89. maxDurationSeconds,
  90. minDurationSeconds,
  91. mode,
  92. monitorRecord,
  93. monitorVideoSource,
  94. name,
  95. objectiveScorePolicy,
  96. openingSeconds,
  97. // "orgId = 0,
  98. postNotice,
  99. preNotice,
  100. preNoticeStaySeconds,
  101. prepareSeconds,
  102. progress,
  103. recordSelectStrategy,
  104. reexamAuditing,
  105. scoreStatus,
  106. shortCode,
  107. showObjectiveScore,
  108. startTime,
  109. mobilePhotoUpload,
  110. },
  111. (v) => v !== ""
  112. );
  113. return httpApp.post("/api/admin/exam/save", data);
  114. }
  115. export function getExamRoom() {
  116. return httpApp.post("/api/admin/sys/examRoom/query");
  117. }
  118. export function reCalcExam(examId) {
  119. return httpApp.post("/api/admin/exam/score/calculate?id=" + examId);
  120. }