From bedf461ff5403517478598e9f36d3c1ce033925f Mon Sep 17 00:00:00 2001 From: zhanghua <314079846@qq.com> Date: 星期二, 24 十二月 2024 13:06:39 +0800 Subject: [PATCH] Merge branch 'master' of http://42.193.1.25:9521/r/dream_web --- 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