|
@@ -267,6 +267,7 @@ export default {
|
|
|
rebuildContent() {
|
|
|
this.content = this.comList.map((item) => item.content).join("");
|
|
|
},
|
|
|
+ /* 后端赚word */
|
|
|
async onExport() {
|
|
|
if (this.exporting) return; // 如果正在导出,直接返回
|
|
|
this.exporting = true; // 设置导出状态为 true
|
|
@@ -517,7 +518,7 @@ export default {
|
|
|
|
|
|
try {
|
|
|
let contentClone = this.$refs.content.cloneNode(true);
|
|
|
- console.log(contentClone);
|
|
|
+ console.log(contentClone); // 添加这行来检查克隆的内容
|
|
|
|
|
|
// 等待所有图片加载完成
|
|
|
await this.waitForImages(contentClone);
|
|
@@ -526,7 +527,6 @@ export default {
|
|
|
const imgPromises = Array.from(
|
|
|
contentClone.querySelectorAll("img")
|
|
|
).map((img) => this.convertImageToBase64(img));
|
|
|
-
|
|
|
await Promise.all(imgPromises);
|
|
|
|
|
|
// 处理输入框
|
|
@@ -618,6 +618,7 @@ export default {
|
|
|
});
|
|
|
await Promise.all(imagePromises);
|
|
|
},
|
|
|
+
|
|
|
// 新增方法:将图片转换为Base64
|
|
|
async convertImageToBase64(img) {
|
|
|
if (img.src.startsWith("data:")) {
|
|
@@ -748,6 +749,8 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
|
|
|
+ /* 后端转pdf */
|
|
|
+ async onExportPdfApi() {},
|
|
|
/* onExport() {
|
|
|
let contentData = `<!DOCTYPE html><html><head><meta charset="UTF-8"></head><body><p class="header1"></p> ${this.$refs.content.innerHTML} </body></html>`;
|
|
|
contentData = contentData
|