[fix]:[FL-152][对齐角色管理弹窗与分页细节]

Co-authored-by: multica-agent <github@multica.ai>
This commit is contained in:
chengkai3
2026-06-20 08:10:21 +08:00
parent b2dd07d8e8
commit c9b2b332fd
2 changed files with 20 additions and 3 deletions
+18
View File
@@ -222,3 +222,21 @@
- `/api/v1/atp/assets` 新增可选 `limit/offset` 参数;未传参默认返回前 50 条,响应字段不变。
- ATP 资产创建/更新现在会按既有 schema 持久化 `arrester_config`,修复此前前端提交但服务层丢弃该字段的问题。
- 改动不改变 ATP 模型删除、版本、运行接口字段或权限语义。
## Follow-up - 角色管理页弹窗与分页细节对齐(FL-152)
- 背景:
- 评审继续指出角色管理页 Modal 宽度、分页 total 处理方式仍与用户管理页存在可消除的实现差异。
- 本次处理:
- 移除角色管理页 Modal 的 `width={760}`,恢复 AntD 默认宽度,与用户管理页弹窗保持一致。
- 角色表格分页 `total` 改为 `Math.max(rolesQuery.data?.roles_total ?? 0, 1)``showTotal` 改为读取查询 total,与用户管理页现有实现一致。
- 复核角色卡片下拉菜单顺序,当前为“查看菜单 → 删除”,删除已在最后,无需额外调整。
- 验证:
- 修改后:`npm --workspace web exec eslint src/app/admin/roles/page.tsx --max-warnings=0` 通过。
- 修改后:`npm --workspace web exec tsc --noEmit` 通过。
- 修改后:`npm --workspace web exec eslint src/app/admin/users/page.tsx src/app/admin/roles/page.tsx` 通过,仍仅用户页 1 条既有 unused eslint-disable warning。
- 风险与关注点:
- 改动仅影响角色管理页前端弹窗尺寸和分页展示逻辑,不改变接口、schema、权限或 CRUD 语义。
+2 -3
View File
@@ -826,10 +826,10 @@ export default function AdminRolesPage() {
pagination={{
current: paginationCurrent,
pageSize: paginationPageSize,
total: rolesQuery.data?.roles_total ?? 0,
total: Math.max(rolesQuery.data?.roles_total ?? 0, 1),
showSizeChanger: true,
pageSizeOptions: [10, 20, 50, 100],
showTotal: (total) => `${total}`,
showTotal: () => `${rolesQuery.data?.roles_total ?? 0}`,
hideOnSinglePage: false,
style: { marginBottom: 0 },
onChange: (page, pageSize) => {
@@ -898,7 +898,6 @@ export default function AdminRolesPage() {
confirmLoading={createRoleMutation.isPending || updateRoleMutation.isPending}
onCancel={closeDialog}
onOk={() => void submit()}
width={760}
>
<Form<RoleFormValues>
form={form}