From 5722ced3697edf3dcdc838887b45c1f526439e43 Mon Sep 17 00:00:00 2001 From: oat_dev Date: Tue, 19 Mar 2024 11:57:10 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B8=97=E0=B8=B0=E0=B9=80=E0=B8=9A=E0=B8=B5?= =?UTF-8?q?=E0=B8=A2=E0=B8=99=E0=B8=9B=E0=B8=A3=E0=B8=B0=E0=B8=A7=E0=B8=B1?= =?UTF-8?q?=E0=B8=95=E0=B8=B4:=20=E0=B8=9B=E0=B8=A3=E0=B8=B0=E0=B8=A7?= =?UTF-8?q?=E0=B8=B1=E0=B8=95=E0=B8=B4=E0=B8=81=E0=B8=B2=E0=B8=A3=E0=B8=A8?= =?UTF-8?q?=E0=B8=B6=E0=B8=81=E0=B8=A9=E0=B8=B2=20=E0=B9=81=E0=B8=81?= =?UTF-8?q?=E0=B9=89=E0=B8=81=E0=B8=B2=E0=B8=A3=E0=B8=84=E0=B9=89=E0=B8=99?= =?UTF-8?q?=E0=B8=AB=E0=B8=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PersonalInformation/05_Education.vue | 59 +++++++++---------- 1 file changed, 27 insertions(+), 32 deletions(-) diff --git a/src/modules/04_registryNew/components/detail/PersonalInformation/05_Education.vue b/src/modules/04_registryNew/components/detail/PersonalInformation/05_Education.vue index 666b6f44a..58d905d23 100644 --- a/src/modules/04_registryNew/components/detail/PersonalInformation/05_Education.vue +++ b/src/modules/04_registryNew/components/detail/PersonalInformation/05_Education.vue @@ -53,7 +53,10 @@ const columns = ref([ align: "left", label: "ตั้งแต่", sortable: true, - field: "startDate", + field: (v) => + v.isDate + ? date2Thai(v.startDate) + : new Date(v.startDate).getFullYear() + 543, headerStyle: "font-size: 14px", style: "font-size: 14px", sort: (a: string, b: string) => @@ -64,7 +67,8 @@ const columns = ref([ align: "left", label: "ถึง", sortable: true, - field: "endDate", + field: (v) => + v.isDate ? date2Thai(v.endDate) : new Date(v.endDate).getFullYear() + 543, headerStyle: "font-size: 14px", style: "font-size: 14px", sort: (a: string, b: string) => @@ -76,6 +80,7 @@ const columns = ref([ label: "วันที่สำเร็จการศึกษา", sortable: true, field: "finishDate", + format: (v) => date2Thai(v), headerStyle: "font-size: 14px", style: "font-size: 14px", sort: (a: string, b: string) => @@ -89,6 +94,7 @@ const columns = ref([ field: "isEducation", headerStyle: "font-size: 14px", style: "font-size: 14px", + format: (v) => (v === true ? "ใช่" : "ไม่ใช่"), sort: (a: string, b: string) => a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), }, @@ -334,7 +340,6 @@ async function fetchData(id: string) { .get(config.API.profileNewEducationByProfileId(id)) .then(async (res) => { rows.value = res.data.result; - console.log(rows.value); }) .catch((err) => { messageError($q, err); @@ -350,7 +355,6 @@ async function fetchHistoryData(id: string) { .get(config.API.profileNewEducationHisByEducationId(id)) .then(async (res) => { historyRows.value = res.data.result; - console.log(historyRows.value); }) .catch((err) => { messageError($q, err); @@ -361,7 +365,6 @@ async function fetchHistoryData(id: string) { } async function addData() { - console.log(educationData.durationYear); await http .post(config.API.profileNewEducation, { profileId: id.value, @@ -451,7 +454,6 @@ watch( () => isDate.value, () => { if (isDate.value === "false") { - console.log(educationData.startDate); educationData.startYear = +educationData.startDate .toString() .slice(11, 15); @@ -613,19 +615,7 @@ onMounted(async () => {