ปรับ code การลา
This commit is contained in:
parent
10bbc9794a
commit
3ee1a64a78
12 changed files with 49 additions and 852 deletions
|
|
@ -1,34 +1,37 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, watch, onMounted } from "vue";
|
||||
import { useRouter } from "vue-router";
|
||||
import { useQuasar } from "quasar";
|
||||
import type { CalendarOptions } from "@fullcalendar/core";
|
||||
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 { colors, useQuasar } from "quasar";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import { useRouter } from "vue-router";
|
||||
import keycloak from "@/plugins/keycloak";
|
||||
import moment from "moment";
|
||||
|
||||
/** importType*/
|
||||
import type {
|
||||
DataDateMonthObject,
|
||||
ResCalendar,
|
||||
} from "@/modules/09_leave/interface/response/leave";
|
||||
|
||||
/** importStore*/
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useLeavelistDataStore } from "@/modules/09_leave/stores/LeaveStore";
|
||||
import moment from "moment";
|
||||
|
||||
/** use*/
|
||||
const leaveStore = useLeavelistDataStore();
|
||||
const mixin = useCounterMixin(); //เรียกฟังก์ชันกลาง
|
||||
const { showLoader, hideLoader, messageError, monthYear2Thai } = mixin;
|
||||
|
||||
const $q = useQuasar();
|
||||
const router = useRouter();
|
||||
|
||||
const { showLoader, hideLoader, messageError, monthYear2Thai } = mixin;
|
||||
|
||||
const keycloakId = ref<string>(
|
||||
keycloak.tokenParsed ? keycloak.tokenParsed.sub!.toString() : ""
|
||||
);
|
||||
|
|
@ -73,6 +76,7 @@ const dateMonth = ref<DataDateMonthObject>({
|
|||
});
|
||||
const mainData = ref<ResCalendar[]>([]);
|
||||
|
||||
/** function เรียกข้อมูล Calendar*/
|
||||
async function fetchDataCalendar() {
|
||||
showLoader();
|
||||
await http
|
||||
|
|
@ -125,6 +129,10 @@ async function fetchDataCalendar() {
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* function convert ชื่อ
|
||||
* @param id profile
|
||||
*/
|
||||
function convertKeycloakId(id: any) {
|
||||
const filterName = mainData.value.find(
|
||||
(e: ResCalendar) => e.keycloakId === id
|
||||
|
|
@ -165,10 +173,10 @@ function redirectToDetail(id: string) {
|
|||
* เรียกฟังก์ชันทั้งหมดตอนเรียกใช้ไฟล์นี้
|
||||
*/
|
||||
onMounted(async () => {
|
||||
// filterVal.value.push(keycloakId.value);
|
||||
await fetchDataCalendar();
|
||||
});
|
||||
|
||||
/** function เปลี่ยน calendar*/
|
||||
async function changCalendar() {
|
||||
await fetchDataCalendar();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue