hrms-mgt/src/modules/09_leave/views/LeaveListMain.vue

44 lines
1.2 KiB
Vue
Raw Normal View History

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
/**importType*/
2023-10-20 16:57:32 +07:00
import type { DataRows } from "@/modules/09_leave/interface/response/leave";
/**importStroe*/
2023-10-20 10:31:07 +07:00
import { useLeavelistDataStore } from "@/modules/09_leave/stores/LeaveStore";
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-10-06 13:32:54 +07:00
const leaveStore = useLeavelistDataStore();
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();
});
/** เรียกข้อมูลจาก API*/
2023-10-06 13:32:54 +07:00
function fecthLeaveList() {
const data = APIDATA.data;
fetchList(data); /** ส่งข้อมูลไป stores*/
2023-10-06 13:32:54 +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 />
</q-card>
2023-10-06 13:32:54 +07:00
</div>
</template>