From 757f661a222954a8a4456e53c04a22af2a0fb830 Mon Sep 17 00:00:00 2001 From: joylink_zhaoerwei Date: Tue, 20 Feb 2024 18:16:50 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E7=AB=9E=E8=B5=9B=E4=BB=BB=E5=8A=A1api?= =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/contest.js | 72 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) diff --git a/src/api/contest.js b/src/api/contest.js index e69de29bb..cb33ac55e 100644 --- a/src/api/contest.js +++ b/src/api/contest.js @@ -0,0 +1,72 @@ +import request from '@/utils/request'; + +/** 查看所有任务数据 */ +export function getTaskTreeDatas() { + return request({ + url: '/api/exercise/race/task/tree', + method: 'GET' + }); +} + +/** + * 创建任务 + * @param {Object} data + * @param {String} data.name 任务名称 + * @param {String} data.desc 基础描述 + * @param {String} data.content 考核内容 + * @param {String} data.standards 评价标准 + * @param {Number} data.parentId 如果是子任务,需要父任务的id + */ +export function createTask(data) { + return request({ + url: '/api/exercise/race/task', + method: 'POST', + data + }); +} + +/** 修改指定任务 + * @param {Object} data 同创建任务 + * @param {Number} data.id 任务id + */ +export function editTask(data) { + return request({ + url: `/api/exercise/race/task/${data.id}`, + method: 'POST', + data + }); +} + +/** 删除指定任务 + * @param {Number} id 任务id + */ +export function deleteTask(id) { + return request({ + url: `/api/exercise/race/task/${id}`, + method: 'DELETE' + }); +} + +/** 查看指定子任务 + * @param {Number} id 任务id + */ +export function getchildrenTaskDatas(id) { + return request({ + url: `/api/exercise/race/task/${id}/children`, + method: 'GET' + }); +} + +/** 任务绑定 + * @param {Object} data + * @param {Number} data.taskId 任务名称 + * @param {Number} data.bindId 绑定id,根据bindtype来区分对应的id + * @param {String} data.bindType rule =评分规则;scene=场景 + */ +export function bindTask(data) { + return request({ + url: '/api/exercise/race/task/bind', + method: 'POST', + data + }); +} From e48289b953595ac696c0de930bf1026c03e1dde4 Mon Sep 17 00:00:00 2001 From: joylink_zhaoerwei Date: Wed, 21 Feb 2024 10:53:44 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E8=AF=95=E5=8D=B7=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E4=BB=A3=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 @@ + + + + From 8c59b44de1f45635832111ac37e1f1306b6148b7 Mon Sep 17 00:00:00 2001 From: joylink_zhaoerwei Date: Wed, 21 Feb 2024 16:38:20 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E7=AB=9E=E8=B5=9B=E6=A8=A1=E5=9D=97?= =?UTF-8?q?=E4=BB=A3=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 | 78 ++++++++ .../contestModuleManage/AddEditModule.vue | 128 +++++++++++++ .../ContestModuleManage.vue | 174 +++++++++++++++++- .../contestModuleManage/DetailModule.vue | 97 ++++++++++ .../ContestSubjectManage.vue | 4 +- 5 files changed, 478 insertions(+), 3 deletions(-) create mode 100644 src/views/contestDataManage/contestModuleManage/AddEditModule.vue create mode 100644 src/views/contestDataManage/contestModuleManage/DetailModule.vue diff --git a/src/api/contest.js b/src/api/contest.js index 73c5b3ed9..2b4eec073 100644 --- a/src/api/contest.js +++ b/src/api/contest.js @@ -50,6 +50,84 @@ export function deletePaper(id) { }); } +/** + * 获取竞赛模块分页列表 + * @param {Object} data + * @param {String} data.paperName 试卷名称 + * @param {Number} data.paperId 试卷id + * @param {String} data.code 模块名称 + */ +export function getModuleList(data) { + return request({ + url: '/api/exercise/race/module/page', + method: 'GET', + data + }); +} + +/** + * 创建模块 + * @param {Object} data + * @param {String} data.code 模块名称 + * @param {String} data.desc 基础描述 + * @param {Number} data.paperId 试卷id + */ +export function createModule(data) { + return request({ + url: '/api/exercise/race/module', + method: 'POST', + data + }); +} + +/** 修改模块 + * @param {Object} data 同创建试卷 + * @param {Number} id 模块id + */ +export function editModule(id, data) { + return request({ + url: `/api/exercise/race/module/${id}`, + method: 'POST', + data + }); +} + +/** 删除指定模块 + * @param {Number} id 模块id + */ +export function deleteModule(id) { + return request({ + url: `/api/exercise/race/module/${id}`, + method: 'DELETE' + }); +} + +/** 查看模块明细 + * @param {Number} id 模块id + */ +export function getModuleDetail(id) { + return request({ + url: `/api/exercise/race/module/${id}`, + method: 'GET' + }); +} + +/** 模块修改任务设置 + * @param {Object} data + * @param {Number} data.taskIds 模块里所有任务id(一级任务的id) + * @param {Number} data.group 任务分组 + * @param {Number} data.group.taskIds 次分组中的任务id + * @param {Number} data.group.name 分组的名字 + * @param {Number} data.group.group 次分组的子分组 + */ +export function moduleTaskSetting(moudleId, data) { + return request({ + url: `/api/exercise/race/module/setting/${moudleId}/task`, + method: 'POST', + data + }); +} + /** 查看所有任务数据 */ export function getTaskTreeDatas() { return request({ diff --git a/src/views/contestDataManage/contestModuleManage/AddEditModule.vue b/src/views/contestDataManage/contestModuleManage/AddEditModule.vue new file mode 100644 index 000000000..fc43c8e65 --- /dev/null +++ b/src/views/contestDataManage/contestModuleManage/AddEditModule.vue @@ -0,0 +1,128 @@ + + + diff --git a/src/views/contestDataManage/contestModuleManage/ContestModuleManage.vue b/src/views/contestDataManage/contestModuleManage/ContestModuleManage.vue index ac05e2727..5dc4bd713 100644 --- a/src/views/contestDataManage/contestModuleManage/ContestModuleManage.vue +++ b/src/views/contestDataManage/contestModuleManage/ContestModuleManage.vue @@ -1,3 +1,175 @@ + + + + diff --git a/src/views/contestDataManage/contestModuleManage/DetailModule.vue b/src/views/contestDataManage/contestModuleManage/DetailModule.vue new file mode 100644 index 000000000..909a4849a --- /dev/null +++ b/src/views/contestDataManage/contestModuleManage/DetailModule.vue @@ -0,0 +1,97 @@ + + + diff --git a/src/views/contestDataManage/contestSubjectManage/ContestSubjectManage.vue b/src/views/contestDataManage/contestSubjectManage/ContestSubjectManage.vue index eccad7f60..eea4748b8 100644 --- a/src/views/contestDataManage/contestSubjectManage/ContestSubjectManage.vue +++ b/src/views/contestDataManage/contestSubjectManage/ContestSubjectManage.vue @@ -90,13 +90,13 @@ export default { getListApi(obj) { return getPaperList({ ...obj }); }, - editPaper(row) { + editPaper(index, row) { this.$refs.addEditPaper.doShow(row); }, creatPaper() { this.$refs.addEditPaper.doShow(); }, - handleDelete(data) { + handleDelete(index, data) { this.$confirm('确定删除该试卷吗?', this.$t('global.tips'), { confirmButtonText: this.$t('global.confirm'), cancelButtonText: this.$t('global.cancel'),