zhangjie 1 год назад
Родитель
Сommit
5c49687246
1 измененных файлов с 16 добавлено и 9 удалено
  1. 16 9
      src/modules/paper-export/views/PaperTemplateBuild.vue

+ 16 - 9
src/modules/paper-export/views/PaperTemplateBuild.vue

@@ -174,10 +174,9 @@ export default {
             document.getElementById("column-0-0").offsetWidth;
           this.maxColumnHeight =
             document.getElementById("column-0-0").offsetHeight - 10;
-          this.parseRenderStructList();
-          this.buildPrePages();
+          this.buildElementsFromStruct();
         } catch (error) {
-          this.emitFrameResult(false, "构建错误");
+          this.emitFrameResult(false, "构建元素错误");
         }
 
         const loadRes = await this.waitAllImgLoaded().catch(() => {});
@@ -187,16 +186,24 @@ export default {
         }
         this.$nextTick(() => {
           try {
-            this.addDetailScoreTable();
-            this.resetRenderStructSize();
-            this.buildPageAutoPage();
+            this.updateElementWidthInfo();
+            this.buildGroupsFromStruct();
+            this.buildPrePages();
           } catch (error) {
-            this.emitFrameResult(false, "构建pdf错误");
+            this.emitFrameResult(false, "预构建页面错误");
           }
 
           this.$nextTick(() => {
-            this.addDetailScoreTable();
-            this.emitFrameResult(true, "", this.getPreviewTemp());
+            try {
+              this.updateGroupHeightInfo();
+              this.buildPagesByAutoPage();
+            } catch (error) {
+              this.emitFrameResult(false, "构建pdf错误");
+            }
+
+            this.$nextTick(() => {
+              this.emitFrameResult(true, "", this.getPreviewTemp());
+            });
           });
         });
       });