From 72c665add9a3149860f3d5cf329071a5f62409bc Mon Sep 17 00:00:00 2001 From: waruneeauy Date: Fri, 13 Feb 2026 11:37:43 +0700 Subject: [PATCH 1/3] =?UTF-8?q?=E0=B8=9B=E0=B8=B4=E0=B8=94=20notification?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/MainView.vue | 58 ++++++++++++++++++++++-------------------- 1 file changed, 30 insertions(+), 28 deletions(-) diff --git a/src/views/MainView.vue b/src/views/MainView.vue index 9cd25d9..11afc5b 100644 --- a/src/views/MainView.vue +++ b/src/views/MainView.vue @@ -42,8 +42,8 @@ const modalReset = ref(false) //ตัวแปร popup reset password const fullName = ref('') //ชื่อผู้ใช้งาน const notiTrigger = ref(false) // เปิด,ปิดรายการ const notiList = ref([]) // รายการแจ้งเตือน -const totalNotiList = ref(0) //จำนวนการรายการแจ้งเตือน -const totalNoti = ref(0) //จำนวนการแจ้งเตือน +// const totalNotiList = ref(0) //จำนวนการรายการแจ้งเตือน +// const totalNoti = ref(0) //จำนวนการแจ้งเตือน const statusLoad = ref(false) // สถานะการโหลด const modalDebug = ref(false) // ตัวแปร popup debug //รูปแบบการแสดงผลของวันที่และเวลา @@ -65,16 +65,16 @@ const isPwdReNewOld = ref(true) /** * ฟังก์ชั่นดึงข้อมูลจำนวนการแจ้งเตือน */ -async function fetchTotolNotificate() { - await http - .get(config.API.msgNotificateTotal) - .then(async (res) => { - totalNoti.value = await res.data.result - }) - .catch((err) => { - messageError($q, err) - }) -} +// async function fetchTotolNotificate() { +// await http +// .get(config.API.msgNotificateTotal) +// .then(async (res) => { +// totalNoti.value = await res.data.result +// }) +// .catch((err) => { +// messageError($q, err) +// }) +// } /** * ฟังก์ชั่นดึงข้อมูลรายการแจ้งเตือน @@ -201,19 +201,19 @@ function getImg(id: string, pathName: string) { }) } -watch( - () => notiTrigger.value, - () => { - if (!notiTrigger.value) { - const updatedNotifications = notiList.value.map((item) => ({ - ...item, - isOpen: true, - })) - notiList.value = updatedNotifications - fetchTotolNotificate() - } - } -) +// watch( +// () => notiTrigger.value, +// () => { +// if (!notiTrigger.value) { +// const updatedNotifications = notiList.value.map((item) => ({ +// ...item, +// isOpen: true, +// })) +// notiList.value = updatedNotifications +// fetchTotolNotificate() +// } +// } +// ) function onreset() { modalReset.value = true @@ -291,7 +291,7 @@ function ruleReNewPassWord(val: string) { const isSsoToken = ref(false) onMounted(async () => { - fetchTotolNotificate() + // fetchTotolNotificate() await fetchKeycloakPosition() const checkTokenParsed = await tokenParsed() const SSO_TOKEN = await getCookie('SSO') @@ -348,11 +348,13 @@ onMounted(async () => { dense flat color="white" + size="13px" + class="q-mr-md" @click="router.push('/history')" > ไปหน้าประวัติการลงเวลาฯ - + From 15b77b3d0a0798f6968bfbc526bf29e12d6b0989 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Thu, 19 Feb 2026 12:57:05 +0700 Subject: [PATCH 2/3] fix:type isDisabledCheckTime --- src/views/HomeView.vue | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/src/views/HomeView.vue b/src/views/HomeView.vue index 3c00ae1..e51ba38 100644 --- a/src/views/HomeView.vue +++ b/src/views/HomeView.vue @@ -26,7 +26,7 @@ const statusCheckin = ref(true) // สถานะเวลา เข const checkDate = ref(null) const msgCheckTime = ref('') // ข้อความแจ้งเตือน -const isDisabledCheckTime = ref(false) // ข้อความแจ้งเตือน +const isDisabledCheckTime = ref(null) // ข้อความแจ้งเตือน const isErr = ref(null) // ข้อความแจ้งเตือน const endTimeAfternoon = ref('12:00:00') //เวลาเช็คเอาท์ตามรอบ @@ -46,9 +46,14 @@ async function fetchCheckTime(load: any = true) { statusCheckin.value = data.checkInId ? false : true checkInId.value = data.checkInId ? data.checkInId : '' endTimeAfternoon.value = data.endTimeAfternoon + isDisabledCheckTime.value = false }) .catch((err) => { - if (err.response.status === 500) { + if ( + err.response.status === 500 && + err.response.data.message === + 'คุณได้ทำการลงเวลาเข้าและออกเรียบร้อยแล้ว คุณจะสามารถลงเวลาได้อีกครั้งในวันถัดไป' + ) { isErr.value = true isDisabledCheckTime.value = true msgCheckTime.value = err.response.data.message @@ -304,9 +309,6 @@ async function capturePhoto() { await camera.value?.stop() const url = URL.createObjectURL(imageBlob) img.value = url - - // เริ่มนับเวลา 3 นาที เพื่อลบรูป - startPhotoTimeout() } /** function เปลี่ยนรูปภาพ*/ @@ -593,7 +595,7 @@ watch( class="col-12 q-pa-md items-center gt-xs" v-if="isLoadingCheckTime" > - +
@@ -660,7 +662,9 @@ watch(
-
+
-
+
*{{ msgCheckTime }}
@@ -1044,7 +1051,7 @@ watch( -
+

Date: Thu, 19 Feb 2026 13:06:53 +0700 Subject: [PATCH 3/3] fix: isDisabledCheckTime --- src/views/HomeView.vue | 29 ++++++++++------------------- 1 file changed, 10 insertions(+), 19 deletions(-) diff --git a/src/views/HomeView.vue b/src/views/HomeView.vue index e51ba38..4aae41b 100644 --- a/src/views/HomeView.vue +++ b/src/views/HomeView.vue @@ -26,7 +26,7 @@ const statusCheckin = ref(true) // สถานะเวลา เข const checkDate = ref(null) const msgCheckTime = ref('') // ข้อความแจ้งเตือน -const isDisabledCheckTime = ref(null) // ข้อความแจ้งเตือน +const isDisabledCheckTime = ref(true) // ข้อความแจ้งเตือน const isErr = ref(null) // ข้อความแจ้งเตือน const endTimeAfternoon = ref('12:00:00') //เวลาเช็คเอาท์ตามรอบ @@ -46,14 +46,10 @@ async function fetchCheckTime(load: any = true) { statusCheckin.value = data.checkInId ? false : true checkInId.value = data.checkInId ? data.checkInId : '' endTimeAfternoon.value = data.endTimeAfternoon - isDisabledCheckTime.value = false + isDisabledCheckTime.value = isDisabledCheckTime.value ? true : false }) .catch((err) => { - if ( - err.response.status === 500 && - err.response.data.message === - 'คุณได้ทำการลงเวลาเข้าและออกเรียบร้อยแล้ว คุณจะสามารถลงเวลาได้อีกครั้งในวันถัดไป' - ) { + if (err.response.status === 500) { isErr.value = true isDisabledCheckTime.value = true msgCheckTime.value = err.response.data.message @@ -595,7 +591,7 @@ watch( class="col-12 q-pa-md items-center gt-xs" v-if="isLoadingCheckTime" > - +

@@ -662,9 +658,7 @@ watch(
-
+
-
+
*{{ msgCheckTime }}
@@ -1051,7 +1042,7 @@ watch( -
+