From 3fdcf1d5e6468c735532e67bde5ff1cdf85bb0c6 Mon Sep 17 00:00:00 2001
From: zhou zhou <3272660260@qq.com>
Date: 星期一, 30 三月 2026 09:14:16 +0800
Subject: [PATCH] refactor: simplify role page and fix pagination keys
---
rsf-design/tests/system-role-scope-contract.test.mjs | 16 ++++++++++++++--
1 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/rsf-design/tests/system-role-scope-contract.test.mjs b/rsf-design/tests/system-role-scope-contract.test.mjs
index dd8b2af..c44030d 100644
--- a/rsf-design/tests/system-role-scope-contract.test.mjs
+++ b/rsf-design/tests/system-role-scope-contract.test.mjs
@@ -8,6 +8,7 @@
buildRoleSavePayload,
buildRoleScopeSubmitPayload,
buildRoleSearchParams,
+ getRolePaginationKey,
getRoleScopeConfig,
normalizeRoleScopeTreeData,
normalizeRoleListRow,
@@ -25,6 +26,10 @@
)
const roleIndexSource = fs.readFileSync(
new URL('../src/views/system/role/index.vue', import.meta.url),
+ 'utf8'
+)
+const roleTableColumnsSource = fs.readFileSync(
+ new URL('../src/views/system/role/roleTable.columns.js', import.meta.url),
'utf8'
)
@@ -60,6 +65,13 @@
name: '绠$悊鍛�'
}
)
+})
+
+test('role page uses backend pageSize pagination key', () => {
+ assert.deepEqual(getRolePaginationKey(), {
+ current: 'current',
+ size: 'pageSize'
+ })
})
test('buildRoleDialogModel normalizes backend role data into the form model', () => {
@@ -196,8 +208,8 @@
assert.match(roleIndexSource, /v-auth=\"'add'\"/)
assert.match(roleIndexSource, /v-auth=\"'delete'\"/)
assert.match(roleIndexSource, /v-auth=\"'query'\"/)
- assert.match(roleIndexSource, /auth: 'edit'/)
- assert.match(roleIndexSource, /auth: 'delete'/)
+ assert.match(roleTableColumnsSource, /auth: 'edit'/)
+ assert.match(roleTableColumnsSource, /auth: 'delete'/)
})
test('createRoleSearchState exposes the role search form model', () => {
--
Gitblit v1.9.1