From 15fe87e0fc6e7e5e144608f8b2dc218809e36d36 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Tue, 14 Jan 2025 16:51:26 +0700 Subject: [PATCH] fix --- .../components/01_SurveyPage.vue | 6 +++++- src/modules/15_probationReport/views/main.vue | 20 ++----------------- 2 files changed, 7 insertions(+), 19 deletions(-) diff --git a/src/modules/15_probationReport/components/01_SurveyPage.vue b/src/modules/15_probationReport/components/01_SurveyPage.vue index f623bcc..6a06c7a 100644 --- a/src/modules/15_probationReport/components/01_SurveyPage.vue +++ b/src/modules/15_probationReport/components/01_SurveyPage.vue @@ -29,6 +29,7 @@ const { messageError, success, dialogConfirm, showLoader, hideLoader } = mixin; const route = useRoute(); const assignId = ref("baa3d9f6-9d21-4c58-85f2-114abf8de25c"); +const isData = defineModel("isData", { required: true }); const status = ref(true); const answer1 = ref(""); @@ -39,11 +40,13 @@ const classBordered = ref(""); /** ดึง ข้อมูลแบบสำรวจ */ async function getSurveyData() { + isData.value = true; showLoader(); await http .get(config.API.summaryDetail()) .then(async (res: any) => { const data = await res.data.result.data; + isData.value = true; assignId.value = res.data.result.assignId; store.assignId = res.data.result.assignId; if (data !== null) { @@ -55,7 +58,8 @@ async function getSurveyData() { hideLoader(); }) .catch((e) => { - messageError($q, e); + // messageError($q, e); + isData.value = false; hideLoader(); }); } diff --git a/src/modules/15_probationReport/views/main.vue b/src/modules/15_probationReport/views/main.vue index c400312..26af458 100644 --- a/src/modules/15_probationReport/views/main.vue +++ b/src/modules/15_probationReport/views/main.vue @@ -13,23 +13,7 @@ import ResultPage from "@/modules/15_probationReport/components/02_ResultPage.vu const store = useProbationReport(); const router = useRouter(); -const isData = ref(false); - -async function fetchCheckData() { - isData.value = false; - await http - .get(config.API.summaryDetail()) - .then(() => { - isData.value = true; - }) - .catch((e) => { - console.log("error", e); - }); -} - -onMounted(() => { - fetchCheckData(); -}); +const isData = ref(true);