| | |
| | | recordset: [], |
| | | }, |
| | | grfPath: "", |
| | | oriention: null, |
| | | }; |
| | | }, |
| | | async mounted() { |
| | |
| | | this.pageSize.width = grfMeta.Printer.Width * 10 + "mm"; |
| | | this.pageSize.height = grfMeta.Printer.Height * 10 + "mm"; |
| | | console.log("pageSize: ",this.pageSize) |
| | | this.oriention = grfMeta.Printer.Oriention.toLowerCase() |
| | | }, |
| | | getTemp() { |
| | | // 对每个要打印的对象添加分页 |
| | |
| | | type: "html", |
| | | style: |
| | | this.styleList[0].innerText + |
| | | ` @media print { |
| | | ` |
| | | .printable { |
| | | page-break-inside: avoid; |
| | | page-break-after: always; |
| | | box-sizing: border-box !important; /* 内边距不影响宽高 */ |
| | | } |
| | | |
| | | @page { |
| | |
| | | padding: 0; |
| | | } |
| | | |
| | | table { border-collapse: collapse !important; } |
| | | |
| | | * { |
| | | margin: 0; |
| | | padding: 0; |
| | | color: #000 !important; |
| | | opacity: 1 !important; |
| | | filter: none !important; |
| | | text-shadow: none !important; |
| | | -webkit-print-color-adjust: exact; /* 强制还原颜色(避免淡色) */ |
| | | } |
| | | `, |
| | | }); |
| | |
| | | }; |
| | | </script> |
| | | |
| | | <style></style> |
| | | <style> |
| | | </style> |