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 } 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,