no message

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2023-12-06 11:33:54 +07:00
parent 65c9aab134
commit 23beba6e25
6 changed files with 158 additions and 169 deletions

View file

@ -7,13 +7,18 @@ 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 config from "@/app.config";
import http from "@/plugins/http";
import type { DataDateMonthObject } from "@/modules/09_leave/interface/response/leave";
import { useCounterMixin } from "@/stores/mixin";
const mixin = useCounterMixin(); //
const { monthYear2Thai } = mixin;
const { monthYear2Thai, showLoader, hideLoader, messageError } = mixin;
import type { DataDateMonthObject } from "@/modules/09_leave/interface/response/leave";
const $q = useQuasar();
/**
* Option ของปฏ
@ -123,21 +128,48 @@ const reason = ref("ยกเลิกการลา");
const model = ref(null);
const modeCancel = ref(true);
async function fetchCalendar() {
showLoader();
await http
.post(config.API.disciplinaryCalendar(), {
year: dateMonth.value.year,
mouth: dateMonth.value.month,
})
.then((res) => {
console.log(res);
})
.catch((err) => {
messageError($q);
})
.finally(() => {
setTimeout(() => {
if (fullCalendar !== undefined) {
const calen = fullCalendar.value.getApi();
const date = new Date(dateMonth.value.year, dateMonth.value.month);
calen.gotoDate(date);
}
hideLoader();
}, 1000);
});
}
/**
* เรยกฟงกนทงหมดตอนเรยกใชไฟล
*/
onMounted(async () => {
if (fullCalendar !== undefined) {
const calen = fullCalendar.value.getApi();
const date = new Date(dateMonth.value.year, dateMonth.value.month);
calen.gotoDate(date);
}
fetchCalendar();
// if (fullCalendar !== undefined) {
// const calen = fullCalendar.value.getApi();
// const date = new Date(dateMonth.value.year, dateMonth.value.month);
// calen.gotoDate(date);
// }
});
function changCalendar() {
const calen = fullCalendar.value.getApi();
const date = new Date(dateMonth.value.year, dateMonth.value.month);
calen.gotoDate(date);
fetchCalendar();
// const calen = fullCalendar.value.getApi();
// const date = new Date(dateMonth.value.year, dateMonth.value.month);
// calen.gotoDate(date);
}
/**
@ -274,7 +306,7 @@ const monthYearThai = (val: DataDateMonthObject) => {
</template>
</FullCalendar>
<div class="row q-col-gutter-lg justify-end q-pb-lg">
<div class="items-center row">
<!-- <div class="items-center row">
<q-icon
size="10px"
color="light-green"
@ -282,8 +314,8 @@ const monthYearThai = (val: DataDateMonthObject) => {
class="q-mr-sm"
/>
<span class="text-caption text-grey-8">สถานะอน</span>
</div>
<div class="items-center row">
</div> -->
<!-- <div class="items-center row">
<q-icon
size="10px"
color="red-6"
@ -291,7 +323,7 @@ const monthYearThai = (val: DataDateMonthObject) => {
class="q-mr-sm"
/>
<span class="text-caption text-grey-8">สถานะไมอน</span>
</div>
</div> -->
<div class="items-center row">
<q-icon
size="10px"
@ -299,11 +331,9 @@ const monthYearThai = (val: DataDateMonthObject) => {
name="mdi-circle"
class="q-mr-sm"
/>
<span class="text-caption text-grey-8"
>สถานะอยระหวางดำเนนการ</span
>
<span class="text-caption text-grey-8">สอบสวน</span>
</div>
<div class="items-center row">
<!-- <div class="items-center row">
<q-icon
size="10px"
color="orange"
@ -311,7 +341,7 @@ const monthYearThai = (val: DataDateMonthObject) => {
class="q-mr-sm"
/>
<span class="text-caption text-grey-8">สถานะใหม</span>
</div>
</div> -->
</div>
</div>
</div>