feat: 新增管理端工作台总览
- 新增 Dashboard 统计接口、菜单迁移与权限点 - 管理端工作台页面切换为真实概览数据和趋势图 - 默认首页切换到工作台
This commit is contained in:
49
easyflow-ui-admin/app/src/api/dashboard.ts
Normal file
49
easyflow-ui-admin/app/src/api/dashboard.ts
Normal 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,
|
||||
},
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user