อัตรากำลังลูกจ้างประจำ ฯ
This commit is contained in:
parent
ac0bc84da3
commit
93fd5012eb
6 changed files with 114 additions and 91 deletions
|
|
@ -1100,6 +1100,26 @@ export const useCounterMixin = defineStore("mixin", () => {
|
|||
.catch((error) => console.error("ดาวน์โหลดไฟล์ไม่สำเร็จ:", error));
|
||||
}
|
||||
|
||||
function filterTableQuasar(keyword: string, data: any[], columns: any[]) {
|
||||
const searchText = keyword.trim().toLowerCase();
|
||||
|
||||
if (!searchText) {
|
||||
return data; // คืนค่าทั้งหมดถ้าไม่มีข้อความค้นหา
|
||||
}
|
||||
|
||||
// คืนค่าข้อมูลที่กรองแล้ว
|
||||
return data.filter((row: any) => {
|
||||
return columns.some((col: any) => {
|
||||
const rawValue = row[col.field];
|
||||
const formattedValue = col.format
|
||||
? col.format(rawValue, row) // ใช้ `format` ถ้ามี
|
||||
: rawValue;
|
||||
|
||||
return String(formattedValue).toLowerCase().includes(searchText);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
return {
|
||||
calAge,
|
||||
date2Thai,
|
||||
|
|
@ -1143,5 +1163,7 @@ export const useCounterMixin = defineStore("mixin", () => {
|
|||
findPosMasterNoOld,
|
||||
pathRegistryEmp,
|
||||
downloadRenameFileByLink,
|
||||
|
||||
filterTableQuasar,
|
||||
};
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue