feat: 新增管理端工作台总览

- 新增 Dashboard 统计接口、菜单迁移与权限点

- 管理端工作台页面切换为真实概览数据和趋势图

- 默认首页切换到工作台
This commit is contained in:
2026-03-24 18:36:54 +08:00
parent b1a16ccf18
commit d510034abb
14 changed files with 1002 additions and 239 deletions

View File

@@ -0,0 +1,49 @@
import { requestClient } from '#/api/request';
export type DashboardRange = '7d' | '30d' | 'today';
export interface DashboardOverviewQuery {
range?: DashboardRange;
}
export interface DashboardSummary {
activeUserTotal: number;
botTotal: number;
knowledgeBaseTotal: number;
userTotal: number;
workflowTotal: number;
}
export interface DashboardTrendItem {
activeUserTotal: number;
key: string;
label: string;
}
export interface DashboardDistributionItem {
activeUserTotal: number;
botTotal: number;
key: string;
knowledgeBaseTotal: number;
label: string;
userTotal: number;
value: number;
workflowTotal: number;
}
export interface DashboardOverviewResponse {
distribution: DashboardDistributionItem[];
query: DashboardOverviewQuery;
summary: DashboardSummary;
trends: DashboardTrendItem[];
updatedAt: string;
}
export async function getDashboardOverview(params: DashboardOverviewQuery) {
return requestClient.get<DashboardOverviewResponse>(
'/api/v1/dashboard/overview',
{
params,
},
);
}