改用axios请求进行封装
This commit is contained in:
@@ -139,7 +139,7 @@ export async function getHomeData(): Promise<HomeStatistics> {
|
||||
select: 'count',
|
||||
filter: {
|
||||
and: `(audit_status.neq.0,audit_status.neq.2)`,
|
||||
created_at: `gte.${startOfThisMonth}`,
|
||||
updated_at: `gte.${startOfThisMonth}`,
|
||||
is_test_document: `eq.false`
|
||||
}
|
||||
};
|
||||
@@ -156,7 +156,7 @@ export async function getHomeData(): Promise<HomeStatistics> {
|
||||
select: 'count',
|
||||
filter: {
|
||||
or: `(audit_status.eq.1,audit_status.eq.-1)`,
|
||||
and: `(created_at.gte.${startOfLastMonth},created_at.lte.${endOfLastMonth})`,
|
||||
and: `(updated_at.gte.${startOfLastMonth},updated_at.lte.${endOfLastMonth})`,
|
||||
is_test_document: `eq.false`
|
||||
}
|
||||
};
|
||||
@@ -171,7 +171,8 @@ export async function getHomeData(): Promise<HomeStatistics> {
|
||||
// 计算同比增长
|
||||
let reviewGrowthValue = 0;
|
||||
let reviewGrowthIsUp = true;
|
||||
|
||||
// console.log('lastMonthReviewed-------', lastMonthReviewed);
|
||||
// console.log('monthlyReviewedFiles-------', monthlyReviewedFiles);
|
||||
if (lastMonthReviewed > 0) {
|
||||
const growthRate = ((monthlyReviewedFiles - lastMonthReviewed) / lastMonthReviewed) * 100;
|
||||
reviewGrowthValue = Math.abs(parseFloat(growthRate.toFixed(1)));
|
||||
@@ -205,7 +206,7 @@ export async function getHomeData(): Promise<HomeStatistics> {
|
||||
select: 'count',
|
||||
filter: {
|
||||
audit_status: `eq.1`,
|
||||
and: `(created_at.gte.${startOfLastMonth},created_at.lte.${endOfLastMonth})`,
|
||||
and: `(updated_at.gte.${startOfLastMonth},updated_at.lte.${endOfLastMonth})`,
|
||||
is_test_document: `eq.false`
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user