feat(aihr): admin dashboard with real aggregates
新增 /api/aihr/dashboard 聚合面试/对练/知识库/组织快照真实数据, 管理端首页从静态卡片改为 API 优先 + fallback。
This commit is contained in:
@@ -0,0 +1,74 @@
|
||||
import request from '@/utils/request';
|
||||
|
||||
type ApiResult<T> = {
|
||||
code: number;
|
||||
msg: string;
|
||||
data: T;
|
||||
};
|
||||
|
||||
export type DashboardHeroEntry = {
|
||||
key: string;
|
||||
status: string;
|
||||
type: string;
|
||||
note: string;
|
||||
};
|
||||
|
||||
export type DashboardStage = {
|
||||
step: number;
|
||||
name: string;
|
||||
desc: string;
|
||||
label: string;
|
||||
state: string;
|
||||
tagType: string;
|
||||
};
|
||||
|
||||
export type DashboardRisk = {
|
||||
name: string;
|
||||
owner: string;
|
||||
status: string;
|
||||
type: string;
|
||||
};
|
||||
|
||||
export type DashboardTrainingRecord = {
|
||||
name: string;
|
||||
scene: string;
|
||||
score: number;
|
||||
status: string;
|
||||
state: string;
|
||||
time: string;
|
||||
};
|
||||
|
||||
export type DashboardPipelineStep = {
|
||||
name: string;
|
||||
count: string;
|
||||
state: string;
|
||||
};
|
||||
|
||||
export type DashboardMetric = {
|
||||
label: string;
|
||||
value: string;
|
||||
target: string;
|
||||
type: string;
|
||||
};
|
||||
|
||||
export type DashboardOverview = {
|
||||
snapshotTime: string;
|
||||
heroEntries: DashboardHeroEntry[];
|
||||
stages: DashboardStage[];
|
||||
risks: DashboardRisk[];
|
||||
records: DashboardTrainingRecord[];
|
||||
pipeline: DashboardPipelineStep[];
|
||||
pipelineSummary: {
|
||||
todayNew: string;
|
||||
pending: string;
|
||||
completed: string;
|
||||
};
|
||||
metrics: DashboardMetric[];
|
||||
};
|
||||
|
||||
export function getDashboardOverview(): Promise<ApiResult<DashboardOverview>> {
|
||||
return request({
|
||||
url: '/api/aihr/dashboard/overview',
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user