|
@@ -417,14 +417,14 @@ export default {
|
|
//结束计时
|
|
//结束计时
|
|
const end = Date.now()
|
|
const end = Date.now()
|
|
console.log("转换ppt用时:",Math.floor((end-start)/1000),' s')
|
|
console.log("转换ppt用时:",Math.floor((end-start)/1000),' s')
|
|
- //pptx2.writeFile({ fileName: "test.pptx" });//本地测试用
|
|
|
|
|
|
+ //pptx.writeFile({ fileName: "test.pptx" });//本地测试用
|
|
//直接下载
|
|
//直接下载
|
|
if(type==='dowload'){
|
|
if(type==='dowload'){
|
|
this.downloadLoading = this.$loading({
|
|
this.downloadLoading = this.$loading({
|
|
fullscreen:true,
|
|
fullscreen:true,
|
|
text:'生成PPT完成,正在下载PPT...'
|
|
text:'生成PPT完成,正在下载PPT...'
|
|
})
|
|
})
|
|
- pptx2.writeFile({
|
|
|
|
|
|
+ pptx.writeFile({
|
|
fileName: `${this.coverInfo.page.Title||'unname'}.pptx`,
|
|
fileName: `${this.coverInfo.page.Title||'unname'}.pptx`,
|
|
compression:this.setCompression
|
|
compression:this.setCompression
|
|
}).then(()=>{
|
|
}).then(()=>{
|
|
@@ -437,7 +437,7 @@ export default {
|
|
text:this.$t('Slides.publishing_loading')
|
|
text:this.$t('Slides.publishing_loading')
|
|
})
|
|
})
|
|
//console.log('pptx',pptx)
|
|
//console.log('pptx',pptx)
|
|
- // pptx2.write('blob').then((data)=>{
|
|
|
|
|
|
+ // pptx.write('blob').then((data)=>{
|
|
// // 上传到阿里云oss
|
|
// // 上传到阿里云oss
|
|
// // this.handleUploadToOSS(data)
|
|
// // this.handleUploadToOSS(data)
|
|
// })
|
|
// })
|
|
@@ -461,7 +461,7 @@ export default {
|
|
}
|
|
}
|
|
};
|
|
};
|
|
//outputType为blob时不会启用压缩,为STREAM时会按nodebuffer压缩
|
|
//outputType为blob时不会启用压缩,为STREAM时会按nodebuffer压缩
|
|
- pptx2.write({compression:this.setCompression,outputType:'STREAM'}).then((data)=>{
|
|
|
|
|
|
+ pptx.write({compression:this.setCompression,outputType:'STREAM'}).then((data)=>{
|
|
//将nodebuffer转为blob
|
|
//将nodebuffer转为blob
|
|
const blob = new Blob([data])
|
|
const blob = new Blob([data])
|
|
// 1走后端接口上传
|
|
// 1走后端接口上传
|