[fix]:[FL-53][系统中所有的成功失败提示优化]

Co-authored-by: multica-agent <github@multica.ai>
This commit is contained in:
chengkai3
2026-06-08 23:57:44 +08:00
parent 1adec62d6c
commit 533a325c86
17 changed files with 229 additions and 137 deletions
+31
View File
@@ -116,3 +116,34 @@
- 风险与关注点:
- 已经以错误编码写入数据库的历史 ATP 文本不会被自动修复;本次修复只覆盖后续上传与预览入口。
## Work Log - 全局成功失败提示切换为右上角弹消息(2026-06-08)
- 背景:
- 后台多个页面仍把普通 CRUD 成功/失败提示渲染在页面顶部,占用列表与表单空间。
- 现有页面已经混用 Ant Design `message` 与顶部 `Alert`,交互不统一。
- 本次处理:
- `web/src/components/ui-antd.tsx`
- 为全局 Ant Design `message` 统一配置顶部偏移与默认停留时长。
- `web/src/app/globals.css`
-`message` 容器样式调整为右上角浮层展示。
- `web/src/hooks/use-toast-feedback.ts`
- 新增轻量 hook,用于把页面本地 `error/success` 状态统一转成右上角自动消失的提示。
- 后台页面:
- `users``system-params``wine-runner``lightning-currents``power-lines/atp-viewer`
- `roles``menus``files``tower-models``elevation``power-lines``fault-recurrence`
- 去掉顶部“操作成功/失败”提示条,改为右上角弹消息;保留权限不足、加载失败、解析提醒等需要常驻占位的 `Alert`
- 验证:
- 基线:
- 初次 `npm --workspace web exec tsc --noEmit --pretty false` 因当前环境缺少 `web/node_modules` 且默认 npm cache 不可写未能执行。
- 补装依赖后,基线 `NPM_CONFIG_CACHE=/tmp/fquiz-npm-cache npm --workspace web exec tsc --noEmit --pretty false` 通过。
- 修改后:
- `NPM_CONFIG_CACHE=/tmp/fquiz-npm-cache npm --workspace web exec tsc --noEmit --pretty false` 通过。
- `NPM_CONFIG_CACHE=/tmp/fquiz-npm-cache npm --workspace web exec eslint src/components/ui-antd.tsx src/hooks/use-toast-feedback.ts src/app/admin/users/page.tsx src/app/admin/system-params/page.tsx src/app/admin/wine-runner/page.tsx src/app/admin/lightning-currents/page.tsx src/app/admin/power-lines/atp-viewer/page.tsx src/app/admin/roles/page.tsx src/app/admin/menus/page.tsx src/app/admin/files/page.tsx src/app/admin/tower-models/page.tsx src/app/admin/elevation/page.tsx src/app/admin/power-lines/page.tsx src/app/admin/fault-recurrence/page.tsx`
- 仅剩仓库原有 warning`users`/`tower-models` 的 hooks 依赖与 `img` 提示),无新增 error。
- `git diff --check` 通过。
- 风险与关注点:
- 本次只统一“瞬时成功/失败反馈”;权限态、加载态、解析告警等长驻提示仍保留 `Alert`,属于有意设计,不是遗漏。