123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120 |
- import { httpApp } from "@/plugins/axiosIndex";
- import { pickBy } from "lodash-es";
- import { object2QueryString } from "@/utils/utils";
- export function searchExams({
- role,
- loginName = "",
- name = "",
- enable = "",
- pageNumber = 1,
- pageSize = 10,
- }) {
- const data = pickBy(
- { role, loginName, name, enable, pageNumber, pageSize },
- (v) => v !== ""
- );
- return httpApp.post("/api/admin/exam/query?" + object2QueryString(data));
- }
- export function getExamDetail({ id }) {
- return httpApp.post("/api/admin/exam/detail?" + object2QueryString({ id }));
- }
- export function toggleEnableExam({ id, enable }) {
- return httpApp.post("/api/admin/exam/toggle", { id, enable });
- }
- export function copyExam({ sourceId, name, code }) {
- return httpApp.post("/api/admin/exam/copy", { sourceId, name, code });
- }
- export function saveExam({
- id = "",
- breakExpireSeconds = 0,
- breakResumeCount = 0,
- cameraPhotoUpload = 0,
- code = "",
- createId = 0,
- createTime = "",
- enable = 0,
- enableIpLimit = 0,
- endTime = "",
- entryAuthenticationPolicy = "",
- examCount = 0,
- forceFinish = 0,
- inProcessFaceStrangerIgnore = 0,
- inProcessFaceVerify = 0,
- inProcessLivenessFixedRange = "",
- inProcessLivenessJudgePolicy = "",
- inProcessLivenessVerify = 0,
- ipAllow = "",
- maxDurationSeconds = 0,
- minDurationSeconds = 0,
- mode = "",
- monitorRecord = 0,
- monitorVideoSource = [""],
- name = "",
- objectiveScorePolicy = "",
- openingSeconds = 0,
- // "orgId = 0,
- postNotice = "",
- preNotice = "",
- preNoticeStaySeconds = 0,
- prepareSeconds = 0,
- progress = 0,
- recordSelectStrategy = "",
- reexamAuditing = 0,
- scoreStatus = "",
- shortCode = "",
- showObjectiveScore = 0,
- startTime = "",
- mobilePhotoUpload = 0,
- }) {
- const data = pickBy(
- {
- id,
- breakExpireSeconds,
- breakResumeCount,
- cameraPhotoUpload,
- code,
- createId,
- createTime,
- enable,
- enableIpLimit,
- endTime,
- entryAuthenticationPolicy,
- examCount,
- forceFinish,
- inProcessFaceStrangerIgnore,
- inProcessFaceVerify,
- inProcessLivenessFixedRange,
- inProcessLivenessJudgePolicy,
- inProcessLivenessVerify,
- ipAllow,
- maxDurationSeconds,
- minDurationSeconds,
- mode,
- monitorRecord,
- monitorVideoSource,
- name,
- objectiveScorePolicy,
- openingSeconds,
- // "orgId = 0,
- postNotice,
- preNotice,
- preNoticeStaySeconds,
- prepareSeconds,
- progress,
- recordSelectStrategy,
- reexamAuditing,
- scoreStatus,
- shortCode,
- showObjectiveScore,
- startTime,
- mobilePhotoUpload,
- },
- (v) => v !== ""
- );
- return httpApp.post("/api/admin/exam/save", data);
- }
|