Files
pengchen-exam-vue/src/api/system/session/index.ts

100 lines
2.2 KiB
TypeScript

import request from '@/config/axios'
//import { download, toFormData, checkDownloadRes } from '@/utils/common';
/**
* 分页查询试卷场次
*/
export async function pageSessions(params) {
return await request.get({ url: '/exam/session/list' , params })
}
/**
* 查询全部试卷场次
*/
export async function listSessions(params) {
return await request.get({ url: '/exam/session/list' , params })
}
/**
* 根据id查询试卷场次
*/
export async function getSession(id) {
return await request.get({ url: '/exam/session/' + id })
}
/**
* 添加试卷场次
*/
export async function addSession(data) {
return await request.post({ url: '/exam/session' , data })
}
/**
* 修改试卷场次
*/
export async function updateSession(data) {
return await request.put({ url: '/exam/session' , data })
}
/**
* 删除试卷场次
*/
export async function removeSession(id) {
return await request.delete({ url: '/exam/session/' + id })
}
/**
* 批量删除试卷场次
*/
export async function removeSessions(ids) {
const res = await request.delete('/exam/session/' + ids.join());
if (res.data.code === 200) {
return res.data.msg;
}
return Promise.reject(new Error(res.data.msg));
}
export async function setSessions(data) {
return await request.post({ url: '/exam/session/set' , data })
}
/**
* 导出试卷场次
*/
export async function exportSessions(params) {
// const res = await request({
// url: '/exam/session/export',
// method: 'POST',
// data: toFormData(params),
// responseType: 'blob'
// });
// await checkDownloadRes(res);
// download(res.data, `session_${Date.now()}.xlsx`);
}
export async function updateSessionStatus(sessionId: string, status: number) {
return await request.put({
url: '/exam/session/updateSessionStatus',
data: { sessionId, status } // 使用data
})
}
export async function getSessionStu(params) {
return await request.get({ url: '/exam/person/getSessionStu' , params })
}
export async function fetch(taskId) {
return await request.get({ url: '/exam/param/check-can-enter-step4/' + taskId })
}
export async function fetchNoMes(taskId) {
return await request.get({ url: '/exam/param/check-can-enter-step4NoMsg/' + taskId })
}