feat: 迭代三大模块 + 全系统 Bug 修复
新功能: - 账单筛选统计:多维度筛选面板 + 保存方案 + 结果统计 - 通知公告:系统公告/群组通知/个人提醒 + 通知中心页面 - 管理员后台:数据看板 + 用户管理 + 发布公告 Bug 修复: - 统计页 fetchPrevMonthData/fetchMaxSingle 添加 group_id - 群组视图添加 t.group_id 过滤,防止私人数据泄露 - 通知列表添加群组通知条件 - 通知标记已读添加错误处理 - 管理员 API 添加 affectedRows 检查 - 筛选面板金额为 0 时正确回填 - profile onShow 补充 userStore.fetchUserInfo - 全系统样式修复(overflow/box-sizing)
This commit is contained in:
45
client/src/api/notification.ts
Normal file
45
client/src/api/notification.ts
Normal file
@@ -0,0 +1,45 @@
|
||||
import { request } from '@/utils/request'
|
||||
|
||||
/** 通知 */
|
||||
export interface Notification {
|
||||
id: number
|
||||
type: 'system' | 'group' | 'personal'
|
||||
title: string
|
||||
content: string
|
||||
is_read: number
|
||||
created_at: string
|
||||
group_id?: number | null
|
||||
}
|
||||
|
||||
/** 通知列表响应 */
|
||||
export interface NotificationList {
|
||||
list: Notification[]
|
||||
total: number
|
||||
page: number
|
||||
pageSize: number
|
||||
}
|
||||
|
||||
/** 获取通知列表 */
|
||||
export function getNotifications(params?: { type?: string; page?: number; pageSize?: number }) {
|
||||
return request<NotificationList>({ url: '/notifications', data: params })
|
||||
}
|
||||
|
||||
/** 获取未读数量 */
|
||||
export function getUnreadCount() {
|
||||
return request<{ count: number }>({ url: '/notifications/unread-count' })
|
||||
}
|
||||
|
||||
/** 标记单条已读 */
|
||||
export function markRead(id: number) {
|
||||
return request({ url: `/notifications/${id}/read`, method: 'PUT' })
|
||||
}
|
||||
|
||||
/** 全部标记已读 */
|
||||
export function markAllRead() {
|
||||
return request({ url: '/notifications/read-all', method: 'PUT' })
|
||||
}
|
||||
|
||||
/** 发布系统公告(管理员) */
|
||||
export function publishNotification(data: { title: string; content?: string }) {
|
||||
return request({ url: '/notifications', method: 'POST', data })
|
||||
}
|
||||
Reference in New Issue
Block a user