แก้ไขความถูกต้องรายการลงเวลาพิเศษ

This commit is contained in:
AnandaTon 2023-12-06 12:07:56 +07:00
parent eb08a9f209
commit cd2c03d461
2 changed files with 15 additions and 8 deletions

View file

@ -104,6 +104,7 @@ export const useSpecialTimeStore = defineStore("LeaveSpecialTime", () => {
})
.finally(() => {
hideLoader();
console.log(month.value);
});
};
@ -118,6 +119,7 @@ export const useSpecialTimeStore = defineStore("LeaveSpecialTime", () => {
console.log(pageSize.value);
fetchData();
console.log("page");
}
//--------------|ฟิลเตอร์|--------------------------------------//

View file

@ -140,12 +140,6 @@ function filterFn() {
dataSpecialTime.fetchData();
}
/**Hook */
onMounted(async () => {
console.log("test");
await dataSpecialTime.fetchData();
});
/** Function Date */
const dateMonth = ref<any>({
month: new Date().getMonth(),
@ -159,10 +153,22 @@ const updateMonth = async (e: DataDateMonthObject) => {
dataSpecialTime.month = dateMonth.value.month + 1;
dataSpecialTime.year = dateMonth.value.year;
// filterKeyword.value = "";
await dataSpecialTime.fetchData();
console.log(dateMonth);
}
await dataSpecialTime.fetchData();
};
/**Hook */
onMounted(async () => {
//
const toDay = ref<Date>(new Date());
const monthToday = toDay.value.getMonth();
const yearToday = toDay.value.getFullYear();
dataSpecialTime.month = monthToday + 1;
dataSpecialTime.year = yearToday;
await dataSpecialTime.fetchData();
});
//
const monthYearThai = (val: any) => {
if (val == null) return "";
@ -255,7 +261,6 @@ const monthYearThai = (val: any) => {
<d-table
:columns="dataSpecialTime.columns"
:rows="dataSpecialTime.rows"
:filter="filterKeyword"
row-key="tb-list"
flat
bordered