Merge branch 'develop' into dev
All checks were successful
Build & Deploy on Dev / build (push) Successful in 1m18s
All checks were successful
Build & Deploy on Dev / build (push) Successful in 1m18s
This commit is contained in:
commit
89801e787f
1 changed files with 10 additions and 6 deletions
|
|
@ -2,7 +2,6 @@ import axios from "axios";
|
|||
import config from "@/app.config";
|
||||
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { downloadBlobFile } from "@/modules/10_registry/utils/downloadFile";
|
||||
|
||||
const mixin = useCounterMixin();
|
||||
const { showLoader, hideLoader } = mixin;
|
||||
|
|
@ -32,11 +31,16 @@ async function genReport(data: any, fileName: string, type: string = "docx") {
|
|||
const url = URL.createObjectURL(blob);
|
||||
|
||||
const baseName = fileName.trim();
|
||||
// const extension = type === "docx" ? "docx" : "pdf";
|
||||
await downloadBlobFile({
|
||||
downloadUrl: url,
|
||||
fileName: baseName,
|
||||
});
|
||||
const extension = type === "docx" ? "docx" : "pdf";
|
||||
const link = document.createElement("a");
|
||||
link.href = url;
|
||||
link.download = `${baseName}.${extension}`;
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
setTimeout(() => {
|
||||
document.body.removeChild(link);
|
||||
URL.revokeObjectURL(url);
|
||||
}, 100);
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue