refactor: 重构分页逻辑并统一代码风格

1. 新增分页数据处理hook和工具函数,实现分页状态统一管理
2. 替换所有页面的表格分页配置为标准current/page模式
3. 统一项目内字符串引号风格为双引号
4. 调整权限树面板样式和布局代码格式
This commit is contained in:
2026-07-02 11:50:07 +08:00
parent 9362625b4e
commit 526052d633
13 changed files with 884 additions and 809 deletions

14
tests/pageData.test.ts Normal file
View 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 },
});