保存进度!

This commit is contained in:
2023-06-09 16:37:50 +08:00
parent 80e4b24e4f
commit aa39cc4601
3 changed files with 131 additions and 36 deletions

View File

@@ -28,8 +28,8 @@ interface RankingListResponse
departmentCode: string;
year: string;
month: string;
attachingRankingList: RankingListItem[];
renewalRankintList: RankingListItem[];
attachingRateRankingList: RankingListItem[];
renewalRateRankingList: RankingListItem[];
};
/**
@@ -49,8 +49,8 @@ function requestRankingList( reqParam: RankingListRequest, rander: any ): void /
departmentCode: reqParam.departmentCode,
year: reqParam.year,
month: reqParam.month,
attachingRankingList: [],
renewalRankintList: [],
attachingRateRankingList: [],
renewalRateRankingList: [],
};
instance.request(
@@ -70,7 +70,7 @@ function requestRankingList( reqParam: RankingListRequest, rander: any ): void /
rankingListResponse.month = data.month ?? "";
// 遍历排行榜元素
for ( const item of ( data.attachingRankingList ?? [] )) // eslint-disable-line
for ( const item of ( data.attachingRateRankingList ?? [] )) // eslint-disable-line
{
const index: number = item.index ?? -1;
@@ -79,10 +79,10 @@ function requestRankingList( reqParam: RankingListRequest, rander: any ): void /
continue;
}
rankingListResponse.attachingRankingList.push( item );
rankingListResponse.attachingRateRankingList.push( item );
}
for ( const item of ( data.renewalRankintList ?? [] )) // eslint-disable-line
for ( const item of ( data.renewalRateRankingList ?? [] )) // eslint-disable-line
{
const index: number = item.index ?? -1;
@@ -91,13 +91,11 @@ function requestRankingList( reqParam: RankingListRequest, rander: any ): void /
continue;
}
rankingListResponse.renewalRankintList.push( item );
rankingListResponse.renewalRateRankingList.push( item );
}
// 调用回调函数保存数据
rander( rankingListResponse );
console.log( data );
})
.catch(( error ) =>
{