123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- import { httpApp } from "@/plugins/axiosIndex";
- import { pickBy } from "lodash-es";
- import { object2QueryString } from "@/utils/utils";
- export function searchCourses({
- id = "",
- examId = "",
- code = "",
- hasPaper = "",
- pageNumber = 1,
- pageSize = 10,
- }) {
- const data = pickBy(
- { id, examId, code, hasPaper, pageNumber, pageSize },
- (v) => v !== ""
- );
- if (data.examId || data.id)
- return httpApp.post(
- "/api/admin/exam/course/query?" + object2QueryString(data)
- );
- }
- export function searchPapers({ examId = "", courseCode = "" }) {
- const data = pickBy({ examId, courseCode }, (v) => v !== "");
- return httpApp.post(
- "/api/admin/exam/paper/query?" + object2QueryString(data)
- );
- }
- export function saveCourse({
- examId = "",
- courseCode = "",
- objectiveShuffle = "",
- optionShuffle = "",
- }) {
- const data = pickBy(
- {
- examId,
- courseCode,
- objectiveShuffle,
- optionShuffle,
- },
- (v) => v !== ""
- );
- return httpApp.post("/api/admin/exam/course/save", data);
- }
- export function savePaper({ id = "", weight = "", audioPlayCount = "" }) {
- const data = pickBy(
- {
- id,
- weight,
- audioPlayCount,
- },
- (v) => v !== ""
- );
- return httpApp.post("/api/admin/exam/paper/save", data);
- }
- /**
- *
- * @param {Object[]} papers
- * @param {String} papers.id
- * @param {Number} papers.weight
- * @param {Number} papers.audioPlayCount
- */
- export function savePapers(papers) {
- return httpApp.post("/api/admin/exam/paper/save", papers);
- }
|