Refactoring code module 05_leave
This commit is contained in:
parent
763ec2fd95
commit
4253226ac3
23 changed files with 383 additions and 532 deletions
|
|
@ -1,43 +1,41 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, onMounted, watch } from "vue";
|
||||
import { useQuasar } from "quasar";
|
||||
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import { tokenParsed } from "@/plugins/auth";
|
||||
/**import calendar*/
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
|
||||
import FullCalendar from "@fullcalendar/vue3";
|
||||
import dayGridPlugin from "@fullcalendar/daygrid";
|
||||
// import type { CalendarOptions } from "@fullcalendar/core"
|
||||
import timeGridPlugin from "@fullcalendar/timegrid";
|
||||
import interactionPlugin from "@fullcalendar/interaction";
|
||||
import allLocales from "@fullcalendar/core/locales-all";
|
||||
import listPlugin from "@fullcalendar/list";
|
||||
|
||||
/** import type*/
|
||||
import type { DataDateMonthObject } from "@/modules/05_leave/interface/request/Calendar.ts";
|
||||
import type {
|
||||
DataCalendar,
|
||||
LeaveType,
|
||||
} from "@/modules/05_leave/interface/response/leave";
|
||||
|
||||
/** import componest*/
|
||||
import DialogDetail from "@/modules/05_leave/components/DialogDetail.vue";
|
||||
|
||||
/** import stort*/
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
|
||||
// import { aR } from "@fullcalendar/core/internal-common"
|
||||
/**ตัวแปรที่ใช้ */
|
||||
const $q = useQuasar();
|
||||
const mixin = useCounterMixin();
|
||||
const { showLoader, hideLoader, messageError, monthYear2Thai } = mixin;
|
||||
const $q = useQuasar();
|
||||
const emit = defineEmits(["update:dateYear"]);
|
||||
const fullName = ref<string>("");
|
||||
|
||||
const mainData = ref<DataCalendar[]>([]);
|
||||
const keycloakId = ref<string>("");
|
||||
const modal = ref<boolean>(false);
|
||||
const leaveId = ref<string>("");
|
||||
|
||||
/** filter calendar left */
|
||||
const filterLists = ref<any>([]);
|
||||
const filterVal = ref<any>([keycloakId.value]);
|
||||
|
||||
/**
|
||||
* Option ของปฏิทิน
|
||||
*/
|
||||
|
|
@ -129,7 +127,7 @@ async function fetchDataCalendar() {
|
|||
/**
|
||||
* fetch วันหยุดในปฏิทิน
|
||||
*/
|
||||
const fetchData = async () => {
|
||||
async function fetchData() {
|
||||
showLoader();
|
||||
await http
|
||||
.get(
|
||||
|
|
@ -175,7 +173,7 @@ const fetchData = async () => {
|
|||
.finally(async () => {
|
||||
hideLoader();
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
/**function แปลงkeycloakId */
|
||||
function convertKeycloakId(id: any) {
|
||||
|
|
@ -228,10 +226,6 @@ async function onClickClose() {
|
|||
modal.value = false;
|
||||
}
|
||||
|
||||
/** filter calendar left */
|
||||
const filterLists = ref<any>([]);
|
||||
const filterVal = ref<any>([keycloakId.value]);
|
||||
|
||||
/**** ตรวจสอบว่ามีการส่งข้อมูลเข้ามาที่Calendar */
|
||||
watch(
|
||||
() => filterVal.value,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue