2023-10-06 13:32:54 +07:00
|
|
|
<script setup lang="ts">
|
|
|
|
|
import { ref, onMounted } from "vue";
|
2023-10-20 16:57:32 +07:00
|
|
|
|
2023-11-09 17:20:10 +07:00
|
|
|
/**importType*/
|
2023-10-20 16:57:32 +07:00
|
|
|
import type { DataRows } from "@/modules/09_leave/interface/response/leave";
|
2023-11-09 17:20:10 +07:00
|
|
|
|
|
|
|
|
/**importStroe*/
|
2023-10-20 10:31:07 +07:00
|
|
|
import { useLeavelistDataStore } from "@/modules/09_leave/stores/LeaveStore";
|
2023-11-09 17:20:10 +07:00
|
|
|
import { useLeavelistDataStoreTest } from "@/modules/09_leave/stores/ListLeave";
|
|
|
|
|
|
|
|
|
|
/**importComponets*/
|
2023-10-20 10:31:07 +07:00
|
|
|
import TableList from "@/modules/09_leave/components/2_Leave/TableList.vue";
|
2023-10-20 16:57:32 +07:00
|
|
|
import ToolBar from "@/modules/09_leave/components/2_Leave/ToolBar.vue";
|
2023-11-09 17:20:10 +07:00
|
|
|
|
2023-10-06 13:32:54 +07:00
|
|
|
const leaveStore = useLeavelistDataStore();
|
2023-11-09 17:20:10 +07:00
|
|
|
const APIDATA = useLeavelistDataStoreTest();
|
2023-10-19 15:39:18 +07:00
|
|
|
const { fetchList, clearFilter } = leaveStore;
|
2023-10-06 13:32:54 +07:00
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
|
|
|
fecthLeaveList();
|
|
|
|
|
});
|
2023-11-09 17:20:10 +07:00
|
|
|
/**
|
|
|
|
|
* เรียกข้อมูลจาก API
|
|
|
|
|
*/
|
2023-10-06 13:32:54 +07:00
|
|
|
function fecthLeaveList() {
|
2023-11-09 17:20:10 +07:00
|
|
|
console.log(APIDATA.data);
|
|
|
|
|
|
|
|
|
|
const data = APIDATA.data;
|
|
|
|
|
|
|
|
|
|
fetchList(data); /** ส่งข้อมูลไป stores*/
|
2023-10-06 13:32:54 +07:00
|
|
|
}
|
2023-11-09 17:20:10 +07:00
|
|
|
|
|
|
|
|
/** เปลี่ยน TAB*/
|
2023-10-06 13:32:54 +07:00
|
|
|
function changTab() {
|
|
|
|
|
clearFilter();
|
|
|
|
|
fecthLeaveList();
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
<template>
|
|
|
|
|
<div class="toptitle text-dark col-12 row items-center">รายการลา</div>
|
|
|
|
|
<div>
|
2023-11-03 15:08:53 +07:00
|
|
|
<q-card flat bordered class="col-12 q-mt-sm q-pt-sm q-pa-md">
|
|
|
|
|
<ToolBar />
|
|
|
|
|
<TableList />
|
2023-10-18 12:26:05 +07:00
|
|
|
</q-card>
|
2023-10-06 13:32:54 +07:00
|
|
|
</div>
|
|
|
|
|
</template>
|