From 4c1c2c6084cba2e07097a1522345a51393af0e03 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Thu, 12 Jun 2025 09:42:34 +0700 Subject: [PATCH] =?UTF-8?q?fix=20bug=20Loading=20=E0=B8=AB=E0=B8=99?= =?UTF-8?q?=E0=B9=89=E0=B8=B2=20Logs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/03_logs/components/LogTable.vue | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/modules/03_logs/components/LogTable.vue b/src/modules/03_logs/components/LogTable.vue index 276b1b50..f4d9be6e 100644 --- a/src/modules/03_logs/components/LogTable.vue +++ b/src/modules/03_logs/components/LogTable.vue @@ -243,6 +243,7 @@ async function selectedOrg(id: string) { * ฟังชั่นสำหรับดึงไอดีโครงสร้างปัจจุบัน */ async function fetchOrganizationActive() { + showLoader(); await http .get(config.API.activeOrganization) .then(async (res) => { @@ -253,6 +254,9 @@ async function fetchOrganizationActive() { }) .catch((err) => { messageError($q, err); + }) + .finally(() => { + hideLoader(); }); } @@ -279,9 +283,7 @@ async function fatchOrg(id: string) { }) .catch((err) => { messageError($q, err); - hideLoader(); - }) - .finally(() => {}); + }); } /*** scroll และโหลดข้อมูลรายการ Logs เพิ่ม */ @@ -441,6 +443,7 @@ function updateDate() { } function onSendCSV() { + showLoader(); const queryString = { rootId: qureyBody.rootId ?? undefined, // size: size.value ?? undefined, @@ -455,14 +458,16 @@ function onSendCSV() { .get(config.API.reportLog, { params: queryString, }) - .then((res) => { + .then(async (res) => { const data = res.data; - genReportXLSX(data, `LOG_${date2Thai(new Date(startDate.value))}`); + await genReportXLSX(data, `LOG_${date2Thai(new Date(startDate.value))}`); }) .catch((e) => { messageError($q, e); }) - .finally(() => {}); + .finally(() => { + hideLoader(); + }); } async function downloadTxt() {