This commit is contained in:
Mrx
2026-06-10 12:22:43 +08:00
parent 70cfe458be
commit d682a13af9
19 changed files with 4570 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
/**
* 通过浏览器打印对话框导出 PDF目标打印机选「另存为 PDF」
* 零依赖,适合当前纯前端报告查看器;复杂图表场景可改用服务端渲染 PDF。
*/
export async function printReportAsPdf(reportElement) {
if (!reportElement) return;
document.body.classList.add('dwbg9fb3-printing');
await new Promise((resolve) => requestAnimationFrame(resolve));
try {
window.print();
} finally {
window.setTimeout(() => {
document.body.classList.remove('dwbg9fb3-printing');
}, 500);
}
}