f
This commit is contained in:
18
src/ui/DWBG9FB2/reportExport.js
Normal file
18
src/ui/DWBG9FB2/reportExport.js
Normal file
@@ -0,0 +1,18 @@
|
||||
/**
|
||||
* 通过浏览器打印对话框导出 PDF(目标打印机选「另存为 PDF」)。
|
||||
*/
|
||||
export async function printReportAsPdf(reportElement) {
|
||||
if (!reportElement) return;
|
||||
|
||||
document.body.classList.add('dwbg9fb2-printing');
|
||||
|
||||
await new Promise((resolve) => requestAnimationFrame(resolve));
|
||||
|
||||
try {
|
||||
window.print();
|
||||
} finally {
|
||||
window.setTimeout(() => {
|
||||
document.body.classList.remove('dwbg9fb2-printing');
|
||||
}, 500);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user