แก้ UI เครื่องราช
This commit is contained in:
parent
dabc016e39
commit
42e7fd6b1d
5 changed files with 557 additions and 145 deletions
28
src/modules/01_metadataNew/stores/InsigniaStore.ts
Normal file
28
src/modules/01_metadataNew/stores/InsigniaStore.ts
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
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 useInsigniaDataStore = defineStore("insigniaData", () => {
|
||||
const row = ref<DataRow[]>();
|
||||
function fetchData(data: DataResponse[]) {
|
||||
console.log(data);
|
||||
const list = data.map((e) => ({
|
||||
...e,
|
||||
createdAt: e.createdAt ? date2Thai(e.createdAt) : "",
|
||||
lastUpdatedAt: e.lastUpdatedAt ? date2Thai(e.lastUpdatedAt) : "",
|
||||
}));
|
||||
console.log(list);
|
||||
row.value = list;
|
||||
}
|
||||
|
||||
return {
|
||||
fetchData,
|
||||
row,
|
||||
};
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue