|
@@ -24,7 +24,7 @@
|
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
|
import { maxFileSize } from "@/constant/caseFile";
|
|
import { maxFileSize } from "@/constant/caseFile";
|
|
|
import { useUpload } from "@/hook/upload";
|
|
import { useUpload } from "@/hook/upload";
|
|
|
-import { ElMessage } from "element-plus";
|
|
|
|
|
|
|
+import { ElMessage, ElLoading } from "element-plus";
|
|
|
import { computed, ref, watchEffect, onMounted } from "vue";
|
|
import { computed, ref, watchEffect, onMounted } from "vue";
|
|
|
import { addCaseScenes } from "./quisk";
|
|
import { addCaseScenes } from "./quisk";
|
|
|
import { QuiskExpose } from "@/helper/mount";
|
|
import { QuiskExpose } from "@/helper/mount";
|
|
@@ -40,16 +40,30 @@ const exportInfo = ref({
|
|
|
})
|
|
})
|
|
|
onMounted(async () => {
|
|
onMounted(async () => {
|
|
|
});
|
|
});
|
|
|
-
|
|
|
|
|
-defineExpose<QuiskExpose>({
|
|
|
|
|
- async submit() {
|
|
|
|
|
|
|
+const submit = () => {
|
|
|
if (!props.showPagesRef) {
|
|
if (!props.showPagesRef) {
|
|
|
ElMessage.error("加载异常,请刷新浏览器");
|
|
ElMessage.error("加载异常,请刷新浏览器");
|
|
|
throw "加载异常,请刷新浏览器";
|
|
throw "加载异常,请刷新浏览器";
|
|
|
}else{
|
|
}else{
|
|
|
- await props.showPagesRef.exportToPDF(exportInfo.value.paperType,props.title, exportInfo.value.fileType)
|
|
|
|
|
|
|
+ const loading = ElLoading.service({ lock: true, text: "正在导出" });
|
|
|
|
|
+ // 延迟执行,让 loading 先显示出来
|
|
|
|
|
+ setTimeout(async () => {
|
|
|
|
|
+ try {
|
|
|
|
|
+ await props.showPagesRef.exportToPDF(
|
|
|
|
|
+ exportInfo.value.paperType, props.title, exportInfo.value.fileType
|
|
|
|
|
+ );
|
|
|
|
|
+ return true;
|
|
|
|
|
+ } finally {
|
|
|
|
|
+ loading.close();
|
|
|
|
|
+ }
|
|
|
|
|
+ }, 40);
|
|
|
|
|
+ // props.showPagesRef.exportToPDF(exportInfo.value.paperType,props.title, exportInfo.value.fileType)
|
|
|
|
|
+ // console.log('正在导出2');
|
|
|
|
|
+ // loading.close();
|
|
|
}
|
|
}
|
|
|
- },
|
|
|
|
|
|
|
+ };
|
|
|
|
|
+defineExpose<QuiskExpose>({
|
|
|
|
|
+ submit,
|
|
|
});
|
|
});
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|