Compare commits

...

18 commits

Author SHA1 Message Date
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
dcfb5ab1a0 Merge branch 'develop' into dev
All checks were successful
Build & Deploy on Dev / build (push) Successful in 3m5s
2026-05-29 10:14:38 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
21401ed519 feat: add delete is OWNER 2026-05-29 10:12:16 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
aa3d41b7b3 Merge branch 'develop' into feat/delete 2026-05-29 09:20:05 +07:00
ed9789b43b Merge branch 'develop' into dev
All checks were successful
Build & Deploy on Dev / build (push) Successful in 3m0s
* develop:
  fixed OWNER สามารถแก้ชื่อ นามสกุล เพศและคำนำหน้าชื่อได้
2026-05-28 10:44:07 +07:00
d0a7511bbe fixed OWNER สามารถแก้ชื่อ นามสกุล เพศและคำนำหน้าชื่อได้ 2026-05-28 10:43:13 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
184e124185 Merge branch 'develop' into dev
All checks were successful
Build & Deploy on Dev / build (push) Successful in 2m50s
2026-05-27 15:17:20 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
e323e28f73 fix(HelpGovernment): delete rules dateEnd 2026-05-27 15:17:02 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
0c60276589 Merge branch 'develop' into dev
All checks were successful
Build & Deploy on Dev / build (push) Successful in 2m58s
2026-05-27 12:16:40 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
7b21b1d934 fix(Dialog): prevent space key from closing the dialog 2026-05-27 12:16:17 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
f1c4654046 Merge branch 'develop' into dev
All checks were successful
Build & Deploy on Dev / build (push) Successful in 2m58s
2026-05-27 10:36:04 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
1b36cab885 fix(help-government): clearable dateEnd 2026-05-27 10:35:49 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
51a7b9db19 Merge branch 'develop' into dev
All checks were successful
Build & Deploy on Dev / build (push) Successful in 3m2s
2026-05-27 10:24:00 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
47bd6611b2 fix(Dialog): prevent enter key from closing the dialog 2026-05-27 10:23:36 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
98ed2470b9 Merge branch 'develop' into dev
All checks were successful
Build & Deploy on Dev / build (push) Successful in 2m43s
2026-05-25 16:50:09 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
f726aece81 fix(registry-officer): set profile name field to readonly in edit mode 2026-05-25 16:49:18 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
c1c008e899 Merge branch 'develop' into dev
All checks were successful
Build & Deploy on Dev / build (push) Successful in 3m13s
2026-05-25 13:17:39 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
176b22e756 fix: await API fileByFile 2026-05-25 13:17:13 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
ce9d8be1b2 feat(leave): add delete 2026-05-22 17:49:36 +07:00
18 changed files with 289 additions and 91 deletions

View file

@ -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;
});
}
}

View file

@ -9,6 +9,8 @@
round
dense
@click="close"
@keydown.enter.prevent
@keydown.space.prevent
style="color: #ff8080; background-color: #ffdede"
/>
</q-toolbar>

View file

@ -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;
});
}

View file

@ -866,7 +866,8 @@ onMounted(() => {
outlined
dense
:model-value="date2Thai(formData.dateEnd)"
:rules="[(val:string) => !!val || `${'กรุณาเลือก วันที่สิ้นสุด'}`]"
clearable
@clear="formData.dateEnd = null"
hide-bottom-space
:label="`${'วันที่สิ้นสุด'}`"
>

View file

@ -408,7 +408,8 @@ function calculateMinDate() {
function prefixRankRule() {
return [
() => !!formData.rank || !!formData.prefix || "กรุณาเลือกคำนำหน้าชื่อ หรือยศ",
() =>
!!formData.rank || !!formData.prefix || "กรุณาเลือกคำนำหน้าชื่อ หรือยศ",
];
}
@ -588,6 +589,7 @@ onMounted(() => {
<div class="col-xs-6 col-sm-6 col-md-6">
<q-select
:readonly="checkPermission($route)?.attrOwnership !== 'OWNER'"
dense
outlined
use-input
@ -602,7 +604,6 @@ 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(() => {
</div>
<div class="col-xs-6 col-sm-6 col-md-6">
<q-input
:readonly="checkPermission($route)?.attrOwnership !== 'OWNER'"
dense
outlined
lazy-rules
hide-bottom-space
v-model="formData.firstName"
class="inputgreen"
:label="dataLabel.firstName"
:rules="[(val: string) => !!val || `${'กรุณากรอก ชื่อ'}`]"
/>
</div>
<div class="col-xs-6 col-sm-6 col-md-6">
<q-input
:readonly="checkPermission($route)?.attrOwnership !== 'OWNER'"
dense
outlined
lazy-rules
hide-bottom-space
v-model="formData.lastName"
class="inputgreen"
:label="dataLabel.lastName"
:rules="[(val: string) => !!val || `${'กรุณากรอก นามสกุล'}`]"
/>
@ -721,6 +722,7 @@ onMounted(() => {
</div>
<div class="col-xs-6 col-sm-6 col-md-6">
<q-select
:readonly="checkPermission($route)?.attrOwnership !== 'OWNER'"
dense
outlined
use-input
@ -735,7 +737,6 @@ onMounted(() => {
option-label="name"
option-value="name"
v-model="formData.gender"
class="inputgreen"
:options="store.Ops.genderOps"
:label="dataLabel.gender"
@filter="(inputValue: string,

View file

@ -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;
}

View file

@ -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"
>
<template v-slot:prepend>
<q-icon

View file

@ -10,7 +10,6 @@ import type {
} from "@/modules/05_placement/interface/request/Main";
import type { FormOrderPlacementMainData } from "@/modules/05_placement/interface/request/Main";
export const useProfileDataStore = defineStore("profilePlacenent", () => {
interface profile {
main: { columns: String[] };
education: { columns: String[] };
@ -29,6 +28,7 @@ export const useProfileDataStore = defineStore("profilePlacenent", () => {
document: { columns: String[] };
}
export const useProfileDataStore = defineStore("profilePlacenent", () => {
const birthDate = ref<Date>(new Date());
const retireText = ref<string | null>(null);
const changeRetireText = (val: string | null) => {
@ -87,15 +87,15 @@ export const useProfileDataStore = defineStore("profilePlacenent", () => {
changeRetireText,
};
});
interface placement {
mappingPosition: { columns: String[] };
}
export const usePlacementDataStore = defineStore("placement", () => {
const mixin = useCounterMixin(); //เรียกฟังก์ชันกลาง
const tabsMain = ref<string>("probation");
const isOfficer = ref<boolean | null>(null);
const isStaff = ref<boolean | null>(null);
const { hideLoader } = mixin;
interface placement {
mappingPosition: { columns: String[] };
}
const placementData = ref<placement>({
mappingPosition: { columns: [] },
});
@ -218,10 +218,10 @@ export const usePlacementDataStore = defineStore("placement", () => {
isStaff,
};
});
export const useOrderPlacementDataStore = defineStore("placementOrder", () => {
interface placementOrder {
mappingPosition: { columns: String[] };
}
export const useOrderPlacementDataStore = defineStore("placementOrder", () => {
const placementOrderData = ref<placementOrder>({
mappingPosition: { columns: [] },
});
@ -369,6 +369,8 @@ export const useTransferDataStore = defineStore("transferDataStore", () => {
]);
const statusOp = ref<DataOptions[]>(statusMainOp.value);
const statusDelete = ["REPORT", "WAITING", "DONE"];
const statusText = (val: string) => {
switch (val) {
case "WAITTING":
@ -438,5 +440,6 @@ export const useTransferDataStore = defineStore("transferDataStore", () => {
statusOp,
statusMainOp,
filterOption,
statusDelete,
};
});

View file

@ -2,7 +2,7 @@
import { ref, onMounted, computed } from "vue";
import { useQuasar } from "quasar";
import { useRouter } from "vue-router";
import { useRouter, useRoute } from "vue-router";
import {
checkPermission,
checkPermissionList,
@ -20,11 +20,19 @@ import DialogOrders from "@/modules/05_placement/components/Transfer/DialogOrder
const $q = useQuasar();
const router = useRouter();
const route = useRoute();
const mixin = useCounterMixin();
const store = useTransferDataStore();
const { statusText, filterOption } = useTransferDataStore();
const { date2Thai, messageError, showLoader, hideLoader, onSearchDataTable } =
mixin;
const {
date2Thai,
messageError,
showLoader,
hideLoader,
onSearchDataTable,
dialogRemove,
success,
} = mixin;
const modal = ref<boolean>(false); //
const dataTransfer = ref<ResponseData[]>([]); //
@ -141,6 +149,15 @@ const visibleColumns = ref<string[]>([
"createdAt",
]);
const isPermissionDelete = computed(() => {
return (status: string) => {
return (
checkPermission(route)?.attrOwnership === "OWNER" &&
!store.statusDelete.includes(status)
);
};
});
/** ฟังก์ชันดึงข้อมูรายการขอโอน*/
async function fetchData() {
showLoader();
@ -194,6 +211,21 @@ function onSearch() {
);
}
function handleDelete(id: string) {
dialogRemove($q, async () => {
try {
showLoader();
await http.delete(config.API.transfer + `/admin/${id}`);
await fetchData();
success($q, "ลบข้อมูลสำเร็จ");
} catch (error) {
messageError($q, error);
} finally {
hideLoader();
}
});
}
/**
* ทำงานเม Components กเรยกใชงาน
* จะเรยกใช fetchData เพอดงขอมลรายการขอโอน
@ -337,6 +369,18 @@ onMounted(async () => {
>
<q-tooltip>รายละเอยด</q-tooltip>
</q-btn>
<q-btn
v-if="isPermissionDelete(props.row.status)"
flat
round
dense
icon="mdi-delete"
color="red"
@click.prevent="handleDelete(props.row.id)"
>
<q-tooltip>ลบขอม</q-tooltip>
</q-btn>
</q-td>
<q-td v-for="col in props.cols" :key="col.id">
<div v-if="col.name === 'no'">

View file

@ -313,7 +313,7 @@ function openDelete(id: string) {
dialogRemove($q, async () => {
showLoader();
await http
.delete(config.API.receiveDataId(id))
.delete(config.API.receiveData() + `/admin/${id}`)
.then(async () => {
await fecthlistRecevice();
await success($q, "ลบข้อมูลสำเร็จ");
@ -606,8 +606,10 @@ onMounted(async () => {
<q-item
v-if="
checkPermission($route)?.attrIsDelete &&
checkPermission($route)?.attrOwnership ===
'OWNER' &&
props.row.status !== 'REPORT' &&
props.row.status !== 'WAITING' &&
props.row.status !== 'DONE'
"
clickable

View file

@ -236,8 +236,7 @@ function openModalOrder() {
item.status == "APPROVE") &&
item.organizationPositionOld &&
item.organization &&
item.dateStart &&
item.dateEnd
item.dateStart
);
rows2.value = row;
rows2Data.value = row;

View file

@ -33,7 +33,8 @@ const {
showLoader,
hideLoader,
onSearchDataTable,
findOrgName,
dialogRemove,
success,
} = mixin;
/** Table */
@ -257,6 +258,21 @@ function onSearch() {
);
}
function handleDelete(id: string) {
dialogRemove($q, async () => {
try {
showLoader();
await http.delete(config.API.listResign() + `/admin/${id}`);
await fecthlist();
success($q, "ลบข้อมูลสำเร็จ");
} catch (error) {
messageError($q, error);
} finally {
hideLoader();
}
});
}
/**Hook */
onMounted(async () => {
status.value = stroeResign.formQurey.status;
@ -308,7 +324,11 @@ onMounted(async () => {
color="primary"
icon="mdi-account-arrow-right"
>
<q-tooltip>{{ `ส่งไปออกคำสั่ง${stroeResign.mainTabs == '2'?"ยกเลิกการ":''}ลาออก` }}</q-tooltip>
<q-tooltip>{{
`ส่งไปออกคำสั่ง${
stroeResign.mainTabs == "2" ? "ยกเลิกการ" : ""
}ลาออก`
}}</q-tooltip>
</q-btn>
</div>
<q-space />
@ -393,6 +413,26 @@ onMounted(async () => {
>
<q-tooltip>แกไขขอม</q-tooltip>
</q-btn>
<q-btn
v-if="
checkPermission($route)?.attrOwnership === 'OWNER' &&
props.row.status !== 'REPORT' &&
props.row.status !== 'WAITING' &&
props.row.status !== 'DONE' &&
props.row.status !== 'CANCELING' &&
props.row.status !== 'CANCEL' &&
stroeResign.mainTabs === '1'
"
flat
dense
round
color="red"
icon="delete"
@click.prevent="handleDelete(props.row.id)"
>
<q-tooltip>ลบขอม</q-tooltip>
</q-btn>
</q-td>
<q-td v-for="col in props.cols" :key="col.id">
<div

View file

@ -27,8 +27,15 @@ const stroeResign = useDataStore();
const { statusText } = stroe;
const router = useRouter();
const mixin = useCounterMixin();
const { messageError, date2Thai, showLoader, hideLoader, onSearchDataTable } =
mixin;
const {
messageError,
date2Thai,
showLoader,
hideLoader,
onSearchDataTable,
dialogRemove,
success,
} = mixin;
/** Table */
const rows = ref<ResponseItems[]>([]);
@ -129,7 +136,7 @@ const columns = ref<QTableProps["columns"]>([
sortable: true,
field: "status",
format(val, row) {
return stroeResign.mainTabs === "1"
return stroeResign.mainTabsEMP === "1"
? statusText(row.status)
: statusText(row.status, "อนุญาต");
},
@ -252,6 +259,21 @@ function onSearch() {
);
}
function handleDelete(id: string) {
dialogRemove($q, async () => {
try {
showLoader();
await http.delete(config.API.listResignEMP() + `/admin/${id}`);
await fecthlist();
success($q, "ลบข้อมูลสำเร็จ");
} catch (error) {
messageError($q, error);
} finally {
hideLoader();
}
});
}
/**Hook */
onMounted(async () => {
statusEMP.value = stroeResign.formQureyEMP.status;
@ -391,6 +413,26 @@ onMounted(async () => {
>
<q-tooltip>แกไขขอม</q-tooltip>
</q-btn>
<q-btn
v-if="
checkPermission($route)?.attrOwnership === 'OWNER' &&
props.row.status !== 'REPORT' &&
props.row.status !== 'WAITING' &&
props.row.status !== 'DONE' &&
props.row.status !== 'CANCELING' &&
props.row.status !== 'CANCEL' &&
stroeResign.mainTabsEMP === '1'
"
flat
dense
round
color="red"
icon="delete"
@click.prevent="handleDelete(props.row.id)"
>
<q-tooltip>ลบขอม</q-tooltip>
</q-btn>
</q-td>
<q-td v-for="col in props.cols" :key="col.id">
<div

View file

@ -1,17 +1,59 @@
<script setup lang="ts">
import { ref, onMounted, watch } from "vue";
import { ref, onMounted, computed } from "vue";
import { useQuasar } from "quasar";
import type { QTableProps } from "quasar";
import { useRouter } from "vue-router";
import { useRouter, useRoute } from "vue-router";
import { checkPermission } from "@/utils/permissions";
import { useLeavelistDataStore } from "@/modules/09_leave/stores/LeaveStore";
import { useCounterMixin } from "@/stores/mixin";
import http from "@/plugins/http";
import config from "@/app.config";
const $q = useQuasar();
const leaveStore = useLeavelistDataStore();
const route = useRoute();
const router = useRouter();
const { showLoader, hideLoader, messageError, dialogRemove, success } =
useCounterMixin();
const total = defineModel<number>("total", { required: true });
const totalList = defineModel<number>("totalList", { required: true });
const pagination = defineModel<any>("pagination", { required: true });
const props = defineProps({
getList: Function,
rows: {
type: Object,
require: true,
},
page: {
type: Number,
require: true,
},
rowsPerPage: {
type: Number,
require: true,
},
maxPage: {
type: Number,
require: true,
},
totalList: {
type: Number,
require: true,
},
dataToobar: Object,
});
const isPermissionDelete = computed(() => {
return (status: string) => {
return (
checkPermission(route)?.attrOwnership === "OWNER" &&
!leaveStore.statusDelete.includes(status) &&
leaveStore.tabMenu === "1"
);
};
});
/** ข้อมูลหัวตาราง รายการลา */
const columnsLeave = ref<QTableProps["columns"]>([
@ -212,31 +254,6 @@ const visibleReject = ref<string[]>([
"status",
]);
const props = defineProps({
getList: Function,
rows: {
type: Object,
require: true,
},
page: {
type: Number,
require: true,
},
rowsPerPage: {
type: Number,
require: true,
},
maxPage: {
type: Number,
require: true,
},
totalList: {
type: Number,
require: true,
},
dataToobar: Object,
});
/** ไปหน้ารายละเอียด */
function redirectToDetail(id: string) {
const routePrefix = leaveStore.tabMenu === "1" ? "/leave" : "/leave-reject";
@ -264,6 +281,21 @@ function getStatusColor(statusText: string) {
return statusMap[statusText.toUpperCase()] ?? "";
}
function handleDelete(id: string) {
dialogRemove($q, async () => {
try {
showLoader();
await http.delete(config.API.leaveList() + `/${id}`);
await props.getList?.();
success($q, "ลบข้อมูลสำเร็จ");
} catch (error) {
messageError($q, error);
} finally {
hideLoader();
}
});
}
/** Hook*/
onMounted(() => {
if (leaveStore.tabMenu === "1") {
@ -313,6 +345,17 @@ onMounted(() => {
>
<q-tooltip>รายละเอยด</q-tooltip>
</q-btn>
<q-btn
v-if="isPermissionDelete(props.row.statusText)"
flat
round
dense
icon="mdi-delete"
color="red"
@click.prevent="handleDelete(props.row.id)"
>
<q-tooltip>ลบขอม</q-tooltip>
</q-btn>
</q-td>
<q-td
v-for="col in props.cols"

View file

@ -44,6 +44,8 @@ export const useLeavelistDataStore = defineStore("leave", () => {
const leaveType = ref<LeaveType[]>([]);
const statusDelete = ["APPROVE", "DELETING", "DELETE"];
/**
* fetchListLeave
* @param data Page
@ -264,5 +266,6 @@ export const useLeavelistDataStore = defineStore("leave", () => {
leaveTypeOption,
leaveTypeList,
fetchKeycloakPosition,
statusDelete,
};
});

View file

@ -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;
});
}

View file

@ -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;
});
}

View file

@ -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<string>("");
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;
});
}