zhanghua
2024-12-24 bedf461ff5403517478598e9f36d3c1ce033925f
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,23 +33,6 @@
      @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");