diff --git a/src/components/CardProfile.vue b/src/components/CardProfile.vue index 2b90d2468..72fe7aad0 100644 --- a/src/components/CardProfile.vue +++ b/src/components/CardProfile.vue @@ -8,7 +8,6 @@ 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"; @@ -92,11 +91,8 @@ function fetchProfile(id: string, name: string) { if (profile.avatar === "") { http .get(config.API.fileByFile("ทะเบียนประวัติ", "โปรไฟล์", id, `${name}`)) - .then((res) => { + .then(async (res) => { profile.avatar = res.data.downloadUrl; - }) - .catch(() => { - profile.avatar = avatarMain; }); } } diff --git a/src/components/DialogHeader.vue b/src/components/DialogHeader.vue index 19ee3f536..77d936c93 100644 --- a/src/components/DialogHeader.vue +++ b/src/components/DialogHeader.vue @@ -9,8 +9,6 @@ round dense @click="close" - @keydown.enter.prevent - @keydown.space.prevent style="color: #ff8080; background-color: #ffdede" /> diff --git a/src/components/Dialogs/PopupPersonalNew.vue b/src/components/Dialogs/PopupPersonalNew.vue index ffc275ee7..1b17f7efd 100644 --- a/src/components/Dialogs/PopupPersonalNew.vue +++ b/src/components/Dialogs/PopupPersonalNew.vue @@ -14,7 +14,6 @@ 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"; @@ -168,9 +167,9 @@ async function fetchInformation(id: string) { avatar.position = data.position ? data.position : "-"; //ถ้ามีรูปเรียก Function fetchProfile เรียกข้อมูลรูปโปรไฟล์ if (data.avatarName) { - fetchProfile(data.id as string, data.avatarName); + await fetchProfile(data.id as string, data.avatarName); } else { - avatar.avatar = avatarMain; + avatar.avatar = ""; } if (props.id) { @@ -261,14 +260,11 @@ async function fetchProfileGovTemp(id: string) { * @param id profileID * @param avatarName ชื่อไฟล์ */ -function fetchProfile(id: string, avatarName: string) { - http +async function fetchProfile(id: string, avatarName: string) { + await http .get(config.API.fileByFile("ทะเบียนประวัติ", "โปรไฟล์", id, avatarName)) - .then((res) => { - avatar.avatar = res.data.downloadUrl; - }) - .catch(() => { - avatar.avatar = avatarMain; + .then(async (res) => { + avatar.avatar = await res.data.downloadUrl; }); } diff --git a/src/modules/04_registryPerson/components/detail/GovernmentInformation/06_HelpGovernment.vue b/src/modules/04_registryPerson/components/detail/GovernmentInformation/06_HelpGovernment.vue index 71a7e3bd5..c97cbb2c3 100644 --- a/src/modules/04_registryPerson/components/detail/GovernmentInformation/06_HelpGovernment.vue +++ b/src/modules/04_registryPerson/components/detail/GovernmentInformation/06_HelpGovernment.vue @@ -866,8 +866,7 @@ onMounted(() => { outlined dense :model-value="date2Thai(formData.dateEnd)" - clearable - @clear="formData.dateEnd = null" + :rules="[(val:string) => !!val || `${'กรุณาเลือก วันที่สิ้นสุด'}`]" hide-bottom-space :label="`${'วันที่สิ้นสุด'}`" > 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 1d686dfe8..7730029f7 100644 --- a/src/modules/04_registryPerson/components/detail/PersonalInformation/01_Profile.vue +++ b/src/modules/04_registryPerson/components/detail/PersonalInformation/01_Profile.vue @@ -408,8 +408,7 @@ function calculateMinDate() { function prefixRankRule() { return [ - () => - !!formData.rank || !!formData.prefix || "กรุณาเลือกคำนำหน้าชื่อ หรือยศ", + () => !!formData.rank || !!formData.prefix || "กรุณาเลือกคำนำหน้าชื่อ หรือยศ", ]; } @@ -589,7 +588,6 @@ onMounted(() => {
{ option-value="name" v-model="formData.prefix" clearable + class="inputgreen" :options="store.Ops.prefixOps" :label="dataLabel.prefix" :rules="prefixRankRule()" @@ -641,24 +640,24 @@ onMounted(() => {
@@ -722,7 +721,6 @@ onMounted(() => {
{ option-label="name" option-value="name" v-model="formData.gender" + class="inputgreen" :options="store.Ops.genderOps" :label="dataLabel.gender" @filter="(inputValue: string, diff --git a/src/modules/04_registryPerson/views/detailView.vue b/src/modules/04_registryPerson/views/detailView.vue index 4fdec72a9..33ca37200 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 โปรไฟล์ */ -function fetchProfile(id: string) { - http +async function fetchProfile(id: string) { + await http .get(config.API.fileByFile("ทะเบียนประวัติ", "โปรไฟล์", id, fileName.value)) - .then((res) => { + .then(async (res) => { profilePicture.value = res.data.downloadUrl; }) .catch(() => { @@ -403,7 +403,7 @@ async function fetchDataPersonal() { fileName.value = res.data.result.avatarName; if (formDetail.value?.avatarName) { - fetchProfile(profileId.value); + await fetchProfile(profileId.value); } else { profilePicture.value = avatar; } diff --git a/src/modules/04_registryPerson/views/edit/components/Table.vue b/src/modules/04_registryPerson/views/edit/components/Table.vue index da180ac32..b85f00bb9 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,10 +941,10 @@ onMounted(async () => { flat dense color="indigo-5" - icon="mdi-calendar-export" + icon="mdi-sort-alphabetical-descending" @click="handleSortByDate()" > - จัดลำดับตามวันที่คำสั่งมีผล + เรียงลำดับข้อมูล
diff --git a/src/modules/05_placement/components/Help-Government/HelpGovernmentDetail.vue b/src/modules/05_placement/components/Help-Government/HelpGovernmentDetail.vue index dd8d3ba5f..ce4a0284b 100644 --- a/src/modules/05_placement/components/Help-Government/HelpGovernmentDetail.vue +++ b/src/modules/05_placement/components/Help-Government/HelpGovernmentDetail.vue @@ -316,10 +316,9 @@ onMounted(() => { :model-value=" dateEnd !== null ? date2Thai(dateEnd) : null " + :rules="edit ? [(val:string) => !!val || `${'กรุณาเลือกตั้งแต่วัน'}`]:[]" hide-bottom-space :label="`${'ถึงวันที่'}`" - clearable - @clear="dateEnd = null" >