性能:看板改为单次请求加载,从5个并发请求优化为1个
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -98,6 +98,15 @@ export namespace AiotAlarmApi {
|
||||
hour: number;
|
||||
count: number;
|
||||
}
|
||||
|
||||
/** 看板聚合数据 */
|
||||
export interface DashboardData {
|
||||
statistics: AlertStatistics;
|
||||
trend: TrendItem[];
|
||||
deviceTop: DeviceTopItem[];
|
||||
hourDistribution: HourDistItem[];
|
||||
recentAlerts: Alert[];
|
||||
}
|
||||
}
|
||||
|
||||
// ==================== 告警管理 API ====================
|
||||
@@ -133,6 +142,14 @@ export function deleteAlert(id: number | string) {
|
||||
return requestClient.delete(`/aiot/alarm/alert/delete?id=${id}`);
|
||||
}
|
||||
|
||||
/** 获取看板聚合数据(单次请求) */
|
||||
export function getAlertDashboard(trendDays: number = 7) {
|
||||
return requestClient.get<AiotAlarmApi.DashboardData>(
|
||||
'/aiot/alarm/alert/dashboard',
|
||||
{ params: { trendDays } },
|
||||
);
|
||||
}
|
||||
|
||||
/** 获取告警统计 */
|
||||
export function getAlertStatistics(startTime?: string, endTime?: string) {
|
||||
return requestClient.get<AiotAlarmApi.AlertStatistics>(
|
||||
|
||||
Reference in New Issue
Block a user