From e48289b953595ac696c0de930bf1026c03e1dde4 Mon Sep 17 00:00:00 2001 From: joylink_zhaoerwei Date: Wed, 21 Feb 2024 10:53:44 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=95=E5=8D=B7=E7=AE=A1=E7=90=86=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E5=A4=87=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/contest.js | 58 +++++++- .../contestSubjectManage/AddEditPaper.vue | 131 ++++++++++++++++++ .../ContestSubjectManage.vue | 127 ++++++++++++++++- 3 files changed, 311 insertions(+), 5 deletions(-) create mode 100644 src/views/contestDataManage/contestSubjectManage/AddEditPaper.vue diff --git a/src/api/contest.js b/src/api/contest.js index cb33ac55e..73c5b3ed9 100644 --- a/src/api/contest.js +++ b/src/api/contest.js @@ -1,5 +1,55 @@ import request from '@/utils/request'; +/** + * 获取竞赛试卷分页列表 + * @param {Object} data + * @param {String} data.name 试卷名称 + */ +export function getPaperList(data) { + return request({ + url: '/api/exercise/race/pager/page', + method: 'GET', + data + }); +} + +/** + * 创建试卷 + * @param {Object} data + * @param {String} data.name 试卷名称 + * @param {String} data.desc 基础描述 + * @param {Number} data.seasonId 所属赛季id + */ +export function createPaper(data) { + return request({ + url: '/api/exercise/race/paper', + method: 'POST', + data + }); +} + +/** 修改试卷 + * @param {Object} data 同创建试卷 + * @param {Number} id 试卷id + */ +export function editPaper(id, data) { + return request({ + url: `/api/exercise/race/paper/${id}`, + method: 'POST', + data + }); +} + +/** 删除指定试卷 + * @param {Number} id 任务id + */ +export function deletePaper(id) { + return request({ + url: `/api/exercise/race/paper/${id}`, + method: 'DELETE' + }); +} + /** 查看所有任务数据 */ export function getTaskTreeDatas() { return request({ @@ -27,11 +77,11 @@ export function createTask(data) { /** 修改指定任务 * @param {Object} data 同创建任务 - * @param {Number} data.id 任务id + * @param {Number} id 任务id */ -export function editTask(data) { +export function editTask(id, data) { return request({ - url: `/api/exercise/race/task/${data.id}`, + url: `/api/exercise/race/task/${id}`, method: 'POST', data }); @@ -59,7 +109,7 @@ export function getchildrenTaskDatas(id) { /** 任务绑定 * @param {Object} data - * @param {Number} data.taskId 任务名称 + * @param {Number} data.taskId 任务id * @param {Number} data.bindId 绑定id,根据bindtype来区分对应的id * @param {String} data.bindType rule =评分规则;scene=场景 */ diff --git a/src/views/contestDataManage/contestSubjectManage/AddEditPaper.vue b/src/views/contestDataManage/contestSubjectManage/AddEditPaper.vue new file mode 100644 index 000000000..ec7d4de00 --- /dev/null +++ b/src/views/contestDataManage/contestSubjectManage/AddEditPaper.vue @@ -0,0 +1,131 @@ + + + diff --git a/src/views/contestDataManage/contestSubjectManage/ContestSubjectManage.vue b/src/views/contestDataManage/contestSubjectManage/ContestSubjectManage.vue index 574ebbc09..eccad7f60 100644 --- a/src/views/contestDataManage/contestSubjectManage/ContestSubjectManage.vue +++ b/src/views/contestDataManage/contestSubjectManage/ContestSubjectManage.vue @@ -1,3 +1,128 @@ + + + +