update ปฎิทิน
This commit is contained in:
parent
a00b9313ed
commit
83dc2d90a5
2 changed files with 62 additions and 5 deletions
|
|
@ -13,11 +13,11 @@
|
|||
<div class="row col-12">
|
||||
<div class="row items-center">
|
||||
<!-- filter เลือกเดือนปี -->
|
||||
<datepicker v-model="dateMonth" :locale="'th'" autoApply month-picker :enableTimePicker="false" v-if="currentTab === 'calendar'">
|
||||
<datepicker v-model="dateMonth" :locale="'th'" autoApply month-picker :enableTimePicker="false" v-if="currentTab === 'calendar'" @update:modelValue="updateMonth">
|
||||
<template #year="{ year }">{{ year + 543 }}</template>
|
||||
<template #year-overlay-value="{ value }">{{ parseInt(value + 543) }}</template>
|
||||
<template #trigger>
|
||||
<q-input :model-value="monthYearThai(dateMonth)" dense outlined hide-bottom-space style="width: 130px">
|
||||
<q-input :model-value="monthYearThai(dateMonth)" dense outlined style="width: 130px">
|
||||
<template v-slot:prepend>
|
||||
<q-icon name="event" class="cursor-pointer" style="color: var(--q-primary)"> </q-icon>
|
||||
</template>
|
||||
|
|
@ -179,8 +179,17 @@ const dateMonth = ref<DataDateMonthObject>({
|
|||
month: new Date().getMonth(),
|
||||
year: new Date().getFullYear(),
|
||||
})
|
||||
console.log(dateMonth.value)
|
||||
const props = defineProps({
|
||||
dateYear: Number, //ปีที่ส่งไป parent สรุปวันหยุด
|
||||
fetchDataSummaryCalendar: {
|
||||
//ฟังก์ชันอัพเดทสรุปวันหยุด
|
||||
type: Function,
|
||||
default: () => console.log("not function"),
|
||||
},
|
||||
})
|
||||
const dateYear = ref<number>(new Date().getFullYear())
|
||||
|
||||
const emit = defineEmits(["update:dateYear"])
|
||||
const mixin = useCounterMixin() //เรียกฟังก์ชันกลาง
|
||||
const { monthYear2Thai } = mixin
|
||||
/**
|
||||
|
|
@ -192,6 +201,16 @@ const monthYearThai = (val: DataDateMonthObject) => {
|
|||
else return monthYear2Thai(val.month, val.year)
|
||||
}
|
||||
|
||||
const updateMonth = async (e: DataDateMonthObject) => {
|
||||
console.log(dateMonth.value)
|
||||
if (e != null) {
|
||||
dateYear.value = e.year
|
||||
emit("update:dateYear", e.year)
|
||||
await props.fetchDataSummaryCalendar()
|
||||
}
|
||||
console.log(dateMonth.value)
|
||||
}
|
||||
|
||||
const value = ref(90)
|
||||
const itemPie = ref([
|
||||
{ text: "ลาป่วย", color: "text-pink-5", value: 90, all: "10", use: "9", remain: "1" },
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue