|
|
@@ -15,14 +15,7 @@
|
|
|
</div>
|
|
|
|
|
|
<ul class="bar">
|
|
|
- <li
|
|
|
- v-for="(item, index) in barList"
|
|
|
- :key="index"
|
|
|
- :class="{ active: barActiveIndex === index }"
|
|
|
- @click="changeBar(index)"
|
|
|
- >
|
|
|
- {{ item.name }} ({{ item.num }})
|
|
|
- </li>
|
|
|
+ <li v-for="(item, index) in barList" :key="index" :class="{ active: barActiveIndex === index }" @click="changeBar(index)"> {{ item.name }} ({{ item.num }}) </li>
|
|
|
</ul>
|
|
|
|
|
|
<div class="content">
|
|
|
@@ -30,16 +23,8 @@
|
|
|
<!-- 通知 -->
|
|
|
<ul class="notice-list" v-show="barActiveIndex === 0">
|
|
|
<li v-for="(item, index) in noticeList" :key="index">
|
|
|
- <div
|
|
|
- class="icon"
|
|
|
- :style="{ background: getNoticeStyle(item.type).backgroundColor + '!important' }"
|
|
|
- >
|
|
|
- <i
|
|
|
- class="iconfont-sys"
|
|
|
- :style="{ color: getNoticeStyle(item.type).iconColor + '!important' }"
|
|
|
- v-html="getNoticeStyle(item.type).icon"
|
|
|
- >
|
|
|
- </i>
|
|
|
+ <div class="icon" :style="{ background: getNoticeStyle(item.type).backgroundColor + '!important' }">
|
|
|
+ <i class="iconfont-sys" :style="{ color: getNoticeStyle(item.type).iconColor + '!important' }" v-html="getNoticeStyle(item.type).icon"> </i>
|
|
|
</div>
|
|
|
<div class="text">
|
|
|
<h4>{{ item.title }}</h4>
|
|
|
@@ -92,14 +77,6 @@
|
|
|
import { useI18n } from 'vue-i18n'
|
|
|
import AppConfig from '@/config'
|
|
|
|
|
|
- // 导入头像图片
|
|
|
- import avatar1 from '@/assets/img/avatar/avatar1.webp'
|
|
|
- import avatar2 from '@/assets/img/avatar/avatar2.webp'
|
|
|
- import avatar3 from '@/assets/img/avatar/avatar3.webp'
|
|
|
- import avatar4 from '@/assets/img/avatar/avatar4.webp'
|
|
|
- import avatar5 from '@/assets/img/avatar/avatar5.webp'
|
|
|
- import avatar6 from '@/assets/img/avatar/avatar6.webp'
|
|
|
-
|
|
|
defineOptions({ name: 'ArtNotification' })
|
|
|
|
|
|
interface NoticeItem {
|
|
|
@@ -147,9 +124,7 @@
|
|
|
|
|
|
const { t } = useI18n()
|
|
|
|
|
|
- const props = defineProps<{
|
|
|
- value: boolean
|
|
|
- }>()
|
|
|
+ const props = defineProps<{ value: boolean }>()
|
|
|
|
|
|
const show = ref(false)
|
|
|
const visible = ref(false)
|
|
|
@@ -157,90 +132,19 @@
|
|
|
|
|
|
const useNotificationData = () => {
|
|
|
// 通知数据
|
|
|
- const noticeList = ref<NoticeItem[]>([
|
|
|
- {
|
|
|
- title: '新增国际化',
|
|
|
- time: '2024-6-13 0:10',
|
|
|
- type: 'notice'
|
|
|
- },
|
|
|
- {
|
|
|
- title: '冷月呆呆给你发了一条消息',
|
|
|
- time: '2024-4-21 8:05',
|
|
|
- type: 'message'
|
|
|
- },
|
|
|
- {
|
|
|
- title: '小肥猪关注了你',
|
|
|
- time: '2020-3-17 21:12',
|
|
|
- type: 'collection'
|
|
|
- },
|
|
|
- {
|
|
|
- title: '新增使用文档',
|
|
|
- time: '2024-02-14 0:20',
|
|
|
- type: 'notice'
|
|
|
- },
|
|
|
- {
|
|
|
- title: '小肥猪给你发了一封邮件',
|
|
|
- time: '2024-1-20 0:15',
|
|
|
- type: 'email'
|
|
|
- },
|
|
|
- {
|
|
|
- title: '菜单mock本地真实数据',
|
|
|
- time: '2024-1-17 22:06',
|
|
|
- type: 'notice'
|
|
|
- }
|
|
|
- ])
|
|
|
+ const noticeList = ref<NoticeItem[]>([])
|
|
|
|
|
|
// 消息数据
|
|
|
- const msgList = ref<MessageItem[]>([
|
|
|
- {
|
|
|
- title: '池不胖 关注了你',
|
|
|
- time: '2021-2-26 23:50',
|
|
|
- avatar: avatar1
|
|
|
- },
|
|
|
- {
|
|
|
- title: '唐不苦 关注了你',
|
|
|
- time: '2021-2-21 8:05',
|
|
|
- avatar: avatar2
|
|
|
- },
|
|
|
- {
|
|
|
- title: '中小鱼 关注了你',
|
|
|
- time: '2020-1-17 21:12',
|
|
|
- avatar: avatar3
|
|
|
- },
|
|
|
- {
|
|
|
- title: '何小荷 关注了你',
|
|
|
- time: '2021-01-14 0:20',
|
|
|
- avatar: avatar4
|
|
|
- },
|
|
|
- {
|
|
|
- title: '誶誶淰 关注了你',
|
|
|
- time: '2020-12-20 0:15',
|
|
|
- avatar: avatar5
|
|
|
- },
|
|
|
- {
|
|
|
- title: '冷月呆呆 关注了你',
|
|
|
- time: '2020-12-17 22:06',
|
|
|
- avatar: avatar6
|
|
|
- }
|
|
|
- ])
|
|
|
+ const msgList = ref<MessageItem[]>([])
|
|
|
|
|
|
// 待办数据
|
|
|
const pendingList = ref<PendingItem[]>([])
|
|
|
|
|
|
// 标签栏数据
|
|
|
const barList = computed<BarItem[]>(() => [
|
|
|
- {
|
|
|
- name: computed(() => t('notice.bar[0]')),
|
|
|
- num: noticeList.value.length
|
|
|
- },
|
|
|
- {
|
|
|
- name: computed(() => t('notice.bar[1]')),
|
|
|
- num: msgList.value.length
|
|
|
- },
|
|
|
- {
|
|
|
- name: computed(() => t('notice.bar[2]')),
|
|
|
- num: pendingList.value.length
|
|
|
- }
|
|
|
+ { name: computed(() => t('notice.bar[0]')), num: noticeList.value.length },
|
|
|
+ { name: computed(() => t('notice.bar[1]')), num: msgList.value.length },
|
|
|
+ { name: computed(() => t('notice.bar[2]')), num: pendingList.value.length }
|
|
|
])
|
|
|
|
|
|
return {
|
|
|
@@ -393,12 +297,7 @@
|
|
|
const { getNoticeStyle } = useNotificationStyles()
|
|
|
const { showNotice } = useNotificationAnimation()
|
|
|
const { handleNoticeAll, handleMsgAll, handlePendingAll } = useBusinessLogic()
|
|
|
- const { changeBar, currentTabIsEmpty, handleViewAll } = useTabManagement(
|
|
|
- noticeList,
|
|
|
- msgList,
|
|
|
- pendingList,
|
|
|
- { handleNoticeAll, handleMsgAll, handlePendingAll }
|
|
|
- )
|
|
|
+ const { changeBar, currentTabIsEmpty, handleViewAll } = useTabManagement(noticeList, msgList, pendingList, { handleNoticeAll, handleMsgAll, handlePendingAll })
|
|
|
|
|
|
// 监听属性变化
|
|
|
watch(
|