แก้ date2thai

This commit is contained in:
setthawutttty 2024-01-31 17:54:34 +07:00
parent f38acf3eaa
commit 7e3ddc3fa0

View file

@ -76,13 +76,13 @@ function postData() {
}) })
.then((res) => { .then((res) => {
const dataList = res.data.result; const dataList = res.data.result;
dataList.map((item: HistoryPostType) => ({ const dataMap = dataList.map((item: HistoryPostType) => ({
id: item.id ? item.id : "-", id: item.id ? item.id : "-",
name: item.name ? item.name : "-", name: item.name ? item.name : "-",
lastUpdatedAt: item.lastUpdatedAt ? date2Thai(item.lastUpdatedAt,false,true) : "-", lastUpdatedAt: item.lastUpdatedAt ? date2Thai(item.lastUpdatedAt as Date,false,true) : "-",
orgRevisionName: item.orgRevisionName ? item.orgRevisionName : "-", orgRevisionName: item.orgRevisionName ? item.orgRevisionName : "-",
})); }));
rows.value = dataList; rows.value = dataMap;
}) })
.catch((e) => { .catch((e) => {
messageError($q, e); messageError($q, e);
@ -105,7 +105,7 @@ watch(
<q-dialog v-model="modal" persistent> <q-dialog v-model="modal" persistent>
<q-card style="min-width: 40vw"> <q-card style="min-width: 40vw">
<DialogHeader <DialogHeader
:tittle="type == 0 ? `ประวัติหน่ยงาน` : `ประวัติส่วนราชการ`" :tittle="type == 0 ? `ประวัติหน่ยงาน` : `ประวัติส่วนราชการ`"
:close="() => (modal = false)" :close="() => (modal = false)"
/> />
<q-separator /> <q-separator />
@ -137,7 +137,7 @@ watch(
v-if="col.name === 'name'" v-if="col.name === 'name'"
class="text-weight-medium" class="text-weight-medium"
> >
{{ type === 0 ? "ชื่อหน่ยงาน" : "ส่วนราชการ" }} {{ type === 0 ? "ชื่อหน่ยงาน" : "ส่วนราชการ" }}
</span> </span>
<span class="text-weight-medium">{{ col.label }}</span> <span class="text-weight-medium">{{ col.label }}</span>