เพิ่มเมนูไปหน้า Landing Page
This commit is contained in:
parent
78cbf0d85b
commit
9f89c0fd74
1 changed files with 60 additions and 16 deletions
|
|
@ -16,6 +16,11 @@ const { date2Thai, hideLoader, messageError, dialogRemove, success } = mixin
|
|||
const router = useRouter()
|
||||
const $q = useQuasar()
|
||||
|
||||
// landing page config url
|
||||
const configParam = {
|
||||
landingPageUrl: import.meta.env.VITE_URL_SSO,
|
||||
}
|
||||
|
||||
const fullName = ref<string>('') //ชื่อผู้ใช้งาน
|
||||
const notiTrigger = ref<boolean>(false) // เปิด,ปิดรายการ
|
||||
const notiList = ref<notiType[]>([]) // รายการแจ้งเตือน
|
||||
|
|
@ -129,13 +134,24 @@ function onLoad(index: number, done: Function) {
|
|||
(notiList.value.length == 0 && totalNotiList.value === 0)
|
||||
) {
|
||||
page.value++
|
||||
setTimeout(() => {
|
||||
fetchNotifications(page.value, 'NOMAL')
|
||||
done()
|
||||
setTimeout(async () => {
|
||||
await fetchNotifications(page.value, 'NOMAL')
|
||||
await done()
|
||||
}, 1500)
|
||||
}
|
||||
}
|
||||
|
||||
// landing page redirect
|
||||
const landingPageUrl = () => {
|
||||
if (window.location.hostname === 'bmasso.bma.go.th') {
|
||||
return `${configParam.landingPageUrl}/landing?mode=dev`
|
||||
} else if (window.location.hostname === 'bma-ehr.frappet.com') {
|
||||
return `${configParam.landingPageUrl}/landing?mode=prod`
|
||||
} else {
|
||||
return `${configParam.landingPageUrl}/landing?mode=dev`
|
||||
}
|
||||
}
|
||||
|
||||
watch(
|
||||
() => notiTrigger.value,
|
||||
() => {
|
||||
|
|
@ -311,7 +327,16 @@ onMounted(async () => {
|
|||
>
|
||||
<q-menu>
|
||||
<div class="q-pa-md" style="max-width: 500px">
|
||||
<q-list>
|
||||
<div class="column items-center col-12 q-py-md" color="grey-3">
|
||||
<!-- <q-avatar size="72px" color="grey-4"> -->
|
||||
<q-icon color="primary" name="account_circle" size="32px" />
|
||||
<!-- <img :src="require('@/assets/logo.png')" /> -->
|
||||
<!-- </q-avatar> -->
|
||||
<div class="text-subtitle2 q-mt-md q-mb-xs text-center">
|
||||
{{ fullName }}
|
||||
</div>
|
||||
</div>
|
||||
<!-- <q-list>
|
||||
<q-item>
|
||||
<q-item-section avatar>
|
||||
<q-icon color="primary" name="account_circle" />
|
||||
|
|
@ -319,22 +344,41 @@ onMounted(async () => {
|
|||
|
||||
<q-item-section>{{ fullName }}</q-item-section>
|
||||
</q-item>
|
||||
</q-list> -->
|
||||
|
||||
<q-item class="text-center">
|
||||
<q-item-section>
|
||||
<q-item-label>
|
||||
<q-btn
|
||||
color="primary"
|
||||
label="ออกจากระบบ"
|
||||
push
|
||||
size="sm"
|
||||
@click="onClickLogout"
|
||||
/></q-item-label>
|
||||
<q-separator />
|
||||
<q-list dense>
|
||||
<q-item clickable :href="landingPageUrl">
|
||||
<q-item-section avatar>
|
||||
<q-avatar
|
||||
color="blue"
|
||||
text-color="white"
|
||||
icon="home"
|
||||
size="24px"
|
||||
font-size="14px"
|
||||
/>
|
||||
</q-item-section>
|
||||
<q-item-section class="q-py-sm">
|
||||
Landing Page
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
|
||||
<q-item clickable @click="onClickLogout">
|
||||
<q-item-section avatar>
|
||||
<q-avatar
|
||||
color="red"
|
||||
text-color="white"
|
||||
icon="logout"
|
||||
size="24px"
|
||||
font-size="14px"
|
||||
/>
|
||||
</q-item-section>
|
||||
<q-item-section class="q-py-sm"> ออกจากระบบ </q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</div> </q-menu
|
||||
></q-btn>
|
||||
</div>
|
||||
</q-menu></q-btn
|
||||
>
|
||||
</q-toolbar>
|
||||
</q-header>
|
||||
<div
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue