From ec04e7febffca798ef546050825b3de041b0aab2 Mon Sep 17 00:00:00 2001 From: waruneeauy Date: Wed, 1 May 2024 09:13:27 +0700 Subject: [PATCH] =?UTF-8?q?updated=20layout=20=E0=B8=9A=E0=B8=A3=E0=B8=A3?= =?UTF-8?q?=E0=B8=88=E0=B8=B8=E0=B9=81=E0=B8=95=E0=B9=88=E0=B8=87=E0=B8=95?= =?UTF-8?q?=E0=B8=B1=E0=B9=89=E0=B8=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PersonalDetail/Information/Document.vue | 62 ++++++++++--------- 1 file changed, 32 insertions(+), 30 deletions(-) diff --git a/src/modules/05_placement/components/PersonalDetail/Information/Document.vue b/src/modules/05_placement/components/PersonalDetail/Information/Document.vue index 7c6151a85..aa1b157f8 100644 --- a/src/modules/05_placement/components/PersonalDetail/Information/Document.vue +++ b/src/modules/05_placement/components/PersonalDetail/Information/Document.vue @@ -10,9 +10,9 @@ import http from "@/plugins/http"; import config from "@/app.config"; interface ArrayFileList { - id:string - pathName:string - fileName:string + id: string; + pathName: string; + fileName: string; } const props = defineProps({ @@ -40,7 +40,14 @@ const fileList = ref([]); const $q = useQuasar(); // show dialog const mixin = useCounterMixin(); const route = useRoute(); -const { success, messageError, showLoader, dialogConfirm, hideLoader,dialogRemove } = mixin; +const { + success, + messageError, + showLoader, + dialogConfirm, + hideLoader, + dialogRemove, +} = mixin; const profileId = ref( route.params.personalId ? route.params.personalId.toString() : "" ); @@ -51,30 +58,28 @@ const file = ref([]); const name = ref(""); const dataMain = ref([]); - - // const getData = async () => { // if (props.datainformation) { // dataMain.value = props.datainformation; // files.value = dataMain.value.docs; // } - // โค้ดเก่ายังไม่ได้ใช้ - // if (profileId.value) { - // showLoader(); - // await http - // .get(config.API.profilePaperId(profileId.value)) - // .then((res) => { - // const data = res.data.result; - // files.value = data; - // }) - // .catch((e) => { - // messageError($q, e); - // }) - // .finally(() => { - // hideLoader(); - // }); - // } +// โค้ดเก่ายังไม่ได้ใช้ +// if (profileId.value) { +// showLoader(); +// await http +// .get(config.API.profilePaperId(profileId.value)) +// .then((res) => { +// const data = res.data.result; +// files.value = data; +// }) +// .catch((e) => { +// messageError($q, e); +// }) +// .finally(() => { +// hideLoader(); +// }); +// } // }; const deleteData = async (id: string) => { @@ -229,7 +234,7 @@ async function uploadFileDoc(uploadUrl: string, file: any) { * ดาวน์โหลดลิงค์ไฟล์ * @param fileName file name */ - function downloadFile(fileName: string) { +function downloadFile(fileName: string) { showLoader(); http .get( @@ -269,7 +274,6 @@ function deleteFile(fileName: string) { ) ) .then((res) => { - setTimeout(() => { getData(); success($q, `ลบไฟล์สำเร็จ`); @@ -286,7 +290,7 @@ function deleteFile(fileName: string) { } async function getData() { - showLoader() + showLoader(); await http .get( config.API.file("ระบบบรรจุ แต่งตั้ง", "เอกสารหลักฐาน", profileId.value) @@ -298,17 +302,16 @@ async function getData() { messageError($q, e); }) .finally(() => { - hideLoader() + hideLoader(); }); } onMounted(async () => { await getData(); }); -