Merge branch 'develop' into devTee

This commit is contained in:
setthawutttty 2023-10-31 16:21:32 +07:00
commit d6040fe95e
8 changed files with 48 additions and 33 deletions

View file

@ -13,7 +13,7 @@ export const useWorklistDataStore = defineStore("work", () => {
const visibleColumns = ref<string[]>([]);
const dataMain = ref<TableRows[]>([])
function fetchList(data: DataRes[]) {
let datalist = data.map((e: DataRes) => ({
let datalist: TableRows[] = data.map((e: DataRes) => ({
fullName: e.fullName,
timeIn: e.timeIn,
coordinatesIn: e.coordinatesIn,
@ -33,11 +33,17 @@ export const useWorklistDataStore = defineStore("work", () => {
//ค้นหาข้อมูล
const filterTable = ref<string>('')
const selectDate = ref<Date | null>(null);
const selectDate = ref<Date | null>(new Date());
const selectStatus = ref<String>('all')
const optionStatusMain = ref<DataOption[]>([])
const optionStatus = ref<DataOption[]>([])
function searchDataFn(searchDate: any, searchStatus: any) {
let a = new Date(searchDate);// วันที่เลือก
let b = new Date(); // วันที่ปัจจุบัน
if (a > b) {
selectDate.value = new Date()
searchDate = new Date()
}
searchStatus = searchStatus || "all";
if (searchDate == null && searchStatus == "all") {
rows.value = dataMain.value
@ -84,12 +90,12 @@ export const useWorklistDataStore = defineStore("work", () => {
// convertSatatus
function convertSatatus(val: string) {
switch (val) {
case "1":
return "ลงเวลาเรียบร้อย"
case "2":
return "สายทำงานครบ"
default:
return "ยังไม่ได้ลงเวลา"
case "normal":
return "ปกติ"
case "late":
return "สาย"
case "absent":
return "ขาดราชการ"
}
}
return {