diff --git a/src/views/user/Mynotes.vue b/src/views/user/Mynotes.vue index 5aa21480..ccdb1aa4 100644 --- a/src/views/user/Mynotes.vue +++ b/src/views/user/Mynotes.vue @@ -7,7 +7,7 @@ 导出 - + PDF Excel @@ -351,41 +351,17 @@ export default { } 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; + let blob = new Blob([res],{type: 'application/vnd.ms-pdf;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).then(res=>{ - // if(res.status) { - // this.$message.error('导出失败'); - // } else { - // 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(); - // document.body.removeChild(link); - // this.dialogVisible = false; - // } - - // }) } else { let data = { orderType:this.orderType,