From c8a72140af218ce312f92af80021d82b586d60d9 Mon Sep 17 00:00:00 2001 From: zhangsir Date: Fri, 26 Jul 2024 13:33:49 +0800 Subject: [PATCH 01/25] =?UTF-8?q?=E5=AF=BC=E5=87=BA=E4=BD=9C=E4=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/modules/courseStudy.js | 6 +++++- src/components/Study/manager.vue | 33 ++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 1 deletion(-) diff --git a/src/api/modules/courseStudy.js b/src/api/modules/courseStudy.js index 193420ab..e13a72c4 100644 --- a/src/api/modules/courseStudy.js +++ b/src/api/modules/courseStudy.js @@ -389,7 +389,10 @@ const followIds=function (data){ const myStudysFromES=function (data){ return ajax.post('/xboe/school/study/es/search',data); } - +//导出作业 +const homeworkExport=function (data){ + return ajax.get(`/xboe/m/course/portal/export?contentId=${data.contentId}&courseName=${data.courseName}`); +} /**根据id集合查询,传入的是id数组*/ const findByIds=function (ids){ return ajax.postJson('/xboe/school/study/es/list-by-ids',ids); @@ -425,6 +428,7 @@ export default { myExamList2, myCourseStudy, myStudysFromES, + homeworkExport, findByIds, deleteSignUp, ids, diff --git a/src/components/Study/manager.vue b/src/components/Study/manager.vue index 1cc1d5be..7ec869af 100644 --- a/src/components/Study/manager.vue +++ b/src/components/Study/manager.vue @@ -292,6 +292,7 @@ 搜索 + 导出全部作业 @@ -349,6 +350,7 @@ export default { data() { return { typePress: false, + isHomeWork: false, catalogRecordTree:[], catalogRecordList:[], resOwnerListMap:[], @@ -499,6 +501,32 @@ export default { } }); }, + downLoad(){ + if(this.learningSituation.list.length == 0){ + this.$message.warning('当前暂无数据'); + return + } + let params = { + courseName:this.manageStudyData.name, + contentId:this.contentId + } + apicourseStudy.homeworkExport(params).then(res=>{ + console.log(res,'res') + 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 + console.log(link.href); + link.setAttribute("download", "作业.xlsx"); + document.body.appendChild(link); + link.click(); + URL.revokeObjectURL(link.href) + document.body.removeChild(link); + }).catch(err=>{ + console.log(err,'err') + this.$message.warning(err.data.msg); + }) + }, handleSizeChangeSituation(val) { this.learningSituation.pageSize = val; this.learningSituation.pageIndex = 1; @@ -702,6 +730,11 @@ export default { }else{ this.typePress = false } + if(type == '作业'){ + this.isHomeWork = true + }else{ + this.isHomeWork = false + } this.contentId = row.id; this.study.catalogueShow = true; this.learningSituation.pageIndex = 1;//重置为第一页 From 0ce5fcfd2718fa165d5468502e2841219c91c9a0 Mon Sep 17 00:00:00 2001 From: zhangsir Date: Fri, 26 Jul 2024 15:27:17 +0800 Subject: [PATCH 02/25] =?UTF-8?q?=E5=AF=BC=E5=87=BA=E4=BD=9C=E4=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Study/manager.vue | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/Study/manager.vue b/src/components/Study/manager.vue index 7ec869af..e0851d1b 100644 --- a/src/components/Study/manager.vue +++ b/src/components/Study/manager.vue @@ -510,14 +510,15 @@ export default { courseName:this.manageStudyData.name, contentId:this.contentId } + window.open(`/systemapi/xboe/m/course/portal/export?contentId=${params.contentId}&courseName=${params.courseName}`) apicourseStudy.homeworkExport(params).then(res=>{ console.log(res,'res') const link = document.createElement('a');// 创建a标签 - let blob = new Blob([res], { type: 'application/vnd.ms-excel;charset=UTF-8' }); // 设置文件类型 + let blob = new Blob([res], { type: 'application/zip' }); // 设置文件类型 link.style.display = "none"; link.href = URL.createObjectURL(blob); // 创建URL console.log(link.href); - link.setAttribute("download", "作业.xlsx"); + link.setAttribute("download", "作业.zip"); document.body.appendChild(link); link.click(); URL.revokeObjectURL(link.href) From bc57a9fb156c38b1644828fae086032d4fc55c43 Mon Sep 17 00:00:00 2001 From: zhangsir Date: Mon, 29 Jul 2024 09:32:51 +0800 Subject: [PATCH 03/25] =?UTF-8?q?=E4=B8=8B=E8=BD=BD=E5=8F=AF=E8=83=BD?= =?UTF-8?q?=E5=AD=98=E5=9C=A8=E6=8A=A5=E9=94=99=EF=BC=8C=E4=B8=8D=E9=87=87?= =?UTF-8?q?=E7=94=A8open=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Study/manager.vue | 41 +++++++++++++++++++------------- 1 file changed, 24 insertions(+), 17 deletions(-) diff --git a/src/components/Study/manager.vue b/src/components/Study/manager.vue index e0851d1b..d6f5a7a7 100644 --- a/src/components/Study/manager.vue +++ b/src/components/Study/manager.vue @@ -336,6 +336,8 @@ import apiCoursePortal from "@/api/modules/coursePortal.js"; import { mapGetters,mapActions } from 'vuex'; import apiUser from '@/api/system/user.js'; import apiStudy from '@/api/modules/courseStudy.js'; +import { getToken } from '@/utils/token' +import axios from 'axios' export default { components: {auditCourse1,auditCourse2}, computed: { @@ -510,23 +512,28 @@ export default { courseName:this.manageStudyData.name, contentId:this.contentId } - window.open(`/systemapi/xboe/m/course/portal/export?contentId=${params.contentId}&courseName=${params.courseName}`) - apicourseStudy.homeworkExport(params).then(res=>{ - console.log(res,'res') - const link = document.createElement('a');// 创建a标签 - let blob = new Blob([res], { type: 'application/zip' }); // 设置文件类型 - link.style.display = "none"; - link.href = URL.createObjectURL(blob); // 创建URL - console.log(link.href); - link.setAttribute("download", "作业.zip"); - document.body.appendChild(link); - link.click(); - URL.revokeObjectURL(link.href) - document.body.removeChild(link); - }).catch(err=>{ - console.log(err,'err') - this.$message.warning(err.data.msg); - }) + // window.open(`/systemapi/xboe/m/course/portal/export?contentId=${params.contentId}&courseName=${params.courseName}`) + const url = `/systemapi/xboe/m/course/portal/export?contentId=${params.contentId}&courseName=${params.courseName}` + axios({ + method: 'get', + url: url, + responseType: 'blob', + headers: { 'X-Access-Token': getToken() } + }).then(res => { + console.log(res,'res') + this.resolveBlob(res, 'application/zip',`${params.courseName}【作业】`) + }) + }, + resolveBlob(res, mimeType,filename) { + const link = document.createElement('a');// 创建a标签 + let blob = new Blob([res.data], { type: mimeType }); // 设置文件类型 + link.style.display = "none"; + link.href = URL.createObjectURL(blob); // 创建URL + link.setAttribute("download", `${filename}`); + document.body.appendChild(link); + link.click(); + URL.revokeObjectURL(link.href); + document.body.removeChild(link); }, handleSizeChangeSituation(val) { this.learningSituation.pageSize = val; From 12af7714d01fcba94f8d172a2db5a358ffd41b85 Mon Sep 17 00:00:00 2001 From: zhangsir Date: Mon, 29 Jul 2024 14:05:57 +0800 Subject: [PATCH 04/25] =?UTF-8?q?=E4=B8=8B=E8=BD=BD=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E6=89=93=E4=B8=8D=E5=BC=80=EF=BC=8C=E6=94=BE=E5=BC=80open?= =?UTF-8?q?=E6=96=B9=E6=B3=95=EF=BC=8C=E6=9F=A5=E6=89=BE=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Study/manager.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Study/manager.vue b/src/components/Study/manager.vue index d6f5a7a7..8580c627 100644 --- a/src/components/Study/manager.vue +++ b/src/components/Study/manager.vue @@ -512,7 +512,7 @@ export default { courseName:this.manageStudyData.name, contentId:this.contentId } - // window.open(`/systemapi/xboe/m/course/portal/export?contentId=${params.contentId}&courseName=${params.courseName}`) + window.open(`/systemapi/xboe/m/course/portal/export?contentId=${params.contentId}&courseName=${params.courseName}`) const url = `/systemapi/xboe/m/course/portal/export?contentId=${params.contentId}&courseName=${params.courseName}` axios({ method: 'get', From f96dc808d03f45b676efe42f229bb2346cefb151 Mon Sep 17 00:00:00 2001 From: zhangsir Date: Mon, 29 Jul 2024 15:54:16 +0800 Subject: [PATCH 05/25] =?UTF-8?q?=E6=96=87=E4=BB=B6=E9=97=AE=E9=A2=98?= =?UTF-8?q?=EF=BC=8C=E8=BF=98=E5=8E=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Study/manager.vue | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/Study/manager.vue b/src/components/Study/manager.vue index 8580c627..5b875183 100644 --- a/src/components/Study/manager.vue +++ b/src/components/Study/manager.vue @@ -192,7 +192,7 @@ --> @@ -512,7 +512,7 @@ export default { courseName:this.manageStudyData.name, contentId:this.contentId } - window.open(`/systemapi/xboe/m/course/portal/export?contentId=${params.contentId}&courseName=${params.courseName}`) + // window.open(`/systemapi/xboe/m/course/portal/export?contentId=${params.contentId}&courseName=${params.courseName}`) const url = `/systemapi/xboe/m/course/portal/export?contentId=${params.contentId}&courseName=${params.courseName}` axios({ method: 'get', @@ -733,12 +733,12 @@ export default { this.getSignupList(); }, getCatalogue(row,type) { - if(type=='考试'){ + if(type==61){ this.typePress = true }else{ this.typePress = false } - if(type == '作业'){ + if(type == 60){ this.isHomeWork = true }else{ this.isHomeWork = false From f8b74fa7230a36561856789bdf70027ba6eb65b4 Mon Sep 17 00:00:00 2001 From: zhangsir Date: Tue, 30 Jul 2024 15:35:14 +0800 Subject: [PATCH 06/25] =?UTF-8?q?=E5=AF=BC=E5=87=BA=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E5=8F=82=E6=95=B0=E4=BF=AE=E6=94=B9=E5=8F=8A?= =?UTF-8?q?=E6=8A=A5=E9=94=99=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Study/manager.vue | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/src/components/Study/manager.vue b/src/components/Study/manager.vue index 5b875183..1d78adfe 100644 --- a/src/components/Study/manager.vue +++ b/src/components/Study/manager.vue @@ -510,19 +510,38 @@ export default { } let params = { courseName:this.manageStudyData.name, - contentId:this.contentId + courseId: this.manageStudyData.id, + status: this.learningSituation.status, + name: this.learningSituation.name, + contentId: this.contentId, } // window.open(`/systemapi/xboe/m/course/portal/export?contentId=${params.contentId}&courseName=${params.courseName}`) - const url = `/systemapi/xboe/m/course/portal/export?contentId=${params.contentId}&courseName=${params.courseName}` + const url = `/systemapi/xboe/m/course/portal/export?contentId=${params.contentId}&courseName=${params.courseName}&courseId=${params.courseId}&status=${params.status}&name=${params.name}` axios({ method: 'get', url: url, responseType: 'blob', headers: { 'X-Access-Token': getToken() } - }).then(res => { - console.log(res,'res') - this.resolveBlob(res, 'application/zip',`${params.courseName}【作业】`) - }) + }).then((res) => { + const reader = new FileReader(); + reader.onload = function(e) { + console.log(res,e,'----res---e---') + try { + const result = JSON.parse(e.target.result); + if (result.status === 200 || result.success) { + // 下载文件 + this.resolveBlob(res, 'application/zip',`${params.courseName}【作业】`) + } else { + this.$message.error(result.message); + } + } catch (error) { + this.resolveBlob(res, 'application/zip',`${params.courseName}【作业】`) + } + }; + reader.readAsText(res.data); + }).catch((error) => { + this.$message.error(error.response ? error.response.data.message : error.toString()); + }); }, resolveBlob(res, mimeType,filename) { const link = document.createElement('a');// 创建a标签 From 96a11b24e529b234cf29bcb9233c6ed335cad6a7 Mon Sep 17 00:00:00 2001 From: zhangsir Date: Tue, 30 Jul 2024 16:04:14 +0800 Subject: [PATCH 07/25] =?UTF-8?q?=E5=AF=BC=E5=87=BA=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E5=AE=9E=E6=97=B6=E5=8F=82=E6=95=B0=E6=94=B9?= =?UTF-8?q?=E4=B8=BA=E6=90=9C=E7=B4=A2=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Study/manager.vue | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/src/components/Study/manager.vue b/src/components/Study/manager.vue index 1d78adfe..721c67e3 100644 --- a/src/components/Study/manager.vue +++ b/src/components/Study/manager.vue @@ -351,6 +351,7 @@ export default { }, data() { return { + downParams: {}, typePress: false, isHomeWork: false, catalogRecordTree:[], @@ -494,6 +495,7 @@ export default { pageIndex: this.learningSituation.pageIndex, pageSize: this.learningSituation.pageSize }; + this.downParams = params; apicourseStudy.studyContentRecords(params).then(res => { if (res.status === 200) { this.learningSituation.list = res.result.list; @@ -511,8 +513,8 @@ export default { let params = { courseName:this.manageStudyData.name, courseId: this.manageStudyData.id, - status: this.learningSituation.status, - name: this.learningSituation.name, + status: this.downParams.status || '', + name: this.downParams.name || '', contentId: this.contentId, } // window.open(`/systemapi/xboe/m/course/portal/export?contentId=${params.contentId}&courseName=${params.courseName}`) @@ -526,16 +528,12 @@ export default { const reader = new FileReader(); reader.onload = function(e) { console.log(res,e,'----res---e---') - try { - const result = JSON.parse(e.target.result); - if (result.status === 200 || result.success) { - // 下载文件 - this.resolveBlob(res, 'application/zip',`${params.courseName}【作业】`) - } else { - this.$message.error(result.message); - } - } catch (error) { + const result = JSON.parse(e.target.result); + if (result.status === 200 || result.success) { + // 下载文件 this.resolveBlob(res, 'application/zip',`${params.courseName}【作业】`) + } else { + this.$message.error(result.message); } }; reader.readAsText(res.data); From 02174f07939fd5ff4d1ac2d04023b3b60d6bbd46 Mon Sep 17 00:00:00 2001 From: zhangsir Date: Tue, 30 Jul 2024 16:17:27 +0800 Subject: [PATCH 08/25] =?UTF-8?q?=E6=9F=A5=E6=89=BE=E4=B8=8B=E8=BD=BD?= =?UTF-8?q?=E6=8A=A5=E9=94=99=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Study/manager.vue | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/components/Study/manager.vue b/src/components/Study/manager.vue index 721c67e3..c1736e76 100644 --- a/src/components/Study/manager.vue +++ b/src/components/Study/manager.vue @@ -517,8 +517,16 @@ export default { name: this.downParams.name || '', contentId: this.contentId, } - // window.open(`/systemapi/xboe/m/course/portal/export?contentId=${params.contentId}&courseName=${params.courseName}`) + window.open(`/systemapi/xboe/m/course/portal/export?contentId=${params.contentId}&courseName=${params.courseName}&courseId=${params.courseId}&status=${params.status}&name=${params.name}`) const url = `/systemapi/xboe/m/course/portal/export?contentId=${params.contentId}&courseName=${params.courseName}&courseId=${params.courseId}&status=${params.status}&name=${params.name}` + axios({ + method: 'get', + url: url, + responseType: 'blob', + headers: { 'X-Access-Token': getToken() } + }).then((res) => { + this.resolveBlob(res, 'application/zip',`${params.courseName}【作业】`) + }) axios({ method: 'get', url: url, From e858021565a760f2ac2fbe99e2887b132f0a2a13 Mon Sep 17 00:00:00 2001 From: zhangsir Date: Wed, 31 Jul 2024 14:29:46 +0800 Subject: [PATCH 09/25] =?UTF-8?q?=E5=AF=BC=E5=87=BA=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=EF=BC=8C=E6=8A=A5=E9=94=99=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Study/manager.vue | 33 ++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/src/components/Study/manager.vue b/src/components/Study/manager.vue index c1736e76..ffd2d064 100644 --- a/src/components/Study/manager.vue +++ b/src/components/Study/manager.vue @@ -517,7 +517,7 @@ export default { name: this.downParams.name || '', contentId: this.contentId, } - window.open(`/systemapi/xboe/m/course/portal/export?contentId=${params.contentId}&courseName=${params.courseName}&courseId=${params.courseId}&status=${params.status}&name=${params.name}`) + // window.open(`/systemapi/xboe/m/course/portal/export?contentId=${params.contentId}&courseName=${params.courseName}&courseId=${params.courseId}&status=${params.status}&name=${params.name}`) const url = `/systemapi/xboe/m/course/portal/export?contentId=${params.contentId}&courseName=${params.courseName}&courseId=${params.courseId}&status=${params.status}&name=${params.name}` axios({ method: 'get', @@ -532,22 +532,23 @@ export default { url: url, responseType: 'blob', headers: { 'X-Access-Token': getToken() } - }).then((res) => { - const reader = new FileReader(); - reader.onload = function(e) { - console.log(res,e,'----res---e---') - const result = JSON.parse(e.target.result); - if (result.status === 200 || result.success) { - // 下载文件 - this.resolveBlob(res, 'application/zip',`${params.courseName}【作业】`) - } else { - this.$message.error(result.message); + }).then((response) => { + if (response.status === 200) { + if (!(response.headers['content-type']).startsWith('application/json')) { + this.resolveBlob(response, 'application/zip', `${params.courseName}【作业】`); + } else { + const reader = new FileReader(); + reader.onload = function(e) { + const errorData = JSON.parse(e.target.result); + this.$message.error(errorData.message); + }; + reader.readAsText(response.data); + } } - }; - reader.readAsText(res.data); - }).catch((error) => { - this.$message.error(error.response ? error.response.data.message : error.toString()); - }); + }).catch((error) => { + // 错误处理 + this.$message.error(error.response ? error.response.data.message : error.toString()); + }); }, resolveBlob(res, mimeType,filename) { const link = document.createElement('a');// 创建a标签 From 0bec37eb8dab62254df56349517bf520b136409f Mon Sep 17 00:00:00 2001 From: zhangsir Date: Wed, 31 Jul 2024 14:41:40 +0800 Subject: [PATCH 10/25] =?UTF-8?q?=E5=AF=BC=E5=87=BA=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E7=AD=89=E5=BE=85=E9=94=99=E8=AF=AF=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=EF=BC=8C=E6=B5=8B=E8=AF=95=E9=94=99=E8=AF=AF=E5=A4=84?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Study/manager.vue | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/components/Study/manager.vue b/src/components/Study/manager.vue index ffd2d064..411f6e57 100644 --- a/src/components/Study/manager.vue +++ b/src/components/Study/manager.vue @@ -519,14 +519,14 @@ export default { } // window.open(`/systemapi/xboe/m/course/portal/export?contentId=${params.contentId}&courseName=${params.courseName}&courseId=${params.courseId}&status=${params.status}&name=${params.name}`) const url = `/systemapi/xboe/m/course/portal/export?contentId=${params.contentId}&courseName=${params.courseName}&courseId=${params.courseId}&status=${params.status}&name=${params.name}` - axios({ - method: 'get', - url: url, - responseType: 'blob', - headers: { 'X-Access-Token': getToken() } - }).then((res) => { - this.resolveBlob(res, 'application/zip',`${params.courseName}【作业】`) - }) + // axios({ + // method: 'get', + // url: url, + // responseType: 'blob', + // headers: { 'X-Access-Token': getToken() } + // }).then((res) => { + // this.resolveBlob(res, 'application/zip',`${params.courseName}【作业】`) + // }) axios({ method: 'get', url: url, From a6a2ba574e6578cba941d1270d24a73df69e03b4 Mon Sep 17 00:00:00 2001 From: zhangsir Date: Wed, 31 Jul 2024 17:17:19 +0800 Subject: [PATCH 11/25] =?UTF-8?q?=E6=89=93=E5=8D=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Study/manager.vue | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/Study/manager.vue b/src/components/Study/manager.vue index 411f6e57..a670394e 100644 --- a/src/components/Study/manager.vue +++ b/src/components/Study/manager.vue @@ -539,6 +539,7 @@ export default { } else { const reader = new FileReader(); reader.onload = function(e) { + console.log(e,'eeeeeee') const errorData = JSON.parse(e.target.result); this.$message.error(errorData.message); }; @@ -547,7 +548,8 @@ export default { } }).catch((error) => { // 错误处理 - this.$message.error(error.response ? error.response.data.message : error.toString()); + console.log(error,'error') + this.$message.error(error.data ? error.data.message : error.toString()); }); }, resolveBlob(res, mimeType,filename) { From 10d1e5fda890e8b94fd77a31fec1f770aff3b7aa Mon Sep 17 00:00:00 2001 From: zhangsir Date: Wed, 31 Jul 2024 17:38:42 +0800 Subject: [PATCH 12/25] =?UTF-8?q?=E6=89=93=E5=8D=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Study/manager.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/Study/manager.vue b/src/components/Study/manager.vue index a670394e..0f05e1dc 100644 --- a/src/components/Study/manager.vue +++ b/src/components/Study/manager.vue @@ -548,7 +548,8 @@ export default { } }).catch((error) => { // 错误处理 - console.log(error,'error') + console.dir(error); + console.log('Error Message:', error.message); this.$message.error(error.data ? error.data.message : error.toString()); }); }, From d382b4f07d95535f926184be5644b8bcb4d055b3 Mon Sep 17 00:00:00 2001 From: zhangsir Date: Wed, 31 Jul 2024 17:59:37 +0800 Subject: [PATCH 13/25] =?UTF-8?q?=E6=89=93=E5=8D=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Study/manager.vue | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/components/Study/manager.vue b/src/components/Study/manager.vue index 0f05e1dc..27cc9de7 100644 --- a/src/components/Study/manager.vue +++ b/src/components/Study/manager.vue @@ -548,8 +548,14 @@ export default { } }).catch((error) => { // 错误处理 - console.dir(error); - console.log('Error Message:', error.message); + console.log(error); + const reader = new FileReader(); + reader.onload = function(e) { + console.log(e,'eeeeeee') + const errorData = JSON.parse(e.target.result); + this.$message.error(errorData.message); + }; + reader.readAsText(error); this.$message.error(error.data ? error.data.message : error.toString()); }); }, From 40170ed78619ce84a09e60af8b40792ced1e9a3c Mon Sep 17 00:00:00 2001 From: zhangsir Date: Wed, 31 Jul 2024 19:01:38 +0800 Subject: [PATCH 14/25] =?UTF-8?q?=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Study/manager.vue | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/components/Study/manager.vue b/src/components/Study/manager.vue index 27cc9de7..1d2db5a0 100644 --- a/src/components/Study/manager.vue +++ b/src/components/Study/manager.vue @@ -539,9 +539,8 @@ export default { } else { const reader = new FileReader(); reader.onload = function(e) { - console.log(e,'eeeeeee') const errorData = JSON.parse(e.target.result); - this.$message.error(errorData.message); + this.$message.error(errorData.result); }; reader.readAsText(response.data); } @@ -549,13 +548,6 @@ export default { }).catch((error) => { // 错误处理 console.log(error); - const reader = new FileReader(); - reader.onload = function(e) { - console.log(e,'eeeeeee') - const errorData = JSON.parse(e.target.result); - this.$message.error(errorData.message); - }; - reader.readAsText(error); this.$message.error(error.data ? error.data.message : error.toString()); }); }, From 2ad7225afdb82177903a447c160dcf2fb3ad1628 Mon Sep 17 00:00:00 2001 From: zhangsir Date: Wed, 31 Jul 2024 19:08:48 +0800 Subject: [PATCH 15/25] =?UTF-8?q?=E6=89=93=E5=8D=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Study/manager.vue | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/Study/manager.vue b/src/components/Study/manager.vue index 1d2db5a0..3b5639af 100644 --- a/src/components/Study/manager.vue +++ b/src/components/Study/manager.vue @@ -539,8 +539,11 @@ export default { } else { const reader = new FileReader(); reader.onload = function(e) { + console.log(e,'e') const errorData = JSON.parse(e.target.result); - this.$message.error(errorData.result); + console.log(errorData,'errorData') + console.log(errorData.result,errorData.message,'errorData.result') + // this.$message.error(errorData.result); }; reader.readAsText(response.data); } From 37b9dc8b5043997e800ad034c8dea3f5c93ee33e Mon Sep 17 00:00:00 2001 From: zhangsir Date: Wed, 31 Jul 2024 19:14:19 +0800 Subject: [PATCH 16/25] =?UTF-8?q?=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Study/manager.vue | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/components/Study/manager.vue b/src/components/Study/manager.vue index 3b5639af..23b7b0ad 100644 --- a/src/components/Study/manager.vue +++ b/src/components/Study/manager.vue @@ -539,11 +539,8 @@ export default { } else { const reader = new FileReader(); reader.onload = function(e) { - console.log(e,'e') const errorData = JSON.parse(e.target.result); - console.log(errorData,'errorData') - console.log(errorData.result,errorData.message,'errorData.result') - // this.$message.error(errorData.result); + this.$message.error(errorData.result.toString()); }; reader.readAsText(response.data); } From 35010c7dd6298fbb183f3200e8119a6e0f8849ae Mon Sep 17 00:00:00 2001 From: zhangsir Date: Wed, 31 Jul 2024 19:24:25 +0800 Subject: [PATCH 17/25] =?UTF-8?q?=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Study/manager.vue | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/components/Study/manager.vue b/src/components/Study/manager.vue index 23b7b0ad..79483685 100644 --- a/src/components/Study/manager.vue +++ b/src/components/Study/manager.vue @@ -539,8 +539,11 @@ export default { } else { const reader = new FileReader(); reader.onload = function(e) { - const errorData = JSON.parse(e.target.result); - this.$message.error(errorData.result.toString()); + const errorData = JSON.parse(e.target.result) + console.log(errorData.result,'result') + const message = errorData.result + this.$message.error(message) + this.$message.error(errorData.result) }; reader.readAsText(response.data); } From 485c4019436ba7745d10332a214f978817e1188d Mon Sep 17 00:00:00 2001 From: zhangsir Date: Thu, 1 Aug 2024 08:57:40 +0800 Subject: [PATCH 18/25] =?UTF-8?q?=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Study/manager.vue | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/components/Study/manager.vue b/src/components/Study/manager.vue index 79483685..332053d0 100644 --- a/src/components/Study/manager.vue +++ b/src/components/Study/manager.vue @@ -537,12 +537,10 @@ export default { if (!(response.headers['content-type']).startsWith('application/json')) { this.resolveBlob(response, 'application/zip', `${params.courseName}【作业】`); } else { + console.log(response,'response') const reader = new FileReader(); - reader.onload = function(e) { + reader.onload = (e) => { const errorData = JSON.parse(e.target.result) - console.log(errorData.result,'result') - const message = errorData.result - this.$message.error(message) this.$message.error(errorData.result) }; reader.readAsText(response.data); From 6bf754b5dcfad0a0050f71579585a9cc404edff7 Mon Sep 17 00:00:00 2001 From: zhangsir Date: Fri, 2 Aug 2024 11:25:34 +0800 Subject: [PATCH 19/25] =?UTF-8?q?=E5=9C=A8=E7=BA=BF=E8=AF=BE=E5=8D=95?= =?UTF-8?q?=E5=B1=82=E9=A1=B9=E7=9B=AE=E6=B7=BB=E5=8A=A0=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Course/weikeContent.vue | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/components/Course/weikeContent.vue b/src/components/Course/weikeContent.vue index f7177860..69bfa1bd 100644 --- a/src/components/Course/weikeContent.vue +++ b/src/components/Course/weikeContent.vue @@ -1049,6 +1049,7 @@ this.cwareChange.curriculumData = deepClone(this.cware.curriculumData) } }else if(index==2){ + this.homework.content.contentName = this.homework.info.name postData.content=this.homework.content; postData.homework=this.homework.info; this.homeworkChange = deepClone(this.homework) @@ -1087,9 +1088,11 @@ this.exam.info.paperContent=JSON.stringify(this.exam.paperJson); } postData.exam=this.exam.info; + postData.content.contentName='考试'; this.examChange = deepClone(this.exam); }else if(index==4){ this.assess.content.content=JSON.stringify(this.assess.json); + this.assess.content.contentName='评估'; postData.content=this.assess.content; } From c0833c56d805788801cd60c7c78dbca97c90a3ce Mon Sep 17 00:00:00 2001 From: zhangsir Date: Fri, 2 Aug 2024 17:51:14 +0800 Subject: [PATCH 20/25] =?UTF-8?q?=E5=AF=BC=E5=87=BA=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E4=B8=8D=E8=83=BD=E9=87=8D=E5=A4=8D=E7=82=B9=E5=87=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Study/manager.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/Study/manager.vue b/src/components/Study/manager.vue index 332053d0..8b810c98 100644 --- a/src/components/Study/manager.vue +++ b/src/components/Study/manager.vue @@ -292,7 +292,7 @@ 搜索 - 导出全部作业 + 导出全部作业 @@ -354,6 +354,7 @@ export default { downParams: {}, typePress: false, isHomeWork: false, + isTrue: false, catalogRecordTree:[], catalogRecordList:[], resOwnerListMap:[], @@ -510,6 +511,7 @@ export default { this.$message.warning('当前暂无数据'); return } + this.isTrue = true; let params = { courseName:this.manageStudyData.name, courseId: this.manageStudyData.id, @@ -534,6 +536,7 @@ export default { headers: { 'X-Access-Token': getToken() } }).then((response) => { if (response.status === 200) { + this.isTrue = false; if (!(response.headers['content-type']).startsWith('application/json')) { this.resolveBlob(response, 'application/zip', `${params.courseName}【作业】`); } else { @@ -547,6 +550,7 @@ export default { } } }).catch((error) => { + this.isTrue = false; // 错误处理 console.log(error); this.$message.error(error.data ? error.data.message : error.toString()); From c1a0fe988f2f55c099040dec113c3edcf1645a84 Mon Sep 17 00:00:00 2001 From: zhangsir Date: Mon, 5 Aug 2024 15:03:44 +0800 Subject: [PATCH 21/25] =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E6=8F=90=E4=BA=A4study?= =?UTF-8?q?itemid=E8=B5=8B=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Course/homework.vue | 12 +++++++++--- src/components/Course/weikeContent.vue | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/components/Course/homework.vue b/src/components/Course/homework.vue index 978d45b0..584a446f 100644 --- a/src/components/Course/homework.vue +++ b/src/components/Course/homework.vue @@ -37,7 +37,7 @@
- {{records.length>0?'重新提交':'提交'}} + {{records.length>0?'重新提交':'提交'}}
@@ -87,10 +87,12 @@ export default { has:true, info:{}, studyItemId:'', + studyItemIdOnce: '', filePath:'', answer:'', close:false, records:[],//作业记录 + isSubmit:false, }; }, mounted() { @@ -135,6 +137,9 @@ export default { apiCourseStudy.myHomeworkList(params).then(rs=>{ if(rs.status==200){ this.records=rs.result; + if(rs.result.length>0){ + this.studyItemIdOnce = rs.result[rs.result.length - 1].id; + } } }) }, @@ -171,9 +176,9 @@ export default { return; } } - + this.isSubmit = true let pamars = { - studyItemId: this.studyItemId,//学习内容记录id, + studyItemId: this.studyItemId || this.studyItemIdOnce,//学习内容记录id, studyId: this.studyId,//学习id, courseId: this.content.courseId,//课程id, contentId: this.content.id,//内容id, @@ -185,6 +190,7 @@ export default { score: 0 } apiCourseStudy.saveHomework(pamars).then(res=>{ + this.isSubmit = false if(res.status==200){ this.$message.success("作业已提交"); this.filePath=''; diff --git a/src/components/Course/weikeContent.vue b/src/components/Course/weikeContent.vue index 69bfa1bd..f8310736 100644 --- a/src/components/Course/weikeContent.vue +++ b/src/components/Course/weikeContent.vue @@ -1049,7 +1049,7 @@ this.cwareChange.curriculumData = deepClone(this.cware.curriculumData) } }else if(index==2){ - this.homework.content.contentName = this.homework.info.name + this.homework.content.contentName = this.homework.info.name || '作业' postData.content=this.homework.content; postData.homework=this.homework.info; this.homeworkChange = deepClone(this.homework) From 30c4899ebc072837c1e7e5f7ecac424169fdafb8 Mon Sep 17 00:00:00 2001 From: zhangsir Date: Mon, 5 Aug 2024 15:17:03 +0800 Subject: [PATCH 22/25] =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E6=8F=90=E4=BA=A4?= =?UTF-8?q?=E5=8F=91=E7=8E=B0=E5=88=87=E6=8D=A2=E4=BD=9C=E4=B8=9A=E6=97=B6?= =?UTF-8?q?studyitemid=E5=8F=96=E5=80=BC=E4=B8=8A=E4=B8=80=E4=B8=AA?= =?UTF-8?q?=EF=BC=8C=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Course/homework.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/Course/homework.vue b/src/components/Course/homework.vue index 584a446f..6f3912e9 100644 --- a/src/components/Course/homework.vue +++ b/src/components/Course/homework.vue @@ -136,6 +136,7 @@ export default { } apiCourseStudy.myHomeworkList(params).then(rs=>{ if(rs.status==200){ + this.studyItemId = '' this.records=rs.result; if(rs.result.length>0){ this.studyItemIdOnce = rs.result[rs.result.length - 1].id; From 7b6993e58dbfb640a4a3579feefd9bf840a338d5 Mon Sep 17 00:00:00 2001 From: zhangsir Date: Tue, 6 Aug 2024 08:58:56 +0800 Subject: [PATCH 23/25] =?UTF-8?q?=E6=95=B4=E4=BD=93=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=AF=BC=E5=87=BA=E4=BD=9C=E4=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Study/manager.vue | 69 ++++++++++++++++++-------------- 1 file changed, 40 insertions(+), 29 deletions(-) diff --git a/src/components/Study/manager.vue b/src/components/Study/manager.vue index 8b810c98..f3f949e4 100644 --- a/src/components/Study/manager.vue +++ b/src/components/Study/manager.vue @@ -521,40 +521,51 @@ export default { } // window.open(`/systemapi/xboe/m/course/portal/export?contentId=${params.contentId}&courseName=${params.courseName}&courseId=${params.courseId}&status=${params.status}&name=${params.name}`) const url = `/systemapi/xboe/m/course/portal/export?contentId=${params.contentId}&courseName=${params.courseName}&courseId=${params.courseId}&status=${params.status}&name=${params.name}` + axios({ + method: 'get', + url: url, + // responseType: 'blob', + headers: { 'X-Access-Token': getToken() } + }).then((res) => { + this.isTrue = false; + console.log(res,'res') + if(res.data.status == 200){ + if(res.data.result.includes('home')){ + window.open(res.data.result) + }else{ + this.$message.warning(res.data.result) + } + } + }).catch(err=>{ + this.isTrue = false; + this.$message.error(err.data.message) + }) // axios({ // method: 'get', // url: url, // responseType: 'blob', // headers: { 'X-Access-Token': getToken() } - // }).then((res) => { - // this.resolveBlob(res, 'application/zip',`${params.courseName}【作业】`) - // }) - axios({ - method: 'get', - url: url, - responseType: 'blob', - headers: { 'X-Access-Token': getToken() } - }).then((response) => { - if (response.status === 200) { - this.isTrue = false; - if (!(response.headers['content-type']).startsWith('application/json')) { - this.resolveBlob(response, 'application/zip', `${params.courseName}【作业】`); - } else { - console.log(response,'response') - const reader = new FileReader(); - reader.onload = (e) => { - const errorData = JSON.parse(e.target.result) - this.$message.error(errorData.result) - }; - reader.readAsText(response.data); - } - } - }).catch((error) => { - this.isTrue = false; - // 错误处理 - console.log(error); - this.$message.error(error.data ? error.data.message : error.toString()); - }); + // }).then((response) => { + // if (response.status === 200) { + // this.isTrue = false; + // if (!(response.headers['content-type']).startsWith('application/json')) { + // this.resolveBlob(response, 'application/zip', `${params.courseName}【作业】`); + // } else { + // console.log(response,'response') + // const reader = new FileReader(); + // reader.onload = (e) => { + // const errorData = JSON.parse(e.target.result) + // this.$message.error(errorData.result) + // }; + // reader.readAsText(response.data); + // } + // } + // }).catch((error) => { + // this.isTrue = false; + // // 错误处理 + // console.log(error); + // this.$message.error(error.data ? error.data.message : error.toString()); + // }); }, resolveBlob(res, mimeType,filename) { const link = document.createElement('a');// 创建a标签 From 184427d331c42b7cbc4da3bf8e7cd4e77e2d05c3 Mon Sep 17 00:00:00 2001 From: zhangsir Date: Tue, 6 Aug 2024 09:11:58 +0800 Subject: [PATCH 24/25] =?UTF-8?q?=E6=95=B4=E4=BD=93=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=AF=BC=E5=87=BA=E4=BD=9C=E4=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Study/manager.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/Study/manager.vue b/src/components/Study/manager.vue index f3f949e4..8d7254d7 100644 --- a/src/components/Study/manager.vue +++ b/src/components/Study/manager.vue @@ -530,8 +530,8 @@ export default { this.isTrue = false; console.log(res,'res') if(res.data.status == 200){ - if(res.data.result.includes('home')){ - window.open(res.data.result) + if(res.data.result.includes('upload')){ + window.open('/upload'+res.data.result.split('upload')[1]) }else{ this.$message.warning(res.data.result) } From cd3f693b4450c04af512d4ce0b16bbd6d7a11d85 Mon Sep 17 00:00:00 2001 From: zhangsir Date: Tue, 6 Aug 2024 17:10:06 +0800 Subject: [PATCH 25/25] =?UTF-8?q?=E5=AF=BC=E5=87=BA=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E7=BB=9F=E4=B8=80=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Study/manager.vue | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/components/Study/manager.vue b/src/components/Study/manager.vue index 8d7254d7..47d8bf72 100644 --- a/src/components/Study/manager.vue +++ b/src/components/Study/manager.vue @@ -508,7 +508,7 @@ export default { }, downLoad(){ if(this.learningSituation.list.length == 0){ - this.$message.warning('当前暂无数据'); + this.$message.warning('暂无数据'); return } this.isTrue = true; @@ -528,7 +528,6 @@ export default { headers: { 'X-Access-Token': getToken() } }).then((res) => { this.isTrue = false; - console.log(res,'res') if(res.data.status == 200){ if(res.data.result.includes('upload')){ window.open('/upload'+res.data.result.split('upload')[1])