ปรับ ui form
This commit is contained in:
parent
8ea5ad36da
commit
68ef892d62
8 changed files with 230 additions and 246 deletions
|
|
@ -16,6 +16,8 @@ export const useChekIn = defineStore("checkin", () => {
|
|||
status: e.status,
|
||||
Morningstatus: convertStatus(e.Morningstatus),
|
||||
AfternoonStatus: convertStatus(e.AfternoonStatus),
|
||||
statusEdit: e.statusEdit,
|
||||
statusEditName: convertStatusEdit(e.statusEdit),
|
||||
}));
|
||||
rows.value = datalist;
|
||||
}
|
||||
|
|
@ -32,9 +34,28 @@ export const useChekIn = defineStore("checkin", () => {
|
|||
return "";
|
||||
}
|
||||
}
|
||||
function convertStatusEdit(val: string) {
|
||||
switch (val) {
|
||||
case "edit":
|
||||
return "ขอแก้ไข";
|
||||
case "wait":
|
||||
return "รออนุมัติ";
|
||||
case "approve":
|
||||
return "อนุมัติ";
|
||||
}
|
||||
}
|
||||
function classColorStatus(val: string) {
|
||||
switch (val) {
|
||||
case "wait":
|
||||
return "orange";
|
||||
case "approve":
|
||||
return "green";
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
rows,
|
||||
fetchHistoryList,
|
||||
classColorStatus,
|
||||
};
|
||||
});
|
||||
|
|
|
|||
|
|
@ -68,8 +68,21 @@ export const useCounterMixin = defineStore("mixin", () => {
|
|||
dstTime
|
||||
);
|
||||
}
|
||||
function covertDateObject(date: string) {
|
||||
if (date) {
|
||||
const dateParts = date.split("/");
|
||||
// ประกาศตัวแปรเพื่อเก็บค่าวันที่, เดือน, และ ปี
|
||||
const day = parseInt(dateParts[0], 10);
|
||||
const month = parseInt(dateParts[1], 10) - 1;
|
||||
const year = parseInt(dateParts[2], 10) + 2500;
|
||||
// สร้างอ็อบเจ็กต์ Date ด้วยค่าที่ได้
|
||||
const dateObject = new Date(year, month, day);
|
||||
return date2Thai(dateObject);
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
date2Thai,
|
||||
covertDateObject,
|
||||
};
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue