filter ==> ข้อมูลเกี่ยวกับบุคคล
This commit is contained in:
parent
404a47e78b
commit
6152fa3bef
11 changed files with 82 additions and 45 deletions
|
|
@ -7,10 +7,11 @@ import type {
|
|||
DataRow,
|
||||
} from "../interface/response/personal/personal";
|
||||
|
||||
const { date2Thai } = useCounterMixin();
|
||||
const { date2Thai, onSearchDataTable } = useCounterMixin();
|
||||
|
||||
export const usePersonalDataStore = defineStore("PersonalData", () => {
|
||||
const row = ref<DataRow[]>([]); // ข้อมูลในตาราง
|
||||
const rowMain = ref<DataRow[]>([]); // ข้อมูลในตาราง
|
||||
const currentTab = ref<string>("list_prefix"); // Tab ปัจจุบัน
|
||||
|
||||
/**
|
||||
|
|
@ -19,6 +20,7 @@ export const usePersonalDataStore = defineStore("PersonalData", () => {
|
|||
*/
|
||||
async function save(data: DataResponse[]) {
|
||||
row.value = [];
|
||||
rowMain.value = [];
|
||||
const list = data.map((e) => ({
|
||||
...e,
|
||||
createdAt: e.createdAt ? date2Thai(e.createdAt, false, true) : "-",
|
||||
|
|
@ -26,12 +28,19 @@ export const usePersonalDataStore = defineStore("PersonalData", () => {
|
|||
? date2Thai(e.lastUpdatedAt, false, true)
|
||||
: "-",
|
||||
}));
|
||||
|
||||
row.value = list;
|
||||
rowMain.value = list;
|
||||
}
|
||||
|
||||
function onSearchData(keyword: string, columns: any = []) {
|
||||
row.value = onSearchDataTable(keyword, rowMain.value, columns);
|
||||
}
|
||||
|
||||
return {
|
||||
save,
|
||||
row,
|
||||
currentTab,
|
||||
onSearchData,
|
||||
};
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue