fix: update some files
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 5m44s

This commit is contained in:
luo
2026-08-18 17:36:41 +08:00
parent 93f67967c5
commit d9d07422a9
38 changed files with 1140 additions and 728 deletions

View File

@@ -12,14 +12,14 @@
:key="tab.value"
type="button"
:class="{ active: activeCategory === tab.value }"
@click="activeCategory = tab.value"
@click="handleCategoryChange(tab.value)"
>
{{ tab.label }}<span v-if="tab.count"> ({{ tab.count }})</span>
</button>
</div>
<div class="content">
<div v-loading="notificationStore.loading" class="scroll">
<div ref="notificationListRef" v-loading="notificationStore.loading" class="scroll">
<button
v-for="item in filteredItems"
:key="item.id"
@@ -43,6 +43,21 @@
<p>暂无通知</p>
</div>
</div>
<div
v-if="notificationStore.notificationTotal > notificationStore.notificationPageSize"
class="pagination"
>
<ElPagination
:current-page="notificationStore.notificationPage"
:page-size="notificationStore.notificationPageSize"
:total="notificationStore.notificationTotal"
:pager-count="5"
background
layout="prev, pager, next"
small
@current-change="handlePageChange"
/>
</div>
</div>
</div>
</div>
@@ -64,6 +79,7 @@
const router = useRouter()
const notificationStore = useNotificationStore()
const activeCategory = ref<'all' | NotificationCategory>('all')
const notificationListRef = ref<HTMLElement | null>(null)
const visible = computed(() => props.modelValue)
const categoryMatches = (item: NotificationItem, category: string) => {
@@ -96,6 +112,24 @@
const close = () => emit('update:modelValue', false)
const loadNotificationPage = async (page: number) => {
try {
await notificationStore.loadNotifications(page)
notificationListRef.value?.scrollTo({ top: 0 })
} catch (error: any) {
ElMessage.error(error?.message || '获取通知失败')
}
}
const handleCategoryChange = (category: 'all' | NotificationCategory) => {
activeCategory.value = category
void loadNotificationPage(1)
}
const handlePageChange = (page: number) => {
void loadNotificationPage(page)
}
const handleMarkAllRead = async () => {
try {
const response = await notificationStore.markAllRead()