refactor: 重构分页逻辑并统一代码风格
1. 新增分页数据处理hook和工具函数,实现分页状态统一管理 2. 替换所有页面的表格分页配置为标准current/page模式 3. 统一项目内字符串引号风格为双引号 4. 调整权限树面板样式和布局代码格式
This commit is contained in:
14
tests/pageData.test.ts
Normal file
14
tests/pageData.test.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import assert from 'node:assert/strict';
|
||||
import { resolvePageData } from '../src/hooks/pageData.js';
|
||||
|
||||
const response = {
|
||||
list: [{ id: 21 }],
|
||||
pagination: { page: 1, pageSize: 20, total: 30 },
|
||||
};
|
||||
|
||||
const resolved = resolvePageData(response, { page: 2, pageSize: 20 });
|
||||
|
||||
assert.deepEqual(resolved, {
|
||||
list: [{ id: 21 }],
|
||||
pagination: { page: 2, pageSize: 20, total: 30 },
|
||||
});
|
||||
Reference in New Issue
Block a user