feat: 新增在线用户页面

This commit is contained in:
valarchie
2023-07-19 10:40:31 +08:00
parent 6eaaba9e92
commit fc68f70da8
4 changed files with 321 additions and 0 deletions

View File

@@ -114,6 +114,18 @@ export class CommonUtils {
writeFile(workBook, `${excelName}.xlsx`);
}
static paginateList(dataList: any[], pagination: PaginationProps): any[] {
// 计算起始索引
const startIndex = (pagination.currentPage - 1) * pagination.pageSize;
// 截取数组
const endIndex = startIndex + pagination.pageSize;
const paginatedList = dataList.slice(startIndex, endIndex);
// 返回截取后的数组
return paginatedList;
}
// 私有构造函数,防止类被实例化
private constructor() {}
}