From f6e49ec2b10302bd31937600dac3d659268c3b49 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Tue, 28 Jan 2025 16:22:01 +0700 Subject: [PATCH] =?UTF-8?q?fix=20=E0=B8=97=E0=B8=94=E0=B8=A5=E0=B8=AD?= =?UTF-8?q?=E0=B8=87=E0=B8=87=E0=B8=B2=E0=B8=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../probation/FormEvaluation/FormEvaluate.vue | 2 +- .../FormEvaluation/FormEvaluateScore.vue | 2 +- .../probation/FormEvaluation/FormReport.vue | 2 +- .../FormEvaluation/FormSaveResult.vue | 2 +- .../FormEvaluation/FormSaveResultCommader.vue | 6 ++-- .../FormEvaluation/FormUploadFile.vue | 29 ++++++++++++++++++- .../probation/FormEvaluation/Header.vue | 2 +- 7 files changed, 37 insertions(+), 8 deletions(-) diff --git a/src/modules/05_placement/components/probation/FormEvaluation/FormEvaluate.vue b/src/modules/05_placement/components/probation/FormEvaluation/FormEvaluate.vue index 7f1b3b459..8e14422e4 100644 --- a/src/modules/05_placement/components/probation/FormEvaluation/FormEvaluate.vue +++ b/src/modules/05_placement/components/probation/FormEvaluation/FormEvaluate.vue @@ -1085,7 +1085,7 @@ onMounted(async () => { { (route.params.form as string); const file = ref(); +const dataDownload = ref(); function onUploadFiles() { showLoader(); @@ -72,6 +73,7 @@ async function uploadFileURL(uploadUrl: string) { }) .then(async () => { await success($q, "อัปโหลดไฟล์สำเร็จ"); + file.value = null; await fetchCheckfile(); }) .catch((err) => { @@ -79,7 +81,6 @@ async function uploadFileURL(uploadUrl: string) { }) .finally(() => { hideLoader(); - file.value = null; }); } @@ -91,6 +92,7 @@ async function fetchCheckfile() { .then(async (res) => { if (res.data.length >= 1) { isCheckFile.value = true; + dataDownload.value = res.data[0]; } }) .catch((e) => { @@ -98,6 +100,22 @@ async function fetchCheckfile() { }); } +async function onDownloadFile() { + showLoader(); + http + .get(config.API.filefullPath(`${dataDownload.value.pathname}`)) + .then(async (res) => { + const data = res.data.downloadUrl; + window.open(data, "_blank"); + }) + .catch((e) => { + messageError($q, e); + }) + .finally(() => { + hideLoader(); + }); +} + onMounted(() => { fetchCheckfile(); }); @@ -141,6 +159,15 @@ onMounted(() => { + +
+ +
diff --git a/src/modules/05_placement/components/probation/FormEvaluation/Header.vue b/src/modules/05_placement/components/probation/FormEvaluation/Header.vue index 485ece40c..2f7c29eb5 100644 --- a/src/modules/05_placement/components/probation/FormEvaluation/Header.vue +++ b/src/modules/05_placement/components/probation/FormEvaluation/Header.vue @@ -69,7 +69,7 @@ function nextPage() { >
-
ครั้งที่{{ i }}
+
ครั้งที่ {{ i }}