calendar วินัย

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2023-12-06 10:02:18 +07:00
parent eb08a9f209
commit fd200ca7b3
2 changed files with 39 additions and 60 deletions

View file

@ -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<any>(); //ref calendar
const calendarOptions = ref<CalendarOptions>({
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<any[]>([
{
id: "x1",
name: "นางสาววารุณี แต้มคู",
color: "green",
},
{
id: "x2",
name: "นางสาวสมศรี ใจดี",
color: "grey",
},
{
id: "x3",
name: "นายสมชาย สุขใจ",
color: "grey",
},
]);
const filterVal = ref(["x1"]);
const dateMonth = ref<DataDateMonthObject>({
month: new Date().getMonth(),
year: new Date().getFullYear(),