mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-09 19:06:43 +08:00
Merge branch 'stat' of https://codeup.aliyun.com/6265f483e4166464dc2f9c14/boeu/portal into stat
This commit is contained in:
@@ -104,9 +104,34 @@ const ids=function (data){
|
||||
* }
|
||||
* */
|
||||
const exportExcel=function (data){
|
||||
return ajax.postJsonToFile(baseURL,'/xboe/subgroup/m/noteinfo/exportExcel',data);
|
||||
// return ajax.postJsonToFile(baseURL,'/xboe/subgroup/m/noteinfo/exportExcel',data);
|
||||
return ajax.post(baseURL,'/xboe/subgroup/m/noteinfo/exportExcel',data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel预览
|
||||
* @param {
|
||||
* ids ["",""]
|
||||
* }
|
||||
* */
|
||||
const exportExcelPre=function (data){
|
||||
return ajax.post(baseURL,'/xboe/subgroup/m/noteinfo/excel-detail',data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出pdf预览
|
||||
* @param {
|
||||
* ids ["",""]
|
||||
* }
|
||||
* */
|
||||
const exportPdfPre=function (data){
|
||||
return ajax.post(baseURL,'/xboe/subgroup/m/noteinfo/pdf-detail',data);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 导出pdf
|
||||
* @param{
|
||||
@@ -114,7 +139,8 @@ const exportExcel=function (data){
|
||||
* }
|
||||
* */
|
||||
const exportPdf=function (data){
|
||||
return ajax.postJson(baseURL,'/xboe/subgroup/m/noteinfo/exportPdf',data);
|
||||
// return ajax.postJson(baseURL,'/xboe/subgroup/m/noteinfo/exportPdf',data);
|
||||
return ajax.post(baseURL,'/xboe/subgroup/m/noteinfo/exportPdf',data);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -146,5 +172,7 @@ export default {
|
||||
restore,
|
||||
ids,
|
||||
exportExcel,
|
||||
exportPdf
|
||||
exportPdf,
|
||||
exportExcelPre,
|
||||
exportPdfPre
|
||||
}
|
||||
|
||||
@@ -138,13 +138,13 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="export-dialog-right">
|
||||
<p>累计导出{{datalist.length}}条</p>
|
||||
<p>累计导出{{exportPreData.length}}条</p>
|
||||
<p style="margin-top:10px">导出时间:{{formatDate(new Date())}}</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="export-dialog-body">
|
||||
<div class="Export-info" style="" v-for="(item,idx) in datalist" :key="idx">
|
||||
<div class="Export-info" style="" v-for="(item,idx) in exportPreData" :key="idx">
|
||||
<div class="all-title">
|
||||
<h3> {{item.courseName}}</h3>
|
||||
<div v-if="item.playTime != ''"><img src="../../../public/images/coteplay.png" alt="">{{item.playTime}}</div>
|
||||
@@ -227,6 +227,7 @@ export default {
|
||||
startTime:'',
|
||||
endTime:'',
|
||||
datalist:[ ],
|
||||
exportPreData:[ ],
|
||||
thu:true,
|
||||
couresna:[],
|
||||
courseName:'',
|
||||
@@ -251,9 +252,32 @@ export default {
|
||||
methods: {
|
||||
exportCommand(e) {
|
||||
this.exportType = e;
|
||||
this.dialogVisible = true;
|
||||
this.dialogVisible = false;
|
||||
let data = {
|
||||
orderType:this.orderType,
|
||||
orderField:this.orderField,
|
||||
courseId:this.courseId,
|
||||
type:this.num,
|
||||
startTime:this.startTime,
|
||||
endTime:this.endTime,
|
||||
}
|
||||
// 获取导出文件前的预览数据
|
||||
apiNote.exportExcelPre(data).then(res=>{
|
||||
if(res.status != 200){return;}
|
||||
if(res.result.data.length == 0){
|
||||
this.$message.warning('未查询到满足条件的数据')
|
||||
return;
|
||||
}
|
||||
this.exportPreData = res.result.data;
|
||||
if(res.result.isImage && e == 2){
|
||||
this.$message.warning('当前筛选条件下含图片类内容,无法导出Excel!')
|
||||
return;
|
||||
}
|
||||
this.dialogVisible = true;
|
||||
})
|
||||
},
|
||||
exportStart(){
|
||||
|
||||
let ids = this.datalist.map(item=>{
|
||||
if(item.contentType !=3) {
|
||||
return item.id;
|
||||
@@ -262,7 +286,12 @@ export default {
|
||||
let data = {
|
||||
name:this.userData.name,
|
||||
sign:this.userData.sign,
|
||||
ids:ids,
|
||||
orderType:this.orderType,
|
||||
orderField:this.orderField,
|
||||
courseId:this.courseId,
|
||||
type:this.num,
|
||||
startTime:this.startTime,
|
||||
endTime:this.endTime,
|
||||
author:this.userData.avatar,//this.userInfo.avatar,
|
||||
}
|
||||
if(this.exportType == '1') {
|
||||
@@ -274,7 +303,7 @@ export default {
|
||||
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", "我的笔记.xls");
|
||||
link.setAttribute("download", "我的笔记.pdf");
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
document.body.removeChild(link);
|
||||
@@ -283,7 +312,16 @@ export default {
|
||||
|
||||
})
|
||||
} else {
|
||||
apiNote.exportExcel(ids).then(res=>{
|
||||
let data = {
|
||||
orderType:this.orderType,
|
||||
orderField:this.orderField,
|
||||
courseId:this.courseId,
|
||||
type:this.num,
|
||||
startTime:this.startTime,
|
||||
endTime:this.endTime,
|
||||
}
|
||||
// apiNote.exportExcel(ids).then(res=>{
|
||||
apiNote.exportExcel(data).then(res=>{
|
||||
if(res.status) {
|
||||
this.$message.error('导出失败');
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user