feat: 重构个人消息中心,支持展示个人公告,并优化相关地址

This commit is contained in:
2025-04-05 22:43:35 +08:00
parent ec43ba4c8f
commit 89d0d9ebb1
25 changed files with 586 additions and 257 deletions

View File

@@ -6,7 +6,7 @@
:body-style="{ padding: '15px 20px 13px 20px' }"
>
<template #extra>
<a-link @click="router.replace({ path: '/system/notice' })">更多</a-link>
<a-link @click="open">更多</a-link>
</template>
<a-skeleton v-if="loading" :loading="loading" :animation="true">
<a-skeleton-line :rows="5" />
@@ -31,16 +31,12 @@
</div>
</div>
</a-card>
<NoticeDetailModal ref="NoticeDetailModalRef" />
</template>
<script setup lang="ts">
import { type DashboardNoticeResp, listDashboardNotice } from '@/apis'
import { useDict } from '@/hooks/app'
import NoticeDetailModal from '@/views/system/notice/NoticeDetailModal.vue'
const router = useRouter()
const { notice_type } = useDict('notice_type')
const dataList = ref<DashboardNoticeResp[]>([])
@@ -56,10 +52,15 @@ const getDataList = async () => {
}
}
const NoticeDetailModalRef = ref<InstanceType<typeof NoticeDetailModal>>()
const router = useRouter()
// 详情
const onDetail = (id: string) => {
NoticeDetailModalRef.value?.onDetail(id)
const onDetail = (id: number) => {
router.push({ path: '/user/notice', query: { id } })
}
// 打开消息中心
const open = () => {
window.open('/user/message?tab=notice')
}
onMounted(() => {