upload new version
This commit is contained in:
parent
dd5a007ac1
commit
ab5bc54f6a
47 changed files with 1881 additions and 0 deletions
40
src/stores/chekin.ts
Normal file
40
src/stores/chekin.ts
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
import { defineStore } from "pinia";
|
||||
import { ref } from "vue";
|
||||
|
||||
export const useChekIn = defineStore("checkin", () => {
|
||||
const rows = ref<any>();
|
||||
|
||||
function fetchHistoryList(data: any) {
|
||||
console.log(data);
|
||||
const datalist = data.map((e: any) => ({
|
||||
no: e.no,
|
||||
date: e.date,
|
||||
in: e.in,
|
||||
loIn: e.loIn,
|
||||
out: e.out,
|
||||
loOut: e.loOut,
|
||||
status: e.status,
|
||||
Morningstatus: convertStatus(e.Morningstatus),
|
||||
AfternoonStatus: convertStatus(e.AfternoonStatus),
|
||||
}));
|
||||
rows.value = datalist;
|
||||
}
|
||||
|
||||
function convertStatus(status: string) {
|
||||
switch (status) {
|
||||
case "1":
|
||||
return "ขาดราชการ";
|
||||
case "2":
|
||||
return "ปกติ";
|
||||
case "3":
|
||||
return "สาย";
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
rows,
|
||||
fetchHistoryList,
|
||||
};
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue