diff --git a/src/api/api.checkin.ts b/src/api/api.checkin.ts index a0078fa..8172c07 100644 --- a/src/api/api.checkin.ts +++ b/src/api/api.checkin.ts @@ -13,8 +13,9 @@ export default { fileByFile: (name: string, group: string, id: string, fileName: string) => `${urlFile}/file/${name}/${group}/${id}/${fileName}`, - changePassword:`${orgKeycloak}/user/change-password`, - resetPassword:`${orgKeycloak}/user/reset-password`, + changePassword: `${orgKeycloak}/user/change-password`, + resetPassword: `${orgKeycloak}/user/reset-password`, - checkoutCheck:`${leave}/user/checkout-check` + checkoutCheck: `${leave}/user/checkout-check`, + privacy: `${env.API_URI}/org/profile/privacy`, } diff --git a/src/components/PopupPrivacy.vue b/src/components/PopupPrivacy.vue new file mode 100644 index 0000000..0109ffd --- /dev/null +++ b/src/components/PopupPrivacy.vue @@ -0,0 +1,335 @@ + + + + + diff --git a/src/views/HomeView.vue b/src/views/HomeView.vue index 17b5def..a64742b 100644 --- a/src/views/HomeView.vue +++ b/src/views/HomeView.vue @@ -383,9 +383,12 @@ async function getCheck() { mapRef.value?.requestLocationPermission() return } + showLoader() + const isSeminar = model.value === 'ไปประชุม / อบรม / สัมมนา' ? 'Y' : 'N' + await http - .get(config.API.checkoutCheck) + .get(config.API.checkoutCheck + `/${isSeminar}`) .then(async (res) => { checkStatus.value = await res.data.result.status.toLocaleUpperCase() if (checkStatus.value == 'ABSENT') { @@ -398,7 +401,10 @@ async function getCheck() { new Intl.DateTimeFormat('en-US', options).format( new Date(res.data.result.serverTime) ) ?? '' - const endTimeAfternoonVal = endTimeAfternoon.value ?? '' + const endTimeAfternoonVal = + new Intl.DateTimeFormat('en-US', options).format( + new Date(res.data.result.endTime) + ) ?? '' // dialog ยืนยันการลงเวลาออกงาน dialogConfirm( diff --git a/src/views/MainView.vue b/src/views/MainView.vue index 572e08b..37151eb 100644 --- a/src/views/MainView.vue +++ b/src/views/MainView.vue @@ -13,6 +13,7 @@ import type { notiType } from '@/interface/index/Main' import type { Noti } from '@/interface/response/Main' import DialogHeader from '@/components/DialogHeader.vue' +import PopupPrivacy from '@/components/PopupPrivacy.vue' const mixin = useCounterMixin() const { @@ -23,6 +24,7 @@ const { success, showLoader, } = mixin + const router = useRouter() const $q = useQuasar() @@ -53,6 +55,9 @@ const reNewPassWord = ref('') const isPwdOld = ref(true) const isPwdNewOld = ref(true) const isPwdReNewOld = ref(true) + +const modalPrivacy = ref(false) + /** * ฟังก์ชั่นดึงข้อมูลจำนวนการแจ้งเตือน */ @@ -168,6 +173,7 @@ async function fetchKeycloakPosition() { .get(config.API.keycloakPosition()) .then(async (res) => { const data = await res.data.result + modalPrivacy.value = !data.privacyCheckin ? true : false //เช็คว่ามีรูปไหม ถ้ามีรูปเรียกข้อมูลรูป if (data.avatarName) { await getImg(data.profileId, data.avatarName) @@ -599,6 +605,8 @@ onMounted(async () => { + +