|
@@ -17,20 +17,17 @@ const isLoadOver = computed(() => mainStore.getIsLoadOver);
|
|
|
/**
|
|
|
* 生成 PDF Blob
|
|
|
*/
|
|
|
-async function generatePDFBlob(pdfContent?: HTMLElement, mask?: boolean): Promise<Blob | null> {
|
|
|
+async function generatePDFBlob(pdfContent?: HTMLElement, isDownload?: boolean): Promise<Blob | null> {
|
|
|
if (!isLoadOver.value) {
|
|
|
showMessage({ type: 'warning', message: '数据加载中,请稍后再试' });
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
- let loading: any = null;
|
|
|
- if (mask) {
|
|
|
- loading = ElLoading.service({
|
|
|
+ const loading = ElLoading.service({
|
|
|
lock: true,
|
|
|
- text: '生成中...',
|
|
|
+ text: isDownload ? '生成报告中...' : '上传报告中...',
|
|
|
background: 'rgba(0,0,0,0.7)'
|
|
|
});
|
|
|
- }
|
|
|
|
|
|
try {
|
|
|
if (!pdfContent) pdfContent = document.querySelector('.record') as HTMLElement;
|
|
@@ -80,7 +77,7 @@ async function generatePDFBlob(pdfContent?: HTMLElement, mask?: boolean): Promis
|
|
|
return null;
|
|
|
} finally {
|
|
|
mainStore.setExpanded(false);
|
|
|
- setTimeout(() => loading && loading.close(), 500);
|
|
|
+ setTimeout(() => loading.close(), 500);
|
|
|
}
|
|
|
}
|
|
|
|