ผูก API รายลงเวลาปฏิบัติงานของ Admin (รายการลงเวลา)

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2023-11-15 14:25:45 +07:00
parent c76af202de
commit e693e024e6
9 changed files with 557 additions and 295 deletions

View file

@ -1,89 +1,23 @@
<script setup lang="ts">
import { ref, onMounted } from "vue";
/** importStores */
import { useCounterMixin } from "@/stores/mixin";
import { useWorklistDataStore } from "@/modules/09_leave/stores/WorkStore";
import { ref, onMounted, watch } from "vue";
import http from "@/plugins/http";
import config from "@/app.config";
/** import Components */
import TableList from "@/modules/09_leave/components/1_Work/TableList.vue";
import ToolBar from "@/modules/09_leave/components/1_Work/ToolBar.vue";
import ToolBarDate from "../components/1_Work/ToolBarDate.vue";
import Tab1 from "@/modules/09_leave/components/1_Work/Tab1.vue";
import Tab2 from "@/modules/09_leave/components/1_Work/Tab2.vue";
/** import Type */
import type { DataRes } from "@/modules/09_leave/interface/response/work";
// /** importStores */
// import { useCounterMixin } from "@/stores/mixin";
// import { useWorklistDataStore } from "@/modules/09_leave/stores/WorkStore";
/** use Store */
const mixin = useCounterMixin();
const workStore = useWorklistDataStore();
const { date2Thai } = mixin;
const { fetchList } = workStore;
// const mixin = useCounterMixin();
// const workStore = useWorklistDataStore();
// const { dateToISO, date2Thai, showLoader, hideLoader } = mixin;
// const { fetchListLog, fetchListTime } = workStore;
const tab = ref("1");
/** Hook */
onMounted(() => {
fecthWorkList();
});
/** เรียกข้อมูลรายการลงเวลาปฏิบัติงาน */
function fecthWorkList() {
const listData: DataRes[] = [
{
fullName: "นายกัณฐิมา กาฬสินธ์ุ",
timeIn: "8:04",
coordinatesIn: "สำนักงาน",
latIn: "18.7903",
longIn: "99.0029",
timeOut: "18:04",
coordinatesOut: "สำนักงาน",
latOut: "18.7903",
longOut: "99.0029",
status: "normal",
date: new Date(new Date()),
},
{
fullName: "นายนครชัย วันดี",
timeIn: "8:04",
coordinatesIn: "สำนักงาน",
latIn: "18.7903",
longIn: "99.0029",
timeOut: "18:04",
coordinatesOut: "สำนักงาน",
latOut: "18.7903",
longOut: "99.0029",
status: "late",
date: new Date(new Date()),
},
{
fullName: "นายปิยรมย์ ศิริธาราฟ",
timeIn: "8:04",
coordinatesIn: "สำนักงาน",
latIn: "18.7903",
longIn: "99.0029",
timeOut: "18:04",
coordinatesOut: "สำนักงาน",
latOut: "18.7903",
longOut: "99.0029",
status: "absent",
date: new Date("2023-10-27"),
},
{
fullName: "นางสาวปลาทอง ใจกล้า",
timeIn: "8:04",
coordinatesIn: "สำนักงาน",
latIn: "18.7903",
longIn: "99.0029",
timeOut: "18:04",
coordinatesOut: "สำนักงาน",
latOut: "18.7903",
longOut: "99.0029",
status: "normal",
date: new Date("2023-10-27"),
},
];
fetchList(listData); // stores
}
</script>
<template>
<div class="toptitle text-dark col-12 row items-center">
@ -110,14 +44,16 @@ function fecthWorkList() {
<q-tab-panels v-model="tab" animated>
<q-tab-panel name="1">
<!-- <TableList1 /> -->
<ToolBar />
<TableList />
<!-- <ToolBar /> -->
<Tab1 />
<!-- <TableList /> -->
</q-tab-panel>
<q-tab-panel name="2">
<!-- <TabList2Vue /> -->
<ToolBarDate />
<TableList />
<!-- <ToolBarDate /> -->
<Tab2 />
<!-- <TableList /> -->
</q-tab-panel>
</q-tab-panels>
<!-- </q-card> -->