【新增】试卷任务前端

This commit is contained in:
YOHO\20373
2025-04-23 17:12:26 +08:00
committed by 陆光LG
parent cb6f4c1ea5
commit 7a89a0a822
77 changed files with 13188 additions and 1 deletions

102
src/api/session/index.js Normal file
View File

@@ -0,0 +1,102 @@
import request from '@/utils/request';
/**
* 分页查询试卷场次
*/
export async function pageSessions(params) {
const res = await request.get('/exam/session/list', { params });
if (res.data.code === 200) {
return res.data;
}
return Promise.reject(new Error(res.data.msg));
}
/**
* 查询全部试卷场次
*/
export async function listSessions(params) {
const res = await request.get('/exam/session/list', { params });
if (res.data.code === 200) {
return res.data.data;
}
return Promise.reject(new Error(res.data.msg));
}
/**
* 根据id查询试卷场次
*/
export async function getSession(id) {
const res = await request.get('/exam/session/' + id);
if (res.data.code === 200) {
return res.data;
}
return Promise.reject(new Error(res.data.msg));
}
/**
* 添加试卷场次
*/
export async function addSession(data) {
const res = await request.post('/exam/session', data);
if (res.data.code === 200) {
return res.data.msg;
}
return Promise.reject(new Error(res.data.msg));
}
/**
* 修改试卷场次
*/
export async function updateSession(data) {
const res = await request.put('/exam/session', data);
if (res.data.code === 200) {
return res.data.msg;
}
return Promise.reject(new Error(res.data.msg));
}
/**
* 删除试卷场次
*/
export async function removeSession(id) {
const res = await request.delete('/exam/session/' + id);
if (res.data.code === 200) {
return res.data.msg;
}
return Promise.reject(new Error(res.data.msg));
}
/**
* 批量删除试卷场次
*/
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(params) {
const res = await request.post('/exam/session/set', params); // 改为 POST + JSON
if (res.data.code === 200) {
return res.data.msg;
}
return Promise.reject(new Error(res.data.msg));
}
/**
* 导出试卷场次
*/
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`);
}

View File

@@ -0,0 +1,94 @@
import request from '@/config/axios'
/**
* 分页查询试卷
*/
export async function pagePapers(params) {
return await request.get({ url: '/exam/paper/list' , params })
}
/**
* 查询全部试卷
*/
export async function listPapers(params) {
return await request.get({ url: '/exam/paper/list' , params })
}
/**
* 根据id查询试卷
*/
export async function getPaper(id) {
return await request.get({ url: '/exam/paper' + id })
}
/**
* 添加试卷
*/
export async function addPaper(params) {
return await request.get({ url: '/exam/paper/add' , params })
}
/**
* 修改试卷
*/
export async function updatePaper(data) {
return await request.post({ url: '/exam/paper/update' , data })
}
/**
* 删除试卷
*/
export async function removePaper(id) {
return await request.delete({ url: '/exam/paper/' + id })
}
/**
* 批量删除试卷
*/
export async function removePapers(ids) {
return await request.delete({ url: '/exam/paper/' + ids.join() })
}
/**
* 导出试卷
*/
export async function exportPapers(params) {
// const res = await request({
// url: '/exam/paper/export',
// method: 'POST',
// data: toFormData(params),
// responseType: 'blob'
// });
// await checkDownloadRes(res);
// download(res.data, `paper_${Date.now()}.xlsx`);
}
export async function getPaperDetailByTaskId(paperId) {
return await request.get({ url: '/exam/qu/getPaper' , params:{paperId} })
}
export async function getPaperList(taskId) {
return await request.get({ url: '/exam/paper/getPaperByTaskId' , params:{taskId} })
}
export async function getPaperListByType(data) {
return await request.post({ url: '/exam/paper/getPaperByTaskIdByType' , data })
}
export async function updatePaperStatus(paperId: string, status: number) {
return await request.put({
url: '/exam/paper/updatePaperStatus',
data: { paperId, status } // 使用data
})
}

View File

@@ -0,0 +1,18 @@
import request from '@/config/axios'
/**
* 根据id查询通用参数
*/
export async function getParam(params) {
return await request.get({ url: '/exam/param/getInfo' , params })
}
/**
* 修改通用参数
*/
export async function updateParam(data) {
return await request.put({ url: '/exam/param' , data })
}

View File

@@ -0,0 +1,92 @@
import request from '@/config/axios'
/**
* 分页查询试卷人员分配
*/
export async function pagePersons(params) {
const res = await request.get('/exam/person/list', { params });
if (res.data.code === 200) {
return res.data;
}
return Promise.reject(new Error(res.data.msg));
}
/**
* 查询全部试卷人员分配
*/
export async function listPersons(params) {
const res = await request.get('/exam/person/list', { params });
if (res.data.code === 200) {
return res.data.data;
}
return Promise.reject(new Error(res.data.msg));
}
/**
* 根据id查询试卷人员分配
*/
export async function getPerson(id) {
const res = await request.get('/exam/person/' + id);
if (res.data.code === 200) {
return res.data;
}
return Promise.reject(new Error(res.data.msg));
}
/**
* 添加试卷人员分配
*/
export async function addPerson(data) {
const res = await request.post('/exam/person', data);
if (res.data.code === 200) {
return res.data.msg;
}
return Promise.reject(new Error(res.data.msg));
}
/**
* 修改试卷人员分配
*/
export async function updatePerson(data) {
const res = await request.put('/exam/person', data);
if (res.data.code === 200) {
return res.data.msg;
}
return Promise.reject(new Error(res.data.msg));
}
/**
* 删除试卷人员分配
*/
export async function removePerson(id) {
const res = await request.delete('/exam/person/' + id);
if (res.data.code === 200) {
return res.data.msg;
}
return Promise.reject(new Error(res.data.msg));
}
/**
* 批量删除试卷人员分配
*/
export async function removePersons(ids) {
const res = await request.delete('/exam/person/' + ids.join());
if (res.data.code === 200) {
return res.data.msg;
}
return Promise.reject(new Error(res.data.msg));
}
/**
* 导出试卷人员分配
*/
export async function exportPersons(params) {
// const res = await request({
// url: '/exam/person/export',
// method: 'POST',
// data: toFormData(params),
// responseType: 'blob'
// });
// await checkDownloadRes(res);
// download(res.data, `person_${Date.now()}.xlsx`);
}

View File

@@ -0,0 +1,105 @@
import request from '@/config/axios'
/**
* 分页查询试卷方案
*/
export async function pageSchemes(params) {
return await request.get({ url: '/exam/scheme/list' ,params})
}
/**
* 查询全部试卷方案
*/
export async function listSchemes(params) {
return await request.get({ url: '/exam/scheme/list' ,params})
}
/**
* 根据id查询试卷方案
*/
export async function getScheme(id) {
return await request.get({ url: '/exam/scheme' + id })
}
/**
* 添加试卷方案
*/
export async function addScheme(data) {
return await request.post({ url: '/exam/scheme' , data })
}
/**
* 修改试卷方案
*/
export async function updateScheme(data) {
return await request.put({ url: '/exam/scheme' , data })
}
/**
* 删除试卷方案
*/
export async function removeScheme(id: number) {
return await request.delete({ url: '/exam/scheme/' + id })
}
/**
* 批量删除试卷方案
*/
export async function removeSchemes(ids) {
return await request.delete({ url: '/exam/scheme' + ids.join() })
}
/**
* 导出试卷方案
*/
export async function exportSchemes(params) {
// const res = await request({
// url: '/exam/scheme/export',
// method: 'POST',
// data: toFormData(params),
// responseType: 'blob'
// });
// await checkDownloadRes(res);
// download(res.data, `scheme_${Date.now()}.xlsx`);
}
export async function getCourseList() {
return await request.get({ url: '/exam/task/getCourse' })
}
export async function getKeyList() {
return await request.get({ url: '/exam/task/getKeywords' })
}
/**
* 根据专业名称查找知识点
*/
export async function getPoints(name) {
return await request.get({ url: '/exam/task/getPoints' ,params:{name} })
}
//根据知识点题型难度,查找试题数量
export async function fetchQuestionCount(data) {
return await request.post({ url: '/exam/task/getQuestionCount' , data })
}

View File

@@ -0,0 +1,89 @@
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
})
}

130
src/api/system/stu/index.js Normal file
View File

@@ -0,0 +1,130 @@
import request from '@/config/axios'
/**
* 分页查询客户端授权
*/
export async function pageStus(params) {
const res = await request.get('/system/stu/list', { params });
if (res.data.code === 200) {
return res.data.data;
}
return Promise.reject(new Error(res.data.msg));
}
/**
* 查询全部客户端授权
*/
export async function listStus(params) {
const res = await request.get('/system/stu/list', { params });
if (res.data.code === 200) {
return res.data.data;
}
return Promise.reject(new Error(res.data.msg));
}
/**
* 根据id查询客户端授权
*/
export async function getStu(id) {
const res = await request.get('/system/stu/' + id);
if (res.data.code === 200) {
return res.data;
}
return Promise.reject(new Error(res.data.msg));
}
/**
* 添加客户端授权
*/
export async function addStu(data) {
const res = await request.post('/system/stu', data);
if (res.data.code === 200) {
return res.data.msg;
}
return Promise.reject(new Error(res.data.msg));
}
/**
* 修改客户端授权
*/
export async function updateStu(data) {
const res = await request.put('/system/stu', data);
if (res.data.code === 200) {
return res.data.msg;
}
return Promise.reject(new Error(res.data.msg));
}
/**
* 删除客户端授权
*/
export async function removeStu(id) {
const res = await request.delete('/system/stu/' + id);
if (res.data.code === 200) {
return res.data.msg;
}
return Promise.reject(new Error(res.data.msg));
}
/**
* 批量删除客户端授权
*/
export async function removeStus(ids) {
const res = await request.delete('/system/stu/' + ids.join());
if (res.data.code === 200) {
return res.data.msg;
}
return Promise.reject(new Error(res.data.msg));
}
/**
* 导出客户端授权
*/
export async function exportStus(params) {
// const res = await request({
// url: '/system/stu/export',
// method: 'POST',
// data: toFormData(params),
// responseType: 'blob'
// });
// await checkDownloadRes(res);
// download(res.data, `stu_${Date.now()}.xlsx`);
}
/**
* 新增学生班级
*/
export async function addClass(data) {
const res = await request.post('/system/stu/class', data);
if (res.data.code === 200) {
return res.data.msg;
}
return Promise.reject(new Error(res.data.msg));
}
/**
* 修改学生班级
*/
export async function setClass(data) {
const res = await request.post('/system/stu/class', data);
if (res.data.code === 200) {
return res.data.msg;
}
return Promise.reject(new Error(res.data.msg));
}
export async function getTeacherList() {
const res = await request.get('/system/user/getTeacherList');
if (res.data.code === 200) {
return res.data;
}
return Promise.reject(new Error(res.data.msg));
}
//
export async function getClassListByTeacher(id) {
const res = await request.get('/system/dept/getClassListByTeacher', {
params: { teacherId: id }
});
if (res.data.code === 200) {
return res.data;
}
return Promise.reject(new Error(res.data.msg));
}

View File

@@ -0,0 +1,103 @@
import request from '@/config/axios'
/**
* 分页查询试卷任务
*/
export async function pageTasks(params) {
return await request.get({ url: '/exam/task/list' , params })
}
/**
* 查询全部试卷任务
*/
export async function listTasks(params) {
return await request.get({ url: '/exam/task/list' , params })
}
/**
* 根据id查询试卷任务
*/
export async function getTask(id) {
return await request.get({ url: '/exam/task' + id })
}
/**
* 添加试卷任务
*/
export async function addTask(data) {
return await request.post({ url: '/exam/task' , data })
}
/**
* 修改试卷任务
*/
export async function updateTask(data) {
return await request.put({ url: '/exam/task' , data })
}
/**
* 删除试卷任务
*/
export async function removeTask(id) {
return await request.delete({ url: '/exam/del/task/' + id })
}
/**
* 批量删除试卷任务
*/
export async function removeTasks(ids) {
return await request.delete({ url: '/exam/task/' +ids })
}
// 更改状态
export async function updateTaskStatus(taskId: string, status: number) {
return await request.put({
url: '/exam/task/updateTaskStatus',
data: { taskId, status } // 使用data
})
}
/**
* 导出试卷任务
*/
export async function exportTasks(params) {
// const res = await request({
// url: '/exam/task/export',
// method: 'POST',
// data: toFormData(params),
// responseType: 'blob'
// });
// await checkDownloadRes(res);
// download(res.data, `task_${Date.now()}.xlsx`);
}
export async function getSpecialtyList() {
return await request.get({ url: '/exam/task/getSpeciality' })
}
export async function submitSelection(data) {
return await request.post({ url: '/exam/task/submitSelection' , data })
}