From 0fd3e8e8939869f739aa43880d9da6b63c9df316 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Tue, 7 Jan 2025 12:12:45 +0700 Subject: [PATCH] fix insignia --- src/modules/07_insignia/components/2_Manage/Tab1.vue | 5 ++++- src/modules/07_insignia/store.ts | 2 +- src/modules/13_salary/components/DialogInfoMain.vue | 8 +++++--- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/modules/07_insignia/components/2_Manage/Tab1.vue b/src/modules/07_insignia/components/2_Manage/Tab1.vue index 03bd7896a..22bcc0b1b 100644 --- a/src/modules/07_insignia/components/2_Manage/Tab1.vue +++ b/src/modules/07_insignia/components/2_Manage/Tab1.vue @@ -853,10 +853,13 @@ const employeeClass = ref(""); * @param id id ที่ต้องการดู */ function onClickViewInfo(type: string, id: string, empClass: string) { + console.log(empClass); + infoType.value = type; profileId.value = id; modalDialogInfo.value = true; - employeeClass.value = empClass === "officer" ? "" : "-employee"; + employeeClass.value = + empClass.toLocaleLowerCase() === "officer" ? "" : "-employee"; } /** Hook*/ diff --git a/src/modules/07_insignia/store.ts b/src/modules/07_insignia/store.ts index 38a6dce73..3e461d844 100644 --- a/src/modules/07_insignia/store.ts +++ b/src/modules/07_insignia/store.ts @@ -93,7 +93,7 @@ export const useInsigniaDataStore = defineStore("insignia", () => { insigniaLevel: e.level ? e.level : "", dateSend: e.requestDate ? date2Thai(e.requestDate) : null, requestNote: e.requestNote ? e.requestNote : "", - employeeType: profileType(e.profileType) || null, + employeeType: profileType(e.profileType.toLocaleLowerCase()) || null, employeeClass: e.profileType, reason: e.reason ? e.reason : "", markDiscipline: e.markDiscipline, diff --git a/src/modules/13_salary/components/DialogInfoMain.vue b/src/modules/13_salary/components/DialogInfoMain.vue index 07ad36c05..8387c42ab 100644 --- a/src/modules/13_salary/components/DialogInfoMain.vue +++ b/src/modules/13_salary/components/DialogInfoMain.vue @@ -44,9 +44,11 @@ const props = defineProps({ const avatar = ref(""); const fullName = ref(""); const position = ref(""); +const isSkeleton = ref(false); /** function เรียกข้อมูลส่วนตัว*/ function fetchInformation() { + isSkeleton.value = false; http .get(config.API.orgProfileById(profileId.value, props.employeeClass)) .then(async (res) => { @@ -63,6 +65,7 @@ function fetchInformation() { }) .catch((err) => { messageError($q, err); + isSkeleton.value = true; }); } @@ -76,9 +79,6 @@ async function fetchProfile(id: string, avatarName: string) { .get(config.API.fileByFile("ทะเบียนประวัติ", "โปรไฟล์", id, avatarName)) .then(async (res) => { avatar.value = res.data.downloadUrl; - }) - .catch(() => { - avatar.value = avatarMain; }); } @@ -124,12 +124,14 @@ watch( style="object-fit: cover" /> +