no message
This commit is contained in:
parent
a1fadc8ad8
commit
aa85712cbf
1 changed files with 7 additions and 5 deletions
|
|
@ -53,13 +53,15 @@ async function fetchCheckTime() {
|
||||||
|
|
||||||
const notiTrigger = ref<boolean>(false)
|
const notiTrigger = ref<boolean>(false)
|
||||||
const notiList = ref<notiType[]>([])
|
const notiList = ref<notiType[]>([])
|
||||||
|
const totalNotiList = ref<number>(0)
|
||||||
/** function เรียกข้อมุลแจ้งเตือน */
|
/** function เรียกข้อมุลแจ้งเตือน */
|
||||||
async function fetchNotifications() {
|
async function fetchNotifications() {
|
||||||
showLoader()
|
showLoader()
|
||||||
await http
|
await http
|
||||||
.get(config.API.msgNotificate)
|
.get(config.API.msgNotificate)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
const response = res.data.result
|
const response = res.data.result.data
|
||||||
|
totalNotiList.value = res.data.result.total
|
||||||
const list: notiType[] = []
|
const list: notiType[] = []
|
||||||
response.map((e: any) => {
|
response.map((e: any) => {
|
||||||
list.push({
|
list.push({
|
||||||
|
|
@ -236,7 +238,7 @@ function validateForm() {
|
||||||
}
|
}
|
||||||
if (hasError.every((result) => result === true)) {
|
if (hasError.every((result) => result === true)) {
|
||||||
confirm()
|
confirm()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const timeChickin = ref<string>()
|
const timeChickin = ref<string>()
|
||||||
|
|
@ -349,17 +351,17 @@ onMounted(async () => {
|
||||||
flat
|
flat
|
||||||
size="13px"
|
size="13px"
|
||||||
class="q-mx-md"
|
class="q-mx-md"
|
||||||
:disable="notiList.length === 0"
|
:disable="totalNotiList == 0"
|
||||||
>
|
>
|
||||||
<q-icon name="notifications" size="24px" color="white" />
|
<q-icon name="notifications" size="24px" color="white" />
|
||||||
|
|
||||||
<q-badge
|
<q-badge
|
||||||
rounded
|
rounded
|
||||||
v-show="notiList.length > 0"
|
v-show="totalNotiList !== 0"
|
||||||
color="negative"
|
color="negative"
|
||||||
text-color="white"
|
text-color="white"
|
||||||
floating
|
floating
|
||||||
>{{ notiList.length }}</q-badge
|
>{{ totalNotiList }}</q-badge
|
||||||
>
|
>
|
||||||
<q-menu v-model="notiTrigger" max-width="480px" :offset="[0, 10]">
|
<q-menu v-model="notiTrigger" max-width="480px" :offset="[0, 10]">
|
||||||
<div class="q-px-md q-py-sm row col-12 items-center">
|
<div class="q-px-md q-py-sm row col-12 items-center">
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue