From 51efc63fb56ac2708089ca4e5d541432d08715ee Mon Sep 17 00:00:00 2001 From: 86182 Date: Fri, 19 Aug 2022 10:46:56 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E8=80=83=E8=AF=95=E6=88=90=E7=BB=A9?= =?UTF-8?q?=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/modules/test.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/api/modules/test.js b/src/api/modules/test.js index fea0bce1..1dcbb141 100644 --- a/src/api/modules/test.js +++ b/src/api/modules/test.js @@ -41,15 +41,25 @@ const pulish = function(id, publish) { if (!publish) { flag = publish; } - + return ajax.post('/xboe/m/exam/test/publish?id=' + id + '&publish=' + flag); } +/** + *@parma{ + * testId 考试id + *} + */ +const exports=function (query){ + return ajax.post('/xboe/m/exam/alone/answer/export',query); +} + export default { detail, update, del, save, querylist, - pulish + pulish, + exports } From 75669333e3b5ecc6024a8fcf094e6fccbe93180b Mon Sep 17 00:00:00 2001 From: zhaofang <752743406@qq.com> Date: Fri, 19 Aug 2022 13:58:58 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E6=88=90=E7=BB=A9=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/modules/test.js | 2 +- src/views/exam/ExamList.vue | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/src/api/modules/test.js b/src/api/modules/test.js index 1dcbb141..068039fc 100644 --- a/src/api/modules/test.js +++ b/src/api/modules/test.js @@ -51,7 +51,7 @@ const pulish = function(id, publish) { *} */ const exports=function (query){ - return ajax.post('/xboe/m/exam/alone/answer/export',query); + return ajax.post('/xboe/m/exam/alone/answer/export',query,{responseType: 'blob'}); } export default { diff --git a/src/views/exam/ExamList.vue b/src/views/exam/ExamList.vue index 977d30ae..649e7cd7 100644 --- a/src/views/exam/ExamList.vue +++ b/src/views/exam/ExamList.vue @@ -470,6 +470,7 @@
搜索 + 导出成绩
@@ -753,6 +754,26 @@ export default { this.loadData() }, methods: { + exportsList(){ + if(this.answerData.data.length == 0){ + return this.$message.warning('暂无导出数据!') + } + console.log(this.answerData.row.id,'this.answerData.row.id'); + apiTest.exports({testId: this.answerData.row.id}).then(res=>{ + if(res.status){ + this.$message.error(res.message) + } else { + const link = document.createElement('a');// 创建a标签 + let blob = new Blob([res],{type: 'application/vnd.ms-excel;charset=UTF-8'}); // 设置文件类型 + link.style.display = "none"; + link.href = URL.createObjectURL(blob); // 创建URL + link.setAttribute("download", "成绩.xls"); + document.body.appendChild(link); + link.click(); + document.body.removeChild(link); + } + }) + }, changePaper(e) { this.questDirOptions.forEach(item=>{ if(item.id == e) { From 5e2bf870ac3e5c6ae81656e705e835ad31b43dc9 Mon Sep 17 00:00:00 2001 From: zhaofang <752743406@qq.com> Date: Fri, 19 Aug 2022 14:11:10 +0800 Subject: [PATCH 3/3] =?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/views/StudyIndex.vue | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/views/StudyIndex.vue b/src/views/StudyIndex.vue index 3c44cc33..1adfa426 100644 --- a/src/views/StudyIndex.vue +++ b/src/views/StudyIndex.vue @@ -130,11 +130,15 @@ // cmtask_status:this.cmtask_status, // cmtask_name:this.cmtask_name, } + apiBoeCourse.cmtaskList(params).then(res=>{ if(res.status==200){ this.total = res.result.count this.couresList = res.result.list; this.loading = false; + if(this.$route.fullPath != '/uc/study/task' && this.$route.fullPath != '/uc/study/courses' && this.$route.fullPath != '/study/index') { + return; + } if(res.result.count > 0) { this.$router.push('/uc/study/task') } else { @@ -147,8 +151,10 @@ }else{ this.$router.push('/uc/study/courses') } - // this.pageData.list = res.result.list; }).catch(err=>{ + if(this.$route.fullPath != '/uc/study/task' || this.$route.fullPath != '/uc/study/courses' || this.$route.fullPath != '/study/index') { + return; + } this.$router.push('/uc/study/courses'); }) },