hrms-checkin/src/views/NoPositionView.vue

106 lines
2.9 KiB
Vue

<script setup lang="ts">
import { useQuasar } from 'quasar'
import { useRouter } from 'vue-router'
import { useCounterMixin } from '@/stores/mixin'
import { usePositionKeycloakStore } from '@/stores/positionKeycloak'
import { logout } from '@/plugins/auth'
import CustomComponent from '@/components/CustomDialog.vue'
const $q = useQuasar()
const router = useRouter()
const mixin = useCounterMixin()
const positionKeycloakStore = usePositionKeycloakStore()
const { showLoader, hideLoader } = mixin
/**
* ฟังก์ชันจัดการเมื่อผู้ใช้กดปุ่มตกลง
* ดำเนินการ logout โดยตรง
*/
function handleOkClick() {
performLogout()
}
/**
* ฟังก์ชันดำเนินการออกจากระบบ
*/
async function performLogout() {
showLoader()
try {
// ล้างข้อมูล positionKeycloak ก่อน logout
positionKeycloakStore.clearPositionKeycloak()
await logout()
} catch (error) {
console.error('Logout error:', error)
} finally {
setTimeout(() => {
hideLoader()
}, 1000)
}
}
</script>
<template>
<div
class="fullscreen bg-secondary text-white text-center q-pa-sm flex flex-center"
>
<div class="no-position-container">
<!-- Icon แสดงความผดปกต -->
<div class="icon-container">
<q-icon name="mdi-account-off-outline" size="100px" color="white" />
</div>
<!-- วขอหล -->
<div class="text-h4 q-mt-lg q-mb-md">ไมพบขอมลสงก</div>
<!-- รายละเอยด -->
<div class="text-h6 q-mb-lg text-weight-regular">
านยงไมงกดในโครงสรางองคกร<br />
กรณาตดตอเจาหนาทเบอร 1171
<br />เพอดำเนนการเพมขอม
</div>
<div class="text-weight-regular">
เมอเจาหนาทไดเพมทานในโครงสรางองคกรเรยบรอยแล
กรณาเขาสระบบใหมกคร
</div>
<!-- มตกลง -->
<q-btn
class="q-mt-xl"
color="white"
text-color="secondary"
unelevated
label="ตกลง"
no-caps
size="lg"
padding="md xl"
@click="handleOkClick"
/>
</div>
</div>
</template>
<style lang="scss" scoped>
.no-position-container {
max-width: 600px;
padding: 2rem;
}
.icon-container {
opacity: 0.9;
}
.text-h4 {
font-weight: 700;
}
.text-h6 {
line-height: 1.8;
opacity: 0.95;
}
.q-btn {
border-radius: 8px;
font-weight: 600;
min-width: 150px;
}
</style>