From f05801f2ee1f1d394f3b018255f5a84df5356a2e Mon Sep 17 00:00:00 2001
From: zhanghua <314079846@qq.com>
Date: 星期二, 24 十二月 2024 12:09:58 +0800
Subject: [PATCH] 打印优化

---
 src/utils/print.js |   30 +++++++-----------------------
 1 files changed, 7 insertions(+), 23 deletions(-)

diff --git a/src/utils/print.js b/src/utils/print.js
index d4c72e1..13b07cf 100644
--- a/src/utils/print.js
+++ b/src/utils/print.js
@@ -1,16 +1,17 @@
-export function printHtml(html) {
+export function loadPrintStyle() {
   let style = getStyle();
-  let container = getContainer(html);
-
   document.body.appendChild(style);
-  document.body.appendChild(container);
+}
 
+export function printHtml(html) {
+  let container = getContainer(html);
+  document.body.appendChild(container);
   getLoadPromise(container).then(() => {
     window.print();
-    document.body.removeChild(style);
     document.body.removeChild(container);
   });
 }
+
 
 // 璁剧疆鎵撳嵃鏍峰紡
 function getStyle() {
@@ -32,24 +33,7 @@
       @page {
         margin-top: 0;
         margin-bottom: 0
-        }
-    .div-2-column {
-        display: flex;
-        flex-direction: row;
-        justify-content: space-between;
-    }
-    .m-h2 {
-        text-align: center;
-        font-size: 1.17em;
-        margin-top: 50px;
-        font-weight: bold;
-    }
-    #tr {
-        height: 30px;
-    }
-    .txt-center {
-        text-align: center;
-    }
+        }    
 `;
   let style = document.createElement("style");
   style.innerHTML = styleContent;

--
Gitblit v1.8.0