mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-10 19:36:43 +08:00
实现剩余导出功能
This commit is contained in:
@@ -6,6 +6,7 @@
|
|||||||
<div style="padding-left: 10px;"><el-button @click="recordList()" type="primary" icon="el-icon-search">搜索</el-button></div>
|
<div style="padding-left: 10px;"><el-button @click="recordList()" type="primary" icon="el-icon-search">搜索</el-button></div>
|
||||||
<div style="padding: 0px 5px;"><el-button icon="el-icon-refresh-right" @click="keyword = ''" type="primary" >重置</el-button></div>
|
<div style="padding: 0px 5px;"><el-button icon="el-icon-refresh-right" @click="keyword = ''" type="primary" >重置</el-button></div>
|
||||||
<div style="padding: 0px 5px;"><el-button type="primary" @click="exportFile()" icon="el-icon-search" size="small" round>导出</el-button></div>
|
<div style="padding: 0px 5px;"><el-button type="primary" @click="exportFile()" icon="el-icon-search" size="small" round>导出</el-button></div>
|
||||||
|
<div style="padding: 0px 5px;"><el-button type="primary" @click="exportStudentOfTearcher()" icon="el-icon-search" size="small" round>导出学员信息</el-button></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="Export">
|
<div class="Export">
|
||||||
<!-- <div style="padding-left: 10px;"><el-button type="primary" @click="exportFile()" icon="el-icon-search" size="small" round>导出</el-button></div> -->
|
<!-- <div style="padding-left: 10px;"><el-button type="primary" @click="exportFile()" icon="el-icon-search" size="small" round>导出</el-button></div> -->
|
||||||
@@ -57,7 +58,7 @@
|
|||||||
width="100px"
|
width="100px"
|
||||||
prop="score"
|
prop="score"
|
||||||
></el-table-column>
|
></el-table-column>
|
||||||
<!-- <el-table-column
|
<el-table-column
|
||||||
label="操作"
|
label="操作"
|
||||||
align="center"
|
align="center"
|
||||||
width="150px"
|
width="150px"
|
||||||
@@ -65,9 +66,9 @@
|
|||||||
fixed="right"
|
fixed="right"
|
||||||
>
|
>
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<el-button type="primary" size="small">导出学员信息</el-button>
|
<el-button type="text" @click="exportStudentOfCourse(scope.row.courseId)" size="small">导出学员信息</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column> -->
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -109,10 +110,11 @@ export default {
|
|||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
|
||||||
|
// 导出所有记录
|
||||||
exportFile(){
|
exportFile(){
|
||||||
let req = {
|
let req = {
|
||||||
userId: this.userInfo.sysId
|
userId: this.userInfo.sysId
|
||||||
// teacherId:"70F80F4E-34BA-10AB-894A-8FA812B19637"
|
// userId:"70F80F4E-34BA-10AB-894A-8FA812B19637"
|
||||||
}
|
}
|
||||||
apiCourse.courseRecordExport(req).then(res=>{
|
apiCourse.courseRecordExport(req).then(res=>{
|
||||||
const link = document.createElement('a');// 创建a标签
|
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){
|
recordList(pageIndex){
|
||||||
let req = {
|
let req = {
|
||||||
// teacherId:"70F80F4E-34BA-10AB-894A-8FA812B19637",
|
// userId:"6B049FAF-C314-7CCF-0D28-0D23F4C42531",
|
||||||
userId: this.userInfo.sysId,
|
userId: this.userInfo.sysId,
|
||||||
keyword:this.keyword,
|
keyword:this.keyword,
|
||||||
page:pageIndex,
|
page:pageIndex,
|
||||||
|
|||||||
Reference in New Issue
Block a user