|
@@ -13,7 +13,8 @@
|
|
<el-dropdown-item :command="3">4:3</el-dropdown-item>
|
|
<el-dropdown-item :command="3">4:3</el-dropdown-item>
|
|
</el-dropdown-menu>
|
|
</el-dropdown-menu>
|
|
</el-dropdown>
|
|
</el-dropdown>
|
|
- <el-button type="primary" plain style="width:120px;height:40px;" @click="$router.push({path:'/pptenlist'})">返回列表</el-button>
|
|
|
|
|
|
+ <el-button type="primary" style="width:120px;height:40px;" @click="downloadPPT" :disabled="isPublish">下载</el-button>
|
|
|
|
+ <el-button type="primary" plain style="width:120px;height:40px;" @click="$router.push({path:'/pptenlist'})">返回列表</el-button>
|
|
</div>
|
|
</div>
|
|
<!--全加载-->
|
|
<!--全加载-->
|
|
<template v-if="loadingAll">
|
|
<template v-if="loadingAll">
|
|
@@ -131,6 +132,16 @@ export default {
|
|
}
|
|
}
|
|
this.isPublish = false
|
|
this.isPublish = false
|
|
},
|
|
},
|
|
|
|
+ async downloadPPT(){
|
|
|
|
+ this.loadingInstance = this.$loading({
|
|
|
|
+ lock:true,
|
|
|
|
+ fullscreen: true,
|
|
|
|
+ text: "生成ppt中...",
|
|
|
|
+ });
|
|
|
|
+ this.isPublish = true
|
|
|
|
+ await this.pageToPptx('dowload')
|
|
|
|
+ this.isPublish = false
|
|
|
|
+ },
|
|
//计算ppt的版式名称
|
|
//计算ppt的版式名称
|
|
getComponentName(modelId){
|
|
getComponentName(modelId){
|
|
return countComponentName(modelId);
|
|
return countComponentName(modelId);
|
|
@@ -441,6 +452,11 @@ 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" });//本地测试用
|
|
//pptx2.writeFile({ fileName: "test.pptx" });//本地测试用
|
|
|
|
+ //直接下载
|
|
|
|
+ if(type==='dowload'){
|
|
|
|
+ pptx2.writeFile({ fileName: `${this.coverInfo.page.Title||'unname'}.pptx` });
|
|
|
|
+ return
|
|
|
|
+ }
|
|
this.publishLoading = this.$loading({
|
|
this.publishLoading = this.$loading({
|
|
fullscreen:true,
|
|
fullscreen:true,
|
|
text:"发布中..."
|
|
text:"发布中..."
|