load orgchart
This commit is contained in:
parent
85337f2112
commit
f78be174c9
4 changed files with 193 additions and 18 deletions
|
|
@ -8,6 +8,11 @@ import http from "@/plugins/http";
|
|||
import config from "@/app.config";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useOrganizational } from "@/modules/02_organization/store/organizational";
|
||||
import {
|
||||
showLoadingSpinner,
|
||||
exportChartToPDF,
|
||||
exportChartToPNG,
|
||||
} from "@/plugins/exportChart";
|
||||
|
||||
const $q = useQuasar();
|
||||
const mixin = useCounterMixin();
|
||||
|
|
@ -23,28 +28,45 @@ const scrollContainer = ref<HTMLElement | null>(null);
|
|||
|
||||
/** function ดาวน์โหลดไฟล์โครงสร้าง PNG*/
|
||||
async function savePNG() {
|
||||
try {
|
||||
showLoader();
|
||||
await scrollToCenter();
|
||||
await chartRef.value.savePNG();
|
||||
} catch {
|
||||
messageError($q);
|
||||
} finally {
|
||||
hideLoader();
|
||||
}
|
||||
// try {
|
||||
// showLoader();
|
||||
// await scrollToCenter();
|
||||
// await chartRef.value.savePNG();
|
||||
// } catch {
|
||||
// messageError($q);
|
||||
// } finally {
|
||||
// hideLoader();
|
||||
// }
|
||||
showLoadingSpinner();
|
||||
setTimeout(async () => {
|
||||
try {
|
||||
// export แบบเต็มๆ
|
||||
scrollContainer.value && (await exportChartToPNG(scrollContainer.value));
|
||||
} finally {
|
||||
}
|
||||
}, 500);
|
||||
}
|
||||
|
||||
/** function ดาวน์โหลดไฟล์โครงสร้าง PDF*/
|
||||
async function savePDF() {
|
||||
try {
|
||||
showLoader();
|
||||
await scrollToCenter();
|
||||
await chartRef.value.savePDF();
|
||||
} catch {
|
||||
messageError($q);
|
||||
} finally {
|
||||
hideLoader();
|
||||
}
|
||||
// try {
|
||||
// showLoader();
|
||||
// await scrollToCenter();
|
||||
// await chartRef.value.savePDF();
|
||||
// } catch {
|
||||
// messageError($q);
|
||||
// } finally {
|
||||
// hideLoader();
|
||||
// }
|
||||
|
||||
showLoadingSpinner();
|
||||
setTimeout(async () => {
|
||||
try {
|
||||
// export แบบเต็มๆ
|
||||
scrollContainer.value && (await exportChartToPDF(scrollContainer.value));
|
||||
} finally {
|
||||
}
|
||||
}, 500);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue