From c358789bedc5fd128941639645ee8a4b82f15e2f Mon Sep 17 00:00:00 2001 From: waruneeta Date: Wed, 27 Dec 2023 14:33:05 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B9=81=E0=B8=81=E0=B9=89=E0=B9=84=E0=B8=82?= =?UTF-8?q?=E0=B8=A7=E0=B8=B1=E0=B8=99=E0=B8=97=E0=B8=B5=E0=B9=88=E0=B9=81?= =?UTF-8?q?=E0=B8=AA=E0=B8=94=E0=B8=87=E0=B9=83=E0=B8=99=E0=B8=9B=E0=B8=8F?= =?UTF-8?q?=E0=B8=B4=E0=B8=97=E0=B8=B4=E0=B8=99=E0=B8=81=E0=B8=B2=E0=B8=A3?= =?UTF-8?q?=E0=B8=A5=E0=B8=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../09_leave/components/2_Leave/Calendar.vue | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/modules/09_leave/components/2_Leave/Calendar.vue b/src/modules/09_leave/components/2_Leave/Calendar.vue index 1fd0be8e4..4236ce491 100644 --- a/src/modules/09_leave/components/2_Leave/Calendar.vue +++ b/src/modules/09_leave/components/2_Leave/Calendar.vue @@ -7,7 +7,7 @@ import timeGridPlugin from "@fullcalendar/timegrid"; import interactionPlugin from "@fullcalendar/interaction"; import allLocales from "@fullcalendar/core/locales-all"; import listPlugin from "@fullcalendar/list"; -import { useQuasar } from "quasar"; +import { colors, useQuasar } from "quasar"; import http from "@/plugins/http"; import config from "@/app.config"; import { useRouter } from "vue-router"; @@ -20,6 +20,7 @@ import type { import { useCounterMixin } from "@/stores/mixin"; import { useLeavelistDataStore } from "@/modules/09_leave/stores/LeaveStore"; +import moment from "moment"; const leaveStore = useLeavelistDataStore(); const mixin = useCounterMixin(); //เรียกฟังก์ชันกลาง @@ -90,22 +91,22 @@ async function fetchDataCalendar() { const filterName = { id: name, name: convertKeycloakId(name), - color: name === keycloakId.value ? "green" : "grey", + color: "green", }; filterLists.value.push(filterName); + filterVal.value.push(name); } const data = mainData.value.filter( (e: any) => e.keycloakId === keycloakId.value ); - const event = data.map((e: any) => ({ id: e.id, title: `${e.fullName} (${e.leaveTypeName}) `, start: e.leaveStartDate, - end: e.leaveEndDate, - allDay: true, + end: moment(e.leaveEndDate).format("YYYY-MM-DD") + " 23:59:59", + allDay: false, color: leaveStore.colorType(e.leaveTypeId), textColor: "black", })); @@ -145,10 +146,10 @@ watch( id: e.id, title: `${e.fullName} (${e.leaveTypeName}) `, start: e.leaveStartDate, - end: e.leaveEndDate, + end: moment(e.leaveEndDate).format("YYYY-MM-DD") + " 23:59:59", color: leaveStore.colorType(e.leaveTypeId), textColor: "black", - allDay: true, + allDay: false, })); }); const allEventData = [].concat(...eventData); @@ -164,7 +165,7 @@ function redirectToDetail(id: string) { * เรียกฟังก์ชันทั้งหมดตอนเรียกใช้ไฟล์นี้ */ onMounted(async () => { - filterVal.value.push(keycloakId.value); + // filterVal.value.push(keycloakId.value); await fetchDataCalendar(); }); @@ -201,6 +202,7 @@ const monthYearThai = (val: DataDateMonthObject) => { +