Merge branch 'develop' into devTee
This commit is contained in:
commit
6d0edd8928
2 changed files with 22 additions and 8 deletions
|
|
@ -7,7 +7,7 @@ import timeGridPlugin from "@fullcalendar/timegrid";
|
||||||
import interactionPlugin from "@fullcalendar/interaction";
|
import interactionPlugin from "@fullcalendar/interaction";
|
||||||
import allLocales from "@fullcalendar/core/locales-all";
|
import allLocales from "@fullcalendar/core/locales-all";
|
||||||
import listPlugin from "@fullcalendar/list";
|
import listPlugin from "@fullcalendar/list";
|
||||||
import { useQuasar } from "quasar";
|
import { colors, useQuasar } from "quasar";
|
||||||
import http from "@/plugins/http";
|
import http from "@/plugins/http";
|
||||||
import config from "@/app.config";
|
import config from "@/app.config";
|
||||||
import { useRouter } from "vue-router";
|
import { useRouter } from "vue-router";
|
||||||
|
|
@ -20,6 +20,7 @@ import type {
|
||||||
|
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
import { useLeavelistDataStore } from "@/modules/09_leave/stores/LeaveStore";
|
import { useLeavelistDataStore } from "@/modules/09_leave/stores/LeaveStore";
|
||||||
|
import moment from "moment";
|
||||||
|
|
||||||
const leaveStore = useLeavelistDataStore();
|
const leaveStore = useLeavelistDataStore();
|
||||||
const mixin = useCounterMixin(); //เรียกฟังก์ชันกลาง
|
const mixin = useCounterMixin(); //เรียกฟังก์ชันกลาง
|
||||||
|
|
@ -90,22 +91,22 @@ async function fetchDataCalendar() {
|
||||||
const filterName = {
|
const filterName = {
|
||||||
id: name,
|
id: name,
|
||||||
name: convertKeycloakId(name),
|
name: convertKeycloakId(name),
|
||||||
color: name === keycloakId.value ? "green" : "grey",
|
color: "green",
|
||||||
};
|
};
|
||||||
|
|
||||||
filterLists.value.push(filterName);
|
filterLists.value.push(filterName);
|
||||||
|
filterVal.value.push(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
const data = mainData.value.filter(
|
const data = mainData.value.filter(
|
||||||
(e: any) => e.keycloakId === keycloakId.value
|
(e: any) => e.keycloakId === keycloakId.value
|
||||||
);
|
);
|
||||||
|
|
||||||
const event = data.map((e: any) => ({
|
const event = data.map((e: any) => ({
|
||||||
id: e.id,
|
id: e.id,
|
||||||
title: `${e.fullName} (${e.leaveTypeName}) `,
|
title: `${e.fullName} (${e.leaveTypeName}) `,
|
||||||
start: e.leaveStartDate,
|
start: e.leaveStartDate,
|
||||||
end: e.leaveEndDate,
|
end: moment(e.leaveEndDate).format("YYYY-MM-DD") + " 23:59:59",
|
||||||
allDay: true,
|
allDay: false,
|
||||||
color: leaveStore.colorType(e.leaveTypeId),
|
color: leaveStore.colorType(e.leaveTypeId),
|
||||||
textColor: "black",
|
textColor: "black",
|
||||||
}));
|
}));
|
||||||
|
|
@ -145,10 +146,10 @@ watch(
|
||||||
id: e.id,
|
id: e.id,
|
||||||
title: `${e.fullName} (${e.leaveTypeName}) `,
|
title: `${e.fullName} (${e.leaveTypeName}) `,
|
||||||
start: e.leaveStartDate,
|
start: e.leaveStartDate,
|
||||||
end: e.leaveEndDate,
|
end: moment(e.leaveEndDate).format("YYYY-MM-DD") + " 23:59:59",
|
||||||
color: leaveStore.colorType(e.leaveTypeId),
|
color: leaveStore.colorType(e.leaveTypeId),
|
||||||
textColor: "black",
|
textColor: "black",
|
||||||
allDay: true,
|
allDay: false,
|
||||||
}));
|
}));
|
||||||
});
|
});
|
||||||
const allEventData = [].concat(...eventData);
|
const allEventData = [].concat(...eventData);
|
||||||
|
|
@ -164,7 +165,7 @@ function redirectToDetail(id: string) {
|
||||||
* เรียกฟังก์ชันทั้งหมดตอนเรียกใช้ไฟล์นี้
|
* เรียกฟังก์ชันทั้งหมดตอนเรียกใช้ไฟล์นี้
|
||||||
*/
|
*/
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
filterVal.value.push(keycloakId.value);
|
// filterVal.value.push(keycloakId.value);
|
||||||
await fetchDataCalendar();
|
await fetchDataCalendar();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -201,6 +202,7 @@ const monthYearThai = (val: DataDateMonthObject) => {
|
||||||
</q-item>
|
</q-item>
|
||||||
</q-list>
|
</q-list>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<div class="row q-gutter-sm q-pb-sm main-content">
|
<div class="row q-gutter-sm q-pb-sm main-content">
|
||||||
<div class="demo-app-main">
|
<div class="demo-app-main">
|
||||||
|
|
|
||||||
|
|
@ -375,6 +375,18 @@ export const useCounterMixin = defineStore("mixin", () => {
|
||||||
onlycancel: true,
|
onlycancel: true,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
} else if (e.response.data.status == 400 && e.response.data.title) {
|
||||||
|
//validation errors
|
||||||
|
q.dialog({
|
||||||
|
component: CustomComponent,
|
||||||
|
componentProps: {
|
||||||
|
title: `พบข้อผิดพลาด`,
|
||||||
|
message: `${e.response.data.title}`,
|
||||||
|
icon: "warning",
|
||||||
|
color: "red",
|
||||||
|
onlycancel: true,
|
||||||
|
},
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
const message = e.response.data.result ?? e.response.data.message;
|
const message = e.response.data.result ?? e.response.data.message;
|
||||||
q.dialog({
|
q.dialog({
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue