load orgchart

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2025-07-18 15:08:04 +07:00
parent 85337f2112
commit f78be174c9
4 changed files with 193 additions and 18 deletions

View file

@ -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);
}
/**