Skip to content

Commit

Permalink
feat: 控制面板demo完善完成
Browse files Browse the repository at this point in the history
  • Loading branch information
yuntian001 committed Sep 2, 2022
1 parent 7e0b9db commit d20e602
Show file tree
Hide file tree
Showing 6 changed files with 267 additions and 239 deletions.
4 changes: 2 additions & 2 deletions mock/apiDemo/statistics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ export default [
return success(
{
view: {
PV: [300, 500, 800, 900, 3000, 3500, 4000, 5000, 4000, 2800, 1000], //合计
UV: [8, 16, 39, 42, 156, 160, 153, 200, 148, 140, 43], //昨日新增
PV: [300, 500, 800, 900, 3000, 3500, 4000, 5000, 4000, 2800, 1000],
UV: [8, 16, 39, 42, 156, 160, 153, 200, 148, 140, 43],
},
origion: [1048, 735, 580, 484, 300],
allocation: [1048, 735, 580, 484, 300],
Expand Down
24 changes: 24 additions & 0 deletions src/api/statistics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import request from '@/utils/request';

const enum Api {
STATISTICS = '/api/statistics',
CHART = '/api/statistics/chart',
}

// 获取用户详细信息
Expand Down Expand Up @@ -37,3 +38,26 @@ export function statisticsApi(noLoading?: boolean) {
{ noLoading },
);
}

export interface ChartResult {
view: {
PV: number[];
UV: number[];
};
origion: [number, number, number, number, number];
allocation: [number, number, number, number, number];
orderDistribution: {
new: [number, number, number, number, number];
old: [number, number, number, number, number];
};
}

export function chartApi() {
return request<ChartResult, []>(
() => ({
url: Api.CHART,
method: 'get',
}),
{ noLoading: true },
);
}
Loading

0 comments on commit d20e602

Please sign in to comment.