diff --git a/src/modules/11_discipline/components/2_InvestigateFacts/CalandarDialog.vue b/src/modules/11_discipline/components/2_InvestigateFacts/CalandarDialog.vue index 085d41dda..b7faab59d 100644 --- a/src/modules/11_discipline/components/2_InvestigateFacts/CalandarDialog.vue +++ b/src/modules/11_discipline/components/2_InvestigateFacts/CalandarDialog.vue @@ -14,26 +14,28 @@ const props = defineProps({ }); + + + diff --git a/src/modules/11_discipline/components/2_InvestigateFacts/Calendar.vue b/src/modules/11_discipline/components/2_InvestigateFacts/Calendar.vue index ba2503546..24beb865d 100644 --- a/src/modules/11_discipline/components/2_InvestigateFacts/Calendar.vue +++ b/src/modules/11_discipline/components/2_InvestigateFacts/Calendar.vue @@ -11,13 +11,14 @@ import listPlugin from "@fullcalendar/list"; import { useCounterMixin } from "@/stores/mixin"; const mixin = useCounterMixin(); //เรียกฟังก์ชันกลาง -const { monthYear2Thai } = mixin; +const { monthYear2Thai, showLoader, hideLoader } = mixin; import type { DataDateMonthObject } from "@/modules/09_leave/interface/response/leave"; /** * Option ของปฏิทิน */ + const fullCalendar = ref(); //ref calendar const calendarOptions = ref({ plugins: [ @@ -127,37 +128,33 @@ const modeCancel = ref(true); * เรียกฟังก์ชันทั้งหมดตอนเรียกใช้ไฟล์นี้ */ onMounted(async () => { - if (fullCalendar !== undefined) { - const calen = fullCalendar.value.getApi(); - const date = new Date(dateMonth.value.year, dateMonth.value.month); - calen.gotoDate(date); - } + showLoader(); + setTimeout(() => { + if (fullCalendar !== undefined) { + const calen = fullCalendar.value.getApi(); + const date = new Date(dateMonth.value.year, dateMonth.value.month); + calen.gotoDate(date); + } + hideLoader(); + }, 1000); }); +/** function เปลี่ยนปฎิทิน*/ function changCalendar() { const calen = fullCalendar.value.getApi(); const date = new Date(dateMonth.value.year, dateMonth.value.month); calen.gotoDate(date); } -/** - * ค่า props(วันเดือนปีที่เลือก) ตอนอัพเดท ค่าฏิทินให้อัพเดทใหม่ - */ -// watch(props, async (count, prevCount) => { -// const calen = fullCalendar.value.getApi(); -// const date = new Date(props.dateYear, props.dateMonth); -// calen.gotoDate(date); -// }); - /** * ฟังก์ชั่นยกเลิก model * @param text */ -const cancel = async (text: string) => { +async function cancel(text: string) { title.value = text; modalCancel.value = true; modeCancel.value = true; -}; +} /** * ฟังก์ชั่นเปิด model * @param text @@ -168,26 +165,6 @@ const view = async (text: string) => { modeCancel.value = false; }; -// filter calendar left -const filterLists = ref([ - { - id: "x1", - name: "นางสาววารุณี แต้มคู", - color: "green", - }, - { - id: "x2", - name: "นางสาวสมศรี ใจดี", - color: "grey", - }, - { - id: "x3", - name: "นายสมชาย สุขใจ", - color: "grey", - }, -]); -const filterVal = ref(["x1"]); - const dateMonth = ref({ month: new Date().getMonth(), year: new Date().getFullYear(),