From 9d2420920c9a87fc79a1a8b34ff7ed09e029f88b Mon Sep 17 00:00:00 2001 From: joylink_zhaoerwei Date: Thu, 22 Feb 2024 17:14:55 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E7=AB=9E=E8=B5=9B=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=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 | 23 ++- .../ContestModuleManage.vue | 2 +- .../contestTaskManage/AddEditTask.vue | 142 ++++++++++++++ .../contestTaskManage/BindTask.vue | 97 ++++++++++ .../contestTaskManage/ContestTaskManage.vue | 180 +++++++++++++++++- 5 files changed, 436 insertions(+), 8 deletions(-) create mode 100644 src/views/contestDataManage/contestTaskManage/AddEditTask.vue create mode 100644 src/views/contestDataManage/contestTaskManage/BindTask.vue diff --git a/src/api/contest.js b/src/api/contest.js index 28c1cb141..910e8399a 100644 --- a/src/api/contest.js +++ b/src/api/contest.js @@ -175,6 +175,16 @@ export function deleteTask(id) { }); } +/** 查看任务详情 + * @param {Number} id 任务id + */ +export function getTaskDetail(id) { + return request({ + url: `/api/exercise/race/task/${id}`, + method: 'GET' + }); +} + /** 查看指定子任务 * @param {Number} id 任务id */ @@ -186,14 +196,15 @@ export function getchildrenTaskDatas(id) { } /** 任务绑定 - * @param {Object} data - * @param {Number} data.taskId 任务id - * @param {Number} data.bindId 绑定id,根据bindtype来区分对应的id - * @param {String} data.bindType rule =评分规则;scene=场景 + * @param {Array} data + * @param {Number} taskId 任务id + * @param {Number} data[i].bindId 绑定id,根据bindtype来区分对应的id + * @param {String} data[i].bindType rule =0评分规则;scene=1场景 + * @param {Number} data[i].status 0=绑定 ;1=解绑 */ -export function bindTask(data) { +export function bindTask(taskId, data) { return request({ - url: '/api/exercise/race/task/bind', + url: `/api/exercise/race/task/${taskId}/bind`, method: 'POST', data }); diff --git a/src/views/contestDataManage/contestModuleManage/ContestModuleManage.vue b/src/views/contestDataManage/contestModuleManage/ContestModuleManage.vue index 5dc4bd713..06bb777f8 100644 --- a/src/views/contestDataManage/contestModuleManage/ContestModuleManage.vue +++ b/src/views/contestDataManage/contestModuleManage/ContestModuleManage.vue @@ -141,7 +141,7 @@ export default { this.$refs.addEditModule.doShow(); }, handleDelete(data) { - this.$confirm('确定删除该试卷吗?', this.$t('global.tips'), { + this.$confirm('确定删除该模块吗?', this.$t('global.tips'), { confirmButtonText: this.$t('global.confirm'), cancelButtonText: this.$t('global.cancel'), type: 'warning' diff --git a/src/views/contestDataManage/contestTaskManage/AddEditTask.vue b/src/views/contestDataManage/contestTaskManage/AddEditTask.vue new file mode 100644 index 000000000..47897f6d4 --- /dev/null +++ b/src/views/contestDataManage/contestTaskManage/AddEditTask.vue @@ -0,0 +1,142 @@ + + + diff --git a/src/views/contestDataManage/contestTaskManage/BindTask.vue b/src/views/contestDataManage/contestTaskManage/BindTask.vue new file mode 100644 index 000000000..f36b8ca5d --- /dev/null +++ b/src/views/contestDataManage/contestTaskManage/BindTask.vue @@ -0,0 +1,97 @@ + + + diff --git a/src/views/contestDataManage/contestTaskManage/ContestTaskManage.vue b/src/views/contestDataManage/contestTaskManage/ContestTaskManage.vue index 0c78e8bc3..a0ebccab4 100644 --- a/src/views/contestDataManage/contestTaskManage/ContestTaskManage.vue +++ b/src/views/contestDataManage/contestTaskManage/ContestTaskManage.vue @@ -1,3 +1,181 @@ + + + + From f908c8db04591fa95cc9cd67147cecd77a5f96b6 Mon Sep 17 00:00:00 2001 From: joylink_zhaoerwei Date: Thu, 22 Feb 2024 17:19:06 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E5=8E=BB=E6=8E=89mock?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../contestTaskManage/ContestTaskManage.vue | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/views/contestDataManage/contestTaskManage/ContestTaskManage.vue b/src/views/contestDataManage/contestTaskManage/ContestTaskManage.vue index a0ebccab4..bf09399ae 100644 --- a/src/views/contestDataManage/contestTaskManage/ContestTaskManage.vue +++ b/src/views/contestDataManage/contestTaskManage/ContestTaskManage.vue @@ -81,16 +81,7 @@ export default { }; }, created() { - axios - .get( - 'http://127.0.0.1:4523/m1/1531717-0-default/api/exercise/race/task/tree' - ) - .then((response) => { - this.taskDta = this.transformTree(response.data); - }) - .catch((error) => { - console.log(error); - }); + this.getTreeData(); }, methods: { From ad8c8de231822742e4fa63e9a26a84a71f6b74cb Mon Sep 17 00:00:00 2001 From: joylink_zhaoerwei Date: Thu, 22 Feb 2024 17:56:55 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E5=BE=AE=E8=B0=83=EF=BC=8C=E5=BE=85?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../contestModuleManage/AddEditModule.vue | 6 ++-- .../ContestModuleManage.vue | 34 ++++--------------- .../contestSubjectManage/AddEditPaper.vue | 21 +++++------- .../ContestSubjectManage.vue | 12 +++++++ .../contestTaskManage/BindTask.vue | 20 +++++++---- .../contestTaskManage/ContestTaskManage.vue | 1 - 6 files changed, 44 insertions(+), 50 deletions(-) diff --git a/src/views/contestDataManage/contestModuleManage/AddEditModule.vue b/src/views/contestDataManage/contestModuleManage/AddEditModule.vue index fc43c8e65..8c5f02472 100644 --- a/src/views/contestDataManage/contestModuleManage/AddEditModule.vue +++ b/src/views/contestDataManage/contestModuleManage/AddEditModule.vue @@ -11,9 +11,9 @@ diff --git a/src/views/contestDataManage/contestModuleManage/ContestModuleManage.vue b/src/views/contestDataManage/contestModuleManage/ContestModuleManage.vue index 06bb777f8..d95e7a307 100644 --- a/src/views/contestDataManage/contestModuleManage/ContestModuleManage.vue +++ b/src/views/contestDataManage/contestModuleManage/ContestModuleManage.vue @@ -42,10 +42,6 @@ export default { paperName: { type: 'text', label: '试卷名称:' - }, - paperId: { - type: 'text', - label: '试卷id:' } } }, @@ -66,37 +62,21 @@ export default { title: '试卷名称', prop: 'paperName' }, - { - title: '试卷id', - prop: 'paperId' - }, { title: '考试时间', prop: 'duration' }, { title: '创建时间', - prop: 'createTime' + prop: 'createTime', + type: 'tag', + columnValue: (row) => { return row.modifyInfo.createTime; } }, { - title: '更新时间', - prop: 'updateTime' - }, - { - title: '创建者id', - prop: 'creatorId' - }, - { - title: '创建者姓名', - prop: 'creatorName' - }, - { - title: '更新者id', - prop: 'updaterId' - }, - { - title: '更新者姓名', - prop: 'updaterName' + title: '修改时间', + prop: 'updateTime', + type: 'tag', + columnValue: (row) => { return row.modifyInfo.updateTime; } }, { type: 'button', diff --git a/src/views/contestDataManage/contestSubjectManage/AddEditPaper.vue b/src/views/contestDataManage/contestSubjectManage/AddEditPaper.vue index ec7d4de00..8e5c0a90f 100644 --- a/src/views/contestDataManage/contestSubjectManage/AddEditPaper.vue +++ b/src/views/contestDataManage/contestSubjectManage/AddEditPaper.vue @@ -11,9 +11,9 @@ @@ -25,7 +25,7 @@