mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-23 17:55:37 +08:00
Merge branch 'stat' of https://codeup.aliyun.com/6265f483e4166464dc2f9c14/boeu/portal into stat
This commit is contained in:
@@ -6,9 +6,9 @@
|
|||||||
<el-dropdown style="margin-left:15px" @command="exportCommand">
|
<el-dropdown style="margin-left:15px" @command="exportCommand">
|
||||||
<el-button>导出<i class="el-icon-arrow-down el-icon--right"></i></el-button>
|
<el-button>导出<i class="el-icon-arrow-down el-icon--right"></i></el-button>
|
||||||
<el-dropdown-menu slot="dropdown">
|
<el-dropdown-menu slot="dropdown">
|
||||||
<!--
|
|
||||||
<el-dropdown-item command="1">PDF</el-dropdown-item>
|
<!-- <el-dropdown-item command="1">PDF</el-dropdown-item> -->
|
||||||
-->
|
|
||||||
<el-dropdown-item command="2">Excel</el-dropdown-item>
|
<el-dropdown-item command="2">Excel</el-dropdown-item>
|
||||||
</el-dropdown-menu>
|
</el-dropdown-menu>
|
||||||
</el-dropdown>
|
</el-dropdown>
|
||||||
@@ -329,12 +329,12 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
exportStart(){
|
exportStart(){
|
||||||
|
|
||||||
let ids = this.datalist.map(item=>{
|
let ids = this.datalist.map(item=>{
|
||||||
if(item.contentType !=3) {
|
if(item.contentType !=3) {
|
||||||
return item.id;
|
return item.id;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
let data = {
|
let data = {
|
||||||
name:this.userData.name,
|
name:this.userData.name,
|
||||||
sign:this.userData.sign,
|
sign:this.userData.sign,
|
||||||
@@ -344,10 +344,30 @@ export default {
|
|||||||
type:this.num,
|
type:this.num,
|
||||||
startTime:this.startTime,
|
startTime:this.startTime,
|
||||||
endTime:this.endTime,
|
endTime:this.endTime,
|
||||||
author:this.userData.avatar,//this.userInfo.avatar,
|
currentUserHeadImgUrl: this.fileBaseUrl + this.userData.avatar,
|
||||||
|
currentUserSign: this.userData.sign,
|
||||||
|
currentUserName: this.userData.name,
|
||||||
|
currentUserDepartName:this.userInfo.departFullName
|
||||||
}
|
}
|
||||||
|
|
||||||
if(this.exportType == '1') {
|
if(this.exportType == '1') {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
apiNote.exportPdf(data).then(res=>{
|
||||||
|
console.log("导出pdf完成");
|
||||||
|
const link = document.createElement('a');// 创建a标签
|
||||||
|
// let blob = new Blob([res],{type: 'application/vnd.ms-pdf;charset=UTF-8'}); // 设置文件类型
|
||||||
|
let blob = new Blob([res],{type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8'}); // 设置文件类型
|
||||||
|
link.style.display = "none";
|
||||||
|
link.href = URL.createObjectURL(blob); // 创建URL
|
||||||
|
link.setAttribute("download", "我的笔记.pdf");
|
||||||
|
document.body.appendChild(link);
|
||||||
|
link.click();
|
||||||
|
link.remove(); // 一次性的,用完就删除a标签
|
||||||
|
this.dialogVisible = false;
|
||||||
|
})
|
||||||
|
|
||||||
//apiNote.exportPdf(data);
|
//apiNote.exportPdf(data);
|
||||||
// apiNote.exportPdf(data).then(res=>{
|
// apiNote.exportPdf(data).then(res=>{
|
||||||
// if(res.status) {
|
// if(res.status) {
|
||||||
|
|||||||
Reference in New Issue
Block a user