เพิ่มเมนูไปหน้า 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 router = useRouter()
|
||||||
const $q = useQuasar()
|
const $q = useQuasar()
|
||||||
|
|
||||||
|
// landing page config url
|
||||||
|
const configParam = {
|
||||||
|
landingPageUrl: import.meta.env.VITE_URL_SSO,
|
||||||
|
}
|
||||||
|
|
||||||
const fullName = ref<string>('') //ชื่อผู้ใช้งาน
|
const fullName = ref<string>('') //ชื่อผู้ใช้งาน
|
||||||
const notiTrigger = ref<boolean>(false) // เปิด,ปิดรายการ
|
const notiTrigger = ref<boolean>(false) // เปิด,ปิดรายการ
|
||||||
const notiList = ref<notiType[]>([]) // รายการแจ้งเตือน
|
const notiList = ref<notiType[]>([]) // รายการแจ้งเตือน
|
||||||
|
|
@ -129,13 +134,24 @@ function onLoad(index: number, done: Function) {
|
||||||
(notiList.value.length == 0 && totalNotiList.value === 0)
|
(notiList.value.length == 0 && totalNotiList.value === 0)
|
||||||
) {
|
) {
|
||||||
page.value++
|
page.value++
|
||||||
setTimeout(() => {
|
setTimeout(async () => {
|
||||||
fetchNotifications(page.value, 'NOMAL')
|
await fetchNotifications(page.value, 'NOMAL')
|
||||||
done()
|
await done()
|
||||||
}, 1500)
|
}, 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(
|
watch(
|
||||||
() => notiTrigger.value,
|
() => notiTrigger.value,
|
||||||
() => {
|
() => {
|
||||||
|
|
@ -311,7 +327,16 @@ onMounted(async () => {
|
||||||
>
|
>
|
||||||
<q-menu>
|
<q-menu>
|
||||||
<div class="q-pa-md" style="max-width: 500px">
|
<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>
|
||||||
<q-item-section avatar>
|
<q-item-section avatar>
|
||||||
<q-icon color="primary" name="account_circle" />
|
<q-icon color="primary" name="account_circle" />
|
||||||
|
|
@ -319,22 +344,41 @@ onMounted(async () => {
|
||||||
|
|
||||||
<q-item-section>{{ fullName }}</q-item-section>
|
<q-item-section>{{ fullName }}</q-item-section>
|
||||||
</q-item>
|
</q-item>
|
||||||
|
</q-list> -->
|
||||||
|
|
||||||
<q-item class="text-center">
|
<q-separator />
|
||||||
<q-item-section>
|
<q-list dense>
|
||||||
<q-item-label>
|
<q-item clickable :href="landingPageUrl">
|
||||||
<q-btn
|
<q-item-section avatar>
|
||||||
color="primary"
|
<q-avatar
|
||||||
label="ออกจากระบบ"
|
color="blue"
|
||||||
push
|
text-color="white"
|
||||||
size="sm"
|
icon="home"
|
||||||
@click="onClickLogout"
|
size="24px"
|
||||||
/></q-item-label>
|
font-size="14px"
|
||||||
|
/>
|
||||||
|
</q-item-section>
|
||||||
|
<q-item-section class="q-py-sm">
|
||||||
|
Landing Page
|
||||||
</q-item-section>
|
</q-item-section>
|
||||||
</q-item>
|
</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>
|
</q-list>
|
||||||
</div> </q-menu
|
</div>
|
||||||
></q-btn>
|
</q-menu></q-btn
|
||||||
|
>
|
||||||
</q-toolbar>
|
</q-toolbar>
|
||||||
</q-header>
|
</q-header>
|
||||||
<div
|
<div
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue