Merge branch 'develop' into feat/delete

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2026-05-29 09:20:05 +07:00
commit aa3d41b7b3
15 changed files with 61 additions and 38 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

@ -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
}}
</div>

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

@ -889,8 +889,8 @@ function handleSortByDate() {
hideLoader();
}
},
"ยืนยันการเรียงลำดับข้อมูล",
"ต้องการยืนยันการเรียงลำดับข้อมูลนี้ใช่หรือไม่?"
"ยืนยันการจัดลำดับ",
"ต้องการยืนยันการจัดลำดับข้อมูลตามวันที่คำสั่งมีผลใช่หรือไม่?"
);
}
@ -941,10 +941,10 @@ onMounted(async () => {
flat
dense
color="indigo-5"
icon="mdi-sort-alphabetical-descending"
icon="mdi-calendar-export"
@click="handleSortByDate()"
>
<q-tooltip>เรยงลำดบขอม</q-tooltip>
<q-tooltip>ดลำดบตามวนทคำสงม</q-tooltip>
</q-btn>
<q-space />
<div>

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

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

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

@ -50,7 +50,7 @@ const modal = defineModel<boolean>("modal", { required: true });
let reqMaster = defineModel<FilterMaster>("reqMaster", { required: true });
const totalPage = defineModel<number>("totalPage", { required: true });
const nodeTree = defineModel<OrgTree[]>("nodeTree", { required: true });
const columns = defineModel<QTableProps[]>("columns", {});
const columns = defineModel<QTableProps["columns"]>("columns", { required: true });
const rows = defineModel<PosMaster2[]>("rows", { required: true });
const props = defineProps({
fetchDataTree: {

View file

@ -777,7 +777,7 @@ watch(
<DialogMovePos
v-model:modal="modalDialogMMove"
v-model:nodeTree="nodeTree"
v-model:columns="columns as QTableProps[]"
v-model:columns="columns"
v-model:rows="posMaster"
v-model:totalPage="totalPage"
v-model:reqMaster="reqMaster"

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