修改教师端我的授课记录查询和导出

This commit is contained in:
sunhonglai
2025-04-29 15:03:58 +08:00
parent f92954aa6b
commit 577357ccd0
3 changed files with 57 additions and 61 deletions

View File

@@ -61,12 +61,63 @@ const exportStudentOfTearcher = function(userId) {
const courseRecordList = function(data) {
return ajax.postJson('/b1/system/teacher/teacher-course-list',data);
}
const getListByToken = function(data) {
return ajax2.get('/manageApi',`/admin/teacherRecord/getListByToken?courseName=${data.courseName}&pageNo=${data.pageNo}&pageSize=${data.pageSize}`);
}
/**
* 导出授课记录
*
* @param {Object} data
*/
const courseRecordExport2 = function(data) {
return axios.request({
baseURL: "/manageApi",
url: '/admin/export/exportInTeacherRecord',
method: 'post',
data:data,
headers:{'Content-Type':'application/json;charset=utf-8'},
responseType: 'blob'
})
}
/**
* 导出课程下的学员信息
*
*/
const exportStudentOfCourse2 = function(courseId,courseType) {
return axios.request({
baseURL: "/manageApi",
url: '/admin/export/exportTeacherRecordStudentInfo?courseId='+courseId+'&courseType='+courseType,
method: 'get'
// headers:{'Content-Type':'application/json;charset=utf-8'},
// responseType: 'blob'
})
}
/**
* 导出教师下的所有授课记录下的学员信息
*
*/
const exportStudentOfTearcher2 = function(userId) {
return axios.request({
baseURL: "/manageApi",
url: '/b1/system/teacher/teacher-course-student-export?userId='+userId,
method: 'post',
headers:{'Content-Type':'application/json;charset=utf-8'},
responseType: 'blob'
})
}
export default {
courseRecordExport,
courseRecordExport2,
courseRecordList,
getListByToken,
exportStudentOfCourse,
exportStudentOfCourse2,
exportStudentOfTearcher,
exportStudentOfTearcher2,
}

View File

@@ -1,6 +1,5 @@
import ajax from '@/utils/xajax.js'
import ajax2 from '../unionAjax.js';
import axios from "axios";
/**
* 按名称查询
@@ -212,55 +211,6 @@ const findAllCourses=function(query){
return ajax.postJson('/xboe/teacher/update-sync',data);
}
const getListByToken = function(data) {
return ajax2.get('/manageApi',`/admin/teacherRecord/getListByToken?courseName=${data.courseName}&pageNo=${data.pageNo}&pageSize=${data.pageSize}`);
}
/**
* 导出授课记录
*
* @param {Object} data
*/
const courseRecordExport2 = function(data) {
return axios.request({
baseURL,
url: '/manageApi/admin/export/exportInTeacherRecord',
method: 'post',
data:data,
headers:{'Content-Type':'application/json;charset=utf-8'},
responseType: 'blob'
})
}
/**
* 导出课程下的学员信息
*
*/
const exportStudentOfCourse2 = function(courseId,courseType) {
return axios.request({
baseURL,
url: '/manageApi/admin/export/exportTeacherRecordStudentInfo?courseId='+courseId+'&courseType='+courseType,
method: 'get'
// headers:{'Content-Type':'application/json;charset=utf-8'},
// responseType: 'blob'
})
}
/**
* 导出教师下的所有授课记录下的学员信息
*
*/
const exportStudentOfTearcher2 = 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'
})
}
export default {
findByName,
getInfoById,
@@ -277,9 +227,5 @@ export default {
exports,
syncUpdate,
detailTeacher,
updateTeacher,
courseRecordExport2,
exportStudentOfCourse2,
exportStudentOfTearcher2,
getListByToken,
updateTeacher
}

View File

@@ -155,7 +155,7 @@
</template>
<script>
import apiTeacher from '../../api/boe/teacher.js';
import apiCourse from '../../api/boe/courseRecord.js';
import {mapGetters} from 'vuex';
export default {
@@ -181,7 +181,7 @@ export default {
let req = {
userId: this.userInfo.sysId
}
apiTeacher.courseRecordExport2(req).then(res => {
apiCourse.courseRecordExport2(req).then(res => {
const link = document.createElement('a');// 创建a标签
let blob = new Blob([res.data], {type: 'application/vnd.ms-excel'}); // 设置文件类型
link.style.display = "none";
@@ -195,7 +195,7 @@ export default {
// 导出课程下的学员信息
exportStudentOfCourse(courseId, courseType) {
apiTeacher.exportStudentOfCourse2(courseId, courseType).then(res => {
apiCourse.exportStudentOfCourse2(courseId, courseType).then(res => {
const link = document.createElement('a');// 创建a标签
let blob = new Blob([res.data], {type: 'application/vnd.ms-excel'}); // 设置文件类型
link.style.display = "none";
@@ -210,7 +210,7 @@ export default {
// 导出教师下的所有授课记录下的学员信息
exportStudentOfTearcher() {
let userId = this.userInfo.sysId;
apiTeacher.exportStudentOfTearcher2(userId).then(res => {
apiCourse.exportStudentOfTearcher2(userId).then(res => {
const link = document.createElement('a');// 创建a标签
let blob = new Blob([res.data], {type: 'application/vnd.ms-excel'}); // 设置文件类型
link.style.display = "none";
@@ -228,7 +228,7 @@ export default {
pageNo: this.pageInfo.pageIndex,
pageSize: this.pageInfo.pageSize
}
apiTeacher.getListByToken(req).then(res => {
apiCourse.getListByToken(req).then(res => {
if (res.status == 200) {
this.pageData = res.data.records;
this.pageInfo.pageSize = Number(res.data.size);
@@ -254,7 +254,6 @@ export default {
this.pageInfo.pageIndex = val;
this.recordList(this.pageInfo.pageIndex);
},
},
}
</script>