UI ข้อมูลบุคคล

This commit is contained in:
oat 2024-02-02 13:15:14 +07:00
parent 0c85176b10
commit cab4420aca
7 changed files with 2414 additions and 12 deletions

View file

@ -0,0 +1,25 @@
import { defineStore } from "pinia";
import { ref } from "vue";
import type {
DataResponse,
DataRow,
} from "../interface/response/insignia/Insignia";
import { useCounterMixin } from "@/stores/mixin";
const { date2Thai } = useCounterMixin();
export const usePersonalDataStore = defineStore("PersonalData", () => {
const row = ref<DataRow[]>([]);
function fetchData(data: DataResponse[]) {
const list = data.map((e) => ({
...e,
createdAt: e.createdAt ? date2Thai(e.createdAt) : "",
lastUpdatedAt: e.lastUpdatedAt ? date2Thai(e.lastUpdatedAt) : "",
}));
row.value = list;
}
return {
fetchData,
row,
};
});