From 8c59b44de1f45635832111ac37e1f1306b6148b7 Mon Sep 17 00:00:00 2001 From: joylink_zhaoerwei Date: Wed, 21 Feb 2024 16:38:20 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AB=9E=E8=B5=9B=E6=A8=A1=E5=9D=97=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 | 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'),