exam.js 2.7 KB

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