异常订阅

This commit is contained in:
andy 2026-07-28 11:25:45 +08:00
parent 433eae9153
commit 69e5e45478
2 changed files with 4 additions and 3 deletions

View File

@ -246,8 +246,8 @@
<template v-if="messageTab === 'notice'"> <template v-if="messageTab === 'notice'">
<div v-for="item in recentNotices" :key="item.id" class="message-item" @click="handleNoticeClick(item)"> <div v-for="item in recentNotices" :key="item.id" class="message-item" @click="handleNoticeClick(item)">
<div class="message-item-header"> <div class="message-item-header">
<n-tag :type="item.noticeType === 1 ? 'info' : 'warning'" size="small"> <n-tag :type="item.noticeType === 1 ? 'info' : item.noticeType === 2 ? 'warning' : 'error' " size="small">
{{ item.noticeType === 1 ? '通知' : '公告' }} {{ item.noticeType === 1 ? '通知' : item.noticeType === 2 ? '公告' : '异常通知' }}
</n-tag> </n-tag>
<span class="message-time">{{ formatMessageTime(item.createTime) }}</span> <span class="message-time">{{ formatMessageTime(item.createTime) }}</span>
</div> </div>

View File

@ -301,7 +301,8 @@ const columns: DataTableColumns<SysNotice> = [
render(row) { render(row) {
const typeMap: Record<number, { text: string; type: 'info' | 'warning' }> = { const typeMap: Record<number, { text: string; type: 'info' | 'warning' }> = {
1: { text: '通知', type: 'info' }, 1: { text: '通知', type: 'info' },
2: { text: '公告', type: 'warning' } 2: { text: '公告', type: 'warning' },
3: { text: '异常通知', type: 'error' }
} }
const config = typeMap[row.noticeType] || { text: '未知', type: 'info' as const } const config = typeMap[row.noticeType] || { text: '未知', type: 'info' as const }
return h(NTag, { type: config.type, size: 'small' }, { default: () => config.text }) return h(NTag, { type: config.type, size: 'small' }, { default: () => config.text })