filter ==> ข้อมูลเครื่องราชอิสริยาภรณ์
This commit is contained in:
parent
b4c9762a2a
commit
6b980a118b
3 changed files with 23 additions and 19 deletions
|
|
@ -6,10 +6,11 @@ import type {
|
|||
} from "../interface/response/insignia/Insignia";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
|
||||
const { date2Thai } = useCounterMixin();
|
||||
const { date2Thai, onSearchDataTable } = useCounterMixin();
|
||||
|
||||
export const useInsigniaDataStore = defineStore("insigniaData", () => {
|
||||
const row = ref<DataRow[]>([]);
|
||||
const rowMain = ref<DataRow[]>([]);
|
||||
|
||||
async function fetchData(data: DataResponse[], insigniaType?: string) {
|
||||
const list = data.map((e) => ({
|
||||
|
|
@ -20,12 +21,18 @@ export const useInsigniaDataStore = defineStore("insigniaData", () => {
|
|||
? date2Thai(e.lastUpdatedAt, false, true)
|
||||
: "-",
|
||||
}));
|
||||
list;
|
||||
|
||||
row.value = list;
|
||||
rowMain.value = list;
|
||||
}
|
||||
|
||||
function onSearchData(keyword: string, columns: any = []) {
|
||||
row.value = onSearchDataTable(keyword, rowMain.value, columns);
|
||||
}
|
||||
|
||||
return {
|
||||
fetchData,
|
||||
row,
|
||||
onSearchData,
|
||||
};
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue