From d73fbf80f91ad4af7efcfdd6d7c0de18b12d7010 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Fri, 22 May 2026 17:51:03 +0700 Subject: [PATCH 01/10] fix(organization): prevent displaying null for prefix --- src/modules/02_organization/components/DialogHistoryPos.vue | 6 ++++-- .../16_positionEmployee/components/DialogMovePos.vue | 2 +- src/modules/16_positionEmployee/components/TableMain.vue | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/modules/02_organization/components/DialogHistoryPos.vue b/src/modules/02_organization/components/DialogHistoryPos.vue index 4b9651bcf..eed16a660 100644 --- a/src/modules/02_organization/components/DialogHistoryPos.vue +++ b/src/modules/02_organization/components/DialogHistoryPos.vue @@ -213,7 +213,9 @@ function formatHistoryOwnerData(data: HistoryPos[]) { return data.map((item) => ({ ...item, fullname: item.firstName - ? `${item.prefix}${item.firstName} ${item.lastName}`.trim() + ? `${item.prefix || ""}${item.firstName || ""} ${ + item.lastName || "" + }`.trim() : "ว่าง", })); } @@ -275,7 +277,7 @@ watch( (store.typeOrganizational === "draft" || store.typeOrganizational === "old") ? "2 (ปัจจุบัน)" - : props.rowIndex + 1 + : props.rowIndex + 1 }} diff --git a/src/modules/16_positionEmployee/components/DialogMovePos.vue b/src/modules/16_positionEmployee/components/DialogMovePos.vue index 97fd67813..96539fc61 100644 --- a/src/modules/16_positionEmployee/components/DialogMovePos.vue +++ b/src/modules/16_positionEmployee/components/DialogMovePos.vue @@ -50,7 +50,7 @@ const modal = defineModel("modal", { required: true }); let reqMaster = defineModel("reqMaster", { required: true }); const totalPage = defineModel("totalPage", { required: true }); const nodeTree = defineModel("nodeTree", { required: true }); -const columns = defineModel("columns", {}); +const columns = defineModel("columns", { required: true }); const rows = defineModel("rows", { required: true }); const props = defineProps({ fetchDataTree: { diff --git a/src/modules/16_positionEmployee/components/TableMain.vue b/src/modules/16_positionEmployee/components/TableMain.vue index f56a0ab4e..8943c2423 100644 --- a/src/modules/16_positionEmployee/components/TableMain.vue +++ b/src/modules/16_positionEmployee/components/TableMain.vue @@ -777,7 +777,7 @@ watch( Date: Fri, 22 May 2026 18:14:01 +0700 Subject: [PATCH 02/10] fix(registry): icon sortOrderByDate --- .../04_registryPerson/views/edit/components/Table.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/modules/04_registryPerson/views/edit/components/Table.vue b/src/modules/04_registryPerson/views/edit/components/Table.vue index b85f00bb9..c63eb6a5f 100644 --- a/src/modules/04_registryPerson/views/edit/components/Table.vue +++ b/src/modules/04_registryPerson/views/edit/components/Table.vue @@ -889,8 +889,8 @@ function handleSortByDate() { hideLoader(); } }, - "ยืนยันการเรียงลำดับข้อมูล", - "ต้องการยืนยันการเรียงลำดับข้อมูลนี้ใช่หรือไม่?" + "ยืนยันการเรียงลำดับ", + "ต้องการยืนยันการเรียงลำดับข้อมูลตามวันที่คำสั่งมีผลใช่หรือไม่?" ); } @@ -941,7 +941,7 @@ onMounted(async () => { flat dense color="indigo-5" - icon="mdi-sort-alphabetical-descending" + icon="mdi-calendar-export" @click="handleSortByDate()" > เรียงลำดับข้อมูล From 7d46985570ace4918fac19fa600d6ecbbb56e5c6 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Fri, 22 May 2026 18:18:40 +0700 Subject: [PATCH 03/10] fix --- .../04_registryPerson/views/edit/components/Table.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/modules/04_registryPerson/views/edit/components/Table.vue b/src/modules/04_registryPerson/views/edit/components/Table.vue index c63eb6a5f..da180ac32 100644 --- a/src/modules/04_registryPerson/views/edit/components/Table.vue +++ b/src/modules/04_registryPerson/views/edit/components/Table.vue @@ -889,8 +889,8 @@ function handleSortByDate() { hideLoader(); } }, - "ยืนยันการเรียงลำดับ", - "ต้องการยืนยันการเรียงลำดับข้อมูลตามวันที่คำสั่งมีผลใช่หรือไม่?" + "ยืนยันการจัดลำดับ", + "ต้องการยืนยันการจัดลำดับข้อมูลตามวันที่คำสั่งมีผลใช่หรือไม่?" ); } @@ -944,7 +944,7 @@ onMounted(async () => { icon="mdi-calendar-export" @click="handleSortByDate()" > - เรียงลำดับข้อมูล + จัดลำดับตามวันที่คำสั่งมีผล
From 176b22e756088f57a8e1cede54d9f7033513fa66 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Mon, 25 May 2026 13:17:13 +0700 Subject: [PATCH 04/10] fix: await API fileByFile --- src/components/CardProfile.vue | 6 +++++- src/components/Dialogs/PopupPersonalNew.vue | 16 ++++++++++------ .../04_registryPerson/views/detailView.vue | 8 ++++---- .../13_salary/components/DialogInfoMain.vue | 9 ++++++--- src/modules/14_KPI/views/detail.vue | 8 +++++--- src/views/MainLayout.vue | 12 ++++++++---- 6 files changed, 38 insertions(+), 21 deletions(-) diff --git a/src/components/CardProfile.vue b/src/components/CardProfile.vue index 72fe7aad0..2b90d2468 100644 --- a/src/components/CardProfile.vue +++ b/src/components/CardProfile.vue @@ -8,6 +8,7 @@ import config from "@/app.config"; import type { PropType } from "vue"; import type { FormProfile } from "@/interface/main"; import type { DataProfile } from "@/modules/05_placement/interface/index/Main"; +import avatarMain from "@/assets/avatar_user.jpg"; /** importComponents*/ import PopupPersonal from "@/components/Dialogs/PopupPersonalNew.vue"; @@ -91,8 +92,11 @@ function fetchProfile(id: string, name: string) { if (profile.avatar === "") { http .get(config.API.fileByFile("ทะเบียนประวัติ", "โปรไฟล์", id, `${name}`)) - .then(async (res) => { + .then((res) => { profile.avatar = res.data.downloadUrl; + }) + .catch(() => { + profile.avatar = avatarMain; }); } } diff --git a/src/components/Dialogs/PopupPersonalNew.vue b/src/components/Dialogs/PopupPersonalNew.vue index 1b17f7efd..ffc275ee7 100644 --- a/src/components/Dialogs/PopupPersonalNew.vue +++ b/src/components/Dialogs/PopupPersonalNew.vue @@ -14,6 +14,7 @@ import type { GovermentEmpTemp, } from "@/components/information/interface/response/Government"; import type { Avatar } from "@/components/information/interface/response/avatar"; +import avatarMain from "@/assets/avatar_user.jpg"; /** importStore*/ import { useCounterMixin } from "@/stores/mixin"; @@ -167,9 +168,9 @@ async function fetchInformation(id: string) { avatar.position = data.position ? data.position : "-"; //ถ้ามีรูปเรียก Function fetchProfile เรียกข้อมูลรูปโปรไฟล์ if (data.avatarName) { - await fetchProfile(data.id as string, data.avatarName); + fetchProfile(data.id as string, data.avatarName); } else { - avatar.avatar = ""; + avatar.avatar = avatarMain; } if (props.id) { @@ -260,11 +261,14 @@ async function fetchProfileGovTemp(id: string) { * @param id profileID * @param avatarName ชื่อไฟล์ */ -async function fetchProfile(id: string, avatarName: string) { - await http +function fetchProfile(id: string, avatarName: string) { + http .get(config.API.fileByFile("ทะเบียนประวัติ", "โปรไฟล์", id, avatarName)) - .then(async (res) => { - avatar.avatar = await res.data.downloadUrl; + .then((res) => { + avatar.avatar = res.data.downloadUrl; + }) + .catch(() => { + avatar.avatar = avatarMain; }); } diff --git a/src/modules/04_registryPerson/views/detailView.vue b/src/modules/04_registryPerson/views/detailView.vue index 33ca37200..4fdec72a9 100644 --- a/src/modules/04_registryPerson/views/detailView.vue +++ b/src/modules/04_registryPerson/views/detailView.vue @@ -323,10 +323,10 @@ async function uploadFileURL(uploadUrl: string, file: any) { * ฟังก์ชันดึงข้อมูลรูปโปรไฟล์ * @param id โปรไฟล์ */ -async function fetchProfile(id: string) { - await http +function fetchProfile(id: string) { + http .get(config.API.fileByFile("ทะเบียนประวัติ", "โปรไฟล์", id, fileName.value)) - .then(async (res) => { + .then((res) => { profilePicture.value = res.data.downloadUrl; }) .catch(() => { @@ -403,7 +403,7 @@ async function fetchDataPersonal() { fileName.value = res.data.result.avatarName; if (formDetail.value?.avatarName) { - await fetchProfile(profileId.value); + fetchProfile(profileId.value); } else { profilePicture.value = avatar; } diff --git a/src/modules/13_salary/components/DialogInfoMain.vue b/src/modules/13_salary/components/DialogInfoMain.vue index 3da947277..c5bfc6762 100644 --- a/src/modules/13_salary/components/DialogInfoMain.vue +++ b/src/modules/13_salary/components/DialogInfoMain.vue @@ -52,7 +52,7 @@ function fetchInformation() { citizenId.value = data.citizenId; if (data.avatarName) { - await fetchProfile(data.id as string, data.avatarName); + fetchProfile(data.id as string, data.avatarName); } else { avatar.value = avatarMain; } @@ -70,11 +70,14 @@ function fetchInformation() { * @param id profileId * @param avatarName ชื้อไฟล์ */ -async function fetchProfile(id: string, avatarName: string) { +function fetchProfile(id: string, avatarName: string) { http .get(config.API.fileByFile("ทะเบียนประวัติ", "โปรไฟล์", id, avatarName)) - .then(async (res) => { + .then((res) => { avatar.value = res.data.downloadUrl; + }) + .catch(() => { + avatar.value = avatarMain; }); } diff --git a/src/modules/14_KPI/views/detail.vue b/src/modules/14_KPI/views/detail.vue index aede8c187..81d3df41a 100644 --- a/src/modules/14_KPI/views/detail.vue +++ b/src/modules/14_KPI/views/detail.vue @@ -8,6 +8,7 @@ import { useQuasar } from "quasar"; import { useCounterMixin } from "@/stores/mixin"; import { useKpiDataStore } from "@/modules/14_KPI/store"; +import avatar from "@/assets/avatar_user.jpg"; import DialogHeader from "@/components/DialogHeader.vue"; import type { FormProfile } from "@/modules/14_KPI/interface/request/index"; @@ -65,7 +66,7 @@ async function fetchEvaluation() { await store.checkCompetency(); await store.checkCompetencyDefaultCompetencyLevel(); - await fetchProfile(data.profileId); + fetchProfile(data.profileId); plannedPoint.value = data.plannedPoint == null ? "" : data.plannedPoint; rolePoint.value = data.rolePoint == null ? "" : data.rolePoint; @@ -81,8 +82,8 @@ async function fetchEvaluation() { // }); } -async function fetchProfile(id: string) { - await http +function fetchProfile(id: string) { + http .get( config.API.fileByFile("ทะเบียนประวัติ", "โปรไฟล์", id, `profile-${id}`) ) @@ -90,6 +91,7 @@ async function fetchProfile(id: string) { store.dataEvaluation.avartar = res.data.downloadUrl; }) .catch(() => { + store.dataEvaluation.avartar = avatar; // profilePicture.value = avatar; }); } diff --git a/src/views/MainLayout.vue b/src/views/MainLayout.vue index 3812a311d..33e733b0b 100644 --- a/src/views/MainLayout.vue +++ b/src/views/MainLayout.vue @@ -532,25 +532,29 @@ async function fetchKeycloakPosition() { await http .get(config.API.keycloakPosition()) .then(async (res) => { - const data = await res.data.result; + const data = res.data.result; usePositionKeycloakStore().setPositionKeycloak(data); if (data.avatarName) { - await getImg(data.profileId, data.avatarName); + getImg(data.profileId, data.avatarName); } else { profileImg.value = avatar; } }) .catch((err) => { messageError($q, err); + profileImg.value = avatar; }); } const profileImg = ref(""); -async function getImg(id: string, pathName: string) { - await http +function getImg(id: string, pathName: string) { + http .get(config.API.fileByFile("ทะเบียนประวัติ", "โปรไฟล์", id, pathName)) .then((res) => { profileImg.value = res.data.downloadUrl; + }) + .catch((err) => { + profileImg.value = avatar; }); } From f726aece81037396ded4900cb10fde03a2bfa3c3 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Mon, 25 May 2026 16:49:18 +0700 Subject: [PATCH 05/10] fix(registry-officer): set profile name field to readonly in edit mode --- .../detail/PersonalInformation/01_Profile.vue | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/modules/04_registryPerson/components/detail/PersonalInformation/01_Profile.vue b/src/modules/04_registryPerson/components/detail/PersonalInformation/01_Profile.vue index 7730029f7..ace941cf4 100644 --- a/src/modules/04_registryPerson/components/detail/PersonalInformation/01_Profile.vue +++ b/src/modules/04_registryPerson/components/detail/PersonalInformation/01_Profile.vue @@ -408,7 +408,8 @@ function calculateMinDate() { function prefixRankRule() { return [ - () => !!formData.rank || !!formData.prefix || "กรุณาเลือกคำนำหน้าชื่อ หรือยศ", + () => + !!formData.rank || !!formData.prefix || "กรุณาเลือกคำนำหน้าชื่อ หรือยศ", ]; } @@ -588,6 +589,7 @@ onMounted(() => {
{ option-value="name" v-model="formData.prefix" clearable - class="inputgreen" :options="store.Ops.prefixOps" :label="dataLabel.prefix" :rules="prefixRankRule()" @@ -640,24 +641,24 @@ onMounted(() => {
@@ -721,6 +722,7 @@ onMounted(() => {
{ option-label="name" option-value="name" v-model="formData.gender" - class="inputgreen" :options="store.Ops.genderOps" :label="dataLabel.gender" @filter="(inputValue: string, From 47bd6611b2525de3bd65565c81b6ca42e6e8e089 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Wed, 27 May 2026 10:23:36 +0700 Subject: [PATCH 06/10] fix(Dialog): prevent enter key from closing the dialog --- src/components/DialogHeader.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/DialogHeader.vue b/src/components/DialogHeader.vue index 77d936c93..325277f16 100644 --- a/src/components/DialogHeader.vue +++ b/src/components/DialogHeader.vue @@ -9,6 +9,7 @@ round dense @click="close" + @keydown.enter.prevent style="color: #ff8080; background-color: #ffdede" /> From 1b36cab885fced1386ceb3900eb6f62692351543 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Wed, 27 May 2026 10:35:49 +0700 Subject: [PATCH 07/10] fix(help-government): clearable dateEnd --- .../components/Help-Government/HelpGovernmentDetail.vue | 3 ++- src/modules/05_placement/views/04_helpGovernmentMain.vue | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/modules/05_placement/components/Help-Government/HelpGovernmentDetail.vue b/src/modules/05_placement/components/Help-Government/HelpGovernmentDetail.vue index ce4a0284b..dd8d3ba5f 100644 --- a/src/modules/05_placement/components/Help-Government/HelpGovernmentDetail.vue +++ b/src/modules/05_placement/components/Help-Government/HelpGovernmentDetail.vue @@ -316,9 +316,10 @@ onMounted(() => { :model-value=" dateEnd !== null ? date2Thai(dateEnd) : null " - :rules="edit ? [(val:string) => !!val || `${'กรุณาเลือกตั้งแต่วัน'}`]:[]" hide-bottom-space :label="`${'ถึงวันที่'}`" + clearable + @clear="dateEnd = null" >