/** * 通过浏览器打印对话框导出 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); } }