[feat]:[FL-153][系统参数管理页面一致性优化]

Co-authored-by: multica-agent <github@multica.ai>
This commit is contained in:
chengkai3
2026-06-20 06:50:53 +08:00
parent 6989775abe
commit 012b62fab9
5 changed files with 293 additions and 39 deletions
+25
View File
@@ -78,3 +78,28 @@
- 风险与关注点:
- 角色编码重复检查依赖现有角色列表 keyword 查询做前端预检查;服务端创建接口和数据库唯一约束仍是最终一致性保护。
- 改动仅影响角色管理页前端,不改变后端接口、schema 或权限语义。
# Work Log - 系统参数管理页一致性优化(FL-153)
- 背景:
- 系统参数管理页需要对齐用户管理页的列表布局、权限呈现、移动卡片、反馈校验与分页交互规范。
- 本次处理:
- 系统参数页新建入口改为仅 `system_param.manage` 权限可见,保持只读权限下的页面呈现与实际操作权限一致。
- 表格配置对齐用户管理页:`tableLayout="fixed"`、仅纵向滚动、空态属性顺序、加载态和分页最小 total 处理保持一致。
- 移动卡片状态 Tag 文案与颜色对齐用户管理页,并补齐 card view 数据累积的 `requestAnimationFrame` 时序处理。
- 新建/编辑弹窗补齐 `autoComplete="off"`、字段长度规则、参数键防抖重复检查和提交前重复检查。
- 后端系统参数列表接口补齐 `limit/offset` 查询参数并在 service 层实际分页,修复前端分页参数此前未生效的问题。
- 新增 `api/tests/test_system_param_service.py` 覆盖系统参数列表分页与筛选后分页行为。
- 验证:
- 基线:`npm --workspace web exec eslint src/app/admin/users/page.tsx src/app/admin/system-params/page.tsx` 通过,仅用户页存在 1 条既有 unused eslint-disable warning。
- 基线:`npm --workspace web exec tsc --noEmit` 通过。
- 修改后:`npm --workspace web exec eslint src/app/admin/system-params/page.tsx --max-warnings=0` 通过。
- 修改后:`npm --workspace web exec tsc --noEmit` 通过。
- 修改后:`python3 -m py_compile api/app/api/v1/system_params.py api/app/services/system_param_service.py api/tests/test_system_param_service.py` 通过。
- 修改后:`UV_PYTHON_INSTALL_DIR=/tmp/fquiz-uv-python uv run --cache-dir /tmp/fquiz-uv-cache --python 3.11 --with fastapi --with pydantic-settings --with sqlalchemy --with PyJWT --with argon2-cffi --with email-validator --with bcrypt -m unittest api.tests.test_system_param_service` 通过。
- 风险与关注点:
- 改动涉及系统参数列表接口分页契约,但不改变请求/响应字段结构、权限码或 CRUD 语义。
- 当前本机 `python3` 为 3.7.9,不满足 `api/pyproject.toml``requires-python >=3.10`;后端单测使用 `uv` 管理的 Python 3.11 环境验证。