From 3fd1912c55767b75ecbf5c970a1f65599be98897 Mon Sep 17 00:00:00 2001 From: weinan2087 Date: Wed, 4 Jan 2023 16:45:16 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=AE=9E=E7=8E=B0=E5=89=A9=E4=BD=99?= =?UTF-8?q?=E5=AF=BC=E5=87=BA=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/course/Mylecnotes.vue | 45 +++++++++++++++++++++++++++++---- 1 file changed, 40 insertions(+), 5 deletions(-) diff --git a/src/views/course/Mylecnotes.vue b/src/views/course/Mylecnotes.vue index 60419fc9..2c18aab3 100644 --- a/src/views/course/Mylecnotes.vue +++ b/src/views/course/Mylecnotes.vue @@ -6,6 +6,7 @@
搜索
重置
导出
+
导出学员信息
@@ -57,7 +58,7 @@ width="100px" prop="score" > - +
@@ -109,10 +110,11 @@ export default { methods: { + // 导出所有记录 exportFile(){ let req = { userId: this.userInfo.sysId - // teacherId:"70F80F4E-34BA-10AB-894A-8FA812B19637" + // userId:"70F80F4E-34BA-10AB-894A-8FA812B19637" } apiCourse.courseRecordExport(req).then(res=>{ const link = document.createElement('a');// 创建a标签 @@ -126,9 +128,42 @@ export default { }) }, + + // 导出课程下的学员信息 + exportStudentOfCourse(courseId){ + let userId = this.userInfo.sysId; + apiCourse.exportStudentOfCourse(userId,courseId).then(res=>{ + const link = document.createElement('a');// 创建a标签 + let blob = new Blob([res.data],{type: 'application/vnd.ms-excel'}); // 设置文件类型 + link.style.display = "none"; + link.href = URL.createObjectURL(blob); // 创建URL + link.setAttribute("download", "授课记录.xls"); + document.body.appendChild(link); + link.click(); + document.body.removeChild(link); + }) + }, + + // 导出教师下的所有授课记录下的学员信息 + exportStudentOfTearcher(){ + let userId = this.userInfo.sysId; + // let userId = '5D36C207-64F4-C512-312D-C9598257695C'; + apiCourse.exportStudentOfTearcher(userId).then(res=>{ + const link = document.createElement('a');// 创建a标签 + let blob = new Blob([res.data],{type: 'application/vnd.ms-excel'}); // 设置文件类型 + link.style.display = "none"; + link.href = URL.createObjectURL(blob); // 创建URL + link.setAttribute("download", "授课记录.xls"); + document.body.appendChild(link); + link.click(); + document.body.removeChild(link); + }) + }, + + recordList(pageIndex){ let req = { - //     teacherId:"70F80F4E-34BA-10AB-894A-8FA812B19637", + //     userId:"6B049FAF-C314-7CCF-0D28-0D23F4C42531", userId: this.userInfo.sysId, keyword:this.keyword,     page:pageIndex, From af0e54c8df97f3dd3675f37d48bb8250c423afa5 Mon Sep 17 00:00:00 2001 From: weinan2087 Date: Wed, 4 Jan 2023 16:46:25 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/boe/courseRecord.js | 40 ++++++++++++++++++++++++++++++++----- 1 file changed, 35 insertions(+), 5 deletions(-) diff --git a/src/api/boe/courseRecord.js b/src/api/boe/courseRecord.js index 33dda498..696904b6 100644 --- a/src/api/boe/courseRecord.js +++ b/src/api/boe/courseRecord.js @@ -9,7 +9,7 @@ const baseURL = process.env.VUE_APP_BOE_BASE_API; /** * 导出授课记录 * - * @param {Object} kid + * @param {Object} data */ const courseRecordExport = function(data) { return axios.request({ @@ -20,14 +20,42 @@ const courseRecordExport = function(data) { headers:{'Content-Type':'application/json;charset=utf-8'}, responseType: 'blob' }) - - // return ajax.postJson('/b1/system/teacher/teacher-course-export',data); } +/** + * 导出课程下的学员信息 + * + */ +const exportStudentOfCourse = function(userId,courseId) { + return axios.request({ + baseURL, + url: '/b1/system/teacher/teacher-course-student-export?userId='+userId+'&courseId='+courseId, + method: 'post', + headers:{'Content-Type':'application/json;charset=utf-8'}, + responseType: 'blob' + }) +} + +/** + * 导出教师下的所有授课记录下的学员信息 + * + */ +const exportStudentOfTearcher = function(userId) { + return axios.request({ + baseURL, + url: '/b1/system/teacher/teacher-course-student-export?userId='+userId, + method: 'post', + headers:{'Content-Type':'application/json;charset=utf-8'}, + responseType: 'blob' + }) +} + + + /** * 授课记录列表 * - * @param {Object} kid + * @param {Object} data */ const courseRecordList = function(data) { return ajax.postJson('/b1/system/teacher/teacher-course-list',data); @@ -37,6 +65,8 @@ const courseRecordList = function(data) { export default { courseRecordExport, - courseRecordList + courseRecordList, + exportStudentOfCourse, + exportStudentOfTearcher }