• js打印功能


    需求:打印页面的元素可配置,并且样式修改较多

    解决:跳转新页面打印 

    当前页跳转到打印页面:

    var wind = window.open(`/index.php/home/printPur?id=${this.recordId}&type=${this.transType}`,'_blank');
    

     跳转到页面在数据加载完后

    window.print();  
    window.close();
    

     碰到问题:

    1、表格边框的颜色按照ui显示不出来,加深颜色;

    2、页脚隐藏

    <style media="print">
    @page {
    size: auto; /* auto is the initial value */
    margin: 0mm; /* this affects the margin in the printer settings */
    }
    </style>
    但是发现后面的页面还会显示,在打印界面有设置打印页脚页眉的选项,需要手动设置
    3、全英文断行
    td{word-wrap:"break-word",
    word-break:"break-all"}
    同样设置
    tablle{
    word-wrap:"break-word",
    word-break:"break-all"
    }
    4、关于边框线显示隐藏
    自己写逻辑
  • 相关阅读:
    Go语言标准库flag基本使用
    GO学习-(12) Go语言基础之函数
    GO学习-(11) Go语言基础之map
    GO学习-(10) Go语言基础之指针
    Spring AOP
    JDK动态代理
    版本控制
    版本控制
    浅析Java反射机制
    Spring Batch学习
  • 原文地址:https://www.cnblogs.com/shui1993/p/10929082.html
Copyright © 2020-2023  润新知