fix: 系统公告与尊享额度明细
This commit is contained in:
@@ -1,30 +1,33 @@
|
||||
<script setup lang="ts">
|
||||
import { Bell } from '@element-plus/icons-vue'
|
||||
import { storeToRefs } from 'pinia'
|
||||
import { useAnnouncementStore } from '@/stores'
|
||||
import { Bell } from '@element-plus/icons-vue';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { useAnnouncementStore } from '@/stores';
|
||||
|
||||
const announcementStore = useAnnouncementStore()
|
||||
const { announcements } = storeToRefs(announcementStore)
|
||||
const announcementStore = useAnnouncementStore();
|
||||
const { announcements } = storeToRefs(announcementStore);
|
||||
|
||||
// 计算未读公告数量(最新公告)
|
||||
// 计算未读公告数量(系统公告数量)
|
||||
const unreadCount = computed(() => {
|
||||
return announcements.value.filter(a => a.type === 'latest').length
|
||||
})
|
||||
if (!Array.isArray(announcements.value))
|
||||
return 0;
|
||||
return announcements.value.filter(a => a.type === 'System').length;
|
||||
});
|
||||
|
||||
// 打开公告弹窗
|
||||
function openAnnouncement() {
|
||||
announcementStore.openDialog()
|
||||
announcementStore.openDialog();
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="announcement-btn-container">
|
||||
<el-badge
|
||||
:value="unreadCount"
|
||||
:hidden="unreadCount === 0"
|
||||
:max="99"
|
||||
is-dot
|
||||
class="announcement-badge"
|
||||
>
|
||||
<!-- :value="unreadCount" -->
|
||||
<!-- :hidden="unreadCount === 0" -->
|
||||
<!-- :max="99" -->
|
||||
<div
|
||||
class="announcement-btn"
|
||||
@click="openAnnouncement"
|
||||
@@ -47,10 +50,10 @@ function openAnnouncement() {
|
||||
:deep(.el-badge__content) {
|
||||
background-color: #f56c6c;
|
||||
border: none;
|
||||
font-size: 12px;
|
||||
height: 18px;
|
||||
line-height: 18px;
|
||||
padding: 0 6px;
|
||||
//font-size: 12px;
|
||||
//height: 18px;
|
||||
//line-height: 18px;
|
||||
//padding: 0 6px;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -96,10 +99,10 @@ function openAnnouncement() {
|
||||
|
||||
.announcement-badge {
|
||||
:deep(.el-badge__content) {
|
||||
font-size: 10px;
|
||||
height: 16px;
|
||||
line-height: 16px;
|
||||
padding: 0 4px;
|
||||
//font-size: 10px;
|
||||
//height: 16px;
|
||||
//line-height: 16px;
|
||||
//padding: 0 4px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user