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

65 lines
1.8 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
import type { DataRows } from "@/modules/09_leave/interface/response/leave";
2023-10-06 13:32:54 +07:00
// importStroe
2023-10-20 10:31:07 +07:00
import { useLeavelistDataStore } from "@/modules/09_leave/stores/LeaveStore";
2023-10-06 13:32:54 +07:00
// 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();
2023-10-19 15:39:18 +07:00
const { fetchList, clearFilter } = leaveStore;
2023-10-06 13:32:54 +07:00
onMounted(() => {
fecthLeaveList();
});
2023-10-09 09:31:01 +07:00
// เรียกข้อมูลจาก API
2023-10-06 13:32:54 +07:00
function fecthLeaveList() {
2023-11-03 15:08:53 +07:00
const data = [
2023-10-06 13:32:54 +07:00
{
id: "00000000-0000-0000-0000-000000000000",
2023-11-06 12:12:54 +07:00
leaveType: "leave1",
2023-10-06 13:32:54 +07:00
name: "นายกัณฐิมา กาฬสินธ์ุ",
2023-11-03 15:08:53 +07:00
Date: "2023-11-03",
status: "NEW",
2023-10-06 13:32:54 +07:00
},
{
id: "00000000-0000-0000-0000-000000000000",
2023-11-06 12:12:54 +07:00
leaveType: "leave1",
2023-10-06 13:32:54 +07:00
name: "นายนครชัย วันดี",
2023-11-03 15:08:53 +07:00
Date: "2023-11-01",
status: "APPROVE",
2023-10-06 13:32:54 +07:00
},
{
id: "00000000-0000-0000-0000-000000000000",
2023-11-06 12:12:54 +07:00
leaveType: "leave1",
2023-10-06 13:32:54 +07:00
name: "นายกัณฐิมา กาฬสินธ์ุ",
2023-11-03 15:08:53 +07:00
Date: "2023-11-02",
status: "PENDING",
2023-10-06 13:32:54 +07:00
},
{
id: "00000000-0000-0000-0000-000000000000",
2023-11-06 12:12:54 +07:00
leaveType: "leave2",
2023-10-06 13:32:54 +07:00
name: "นายปิยรมย์ ศิริธาราฟ",
2023-11-03 15:08:53 +07:00
Date: "2023-11-01",
status: "PENDING",
2023-10-06 13:32:54 +07:00
},
];
2023-10-19 15:39:18 +07:00
fetchList(data); // ส่งข้อมูลไป stores
2023-10-06 13:32:54 +07:00
}
//เปลี่ยน Tab
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>