Files
shanxia2.0/docs/superpowers/plans/2026-10-30-site-dispatch-calendar.md
T

30 lines
2.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 现场日历实施计划
**Goal:** 在其他日历后增加功能相同的现场日历。
**Architecture:** 复用 ManualCalendar,以 site 作为独立类型;后端 schema/service 同步允许该类型,保留既有权限和租户过滤。
**Tech Stack:** Vue 3、TypeScript、FastAPI、SQLAlchemy、pytest、Playwright。
- [x] 在 backend/tests/test_pl_dispatch_calendar.py 添加现场日历 CRUD、租户及类型隔离、禁止跨类型编辑与软删除测试,确认旧校验拒绝 site。
- [x] 扩展 backend/app/schemas/pl/dispatch_calendar.py、backend/app/services/pl_dispatch_calendar_service.py 类型校验与错误提示。
- [x] 更新 web-admin/src/api/pl/dispatch-calendar.ts 类型和 web-admin/src/views/pl/dispatch-calendar/index.vue tab、主题与组件参数。
- [x] 更新 backend/app/models/pl_dispatch_calendar.py、docs/sql/shanxia2.0.sql 注释,增加 docs/sql/migrations/2026-10-30-dispatch-calendar-site-kind.sql。
- [x] 运行 backend/venv/bin/python -m pytest(backend 工作目录,tests/test_pl_dispatch_calendar.py 与 tests/test_pl_dispatch_calendar_migration.py)。
- [x] 运行前端相关 tsx 单元测试、目标文件 ESLint 与 pnpm build。
- [x] 运行 web-admin/scripts/test-manual-dispatch-calendar.mjs 浏览器回归,检查现场 tab、增删改、复制、失败重试与只读权限。
- [x] 复核最终 diff 与 git diff --check。
验证结果:后端 69 项通过;前端单元测试 29 项通过;Web 酸日历、Web 现场日历与 H5 酸日历浏览器回归通过;目标文件 ESLint、生产构建及 diff 空白检查通过。构建保留现有组件重名和大分包警告。未执行生产数据库迁移或部署。
## 后续:起止地选填
- [x] 四种日历分别覆盖单边空、两边空白、编辑清空与请求遗漏地址字段的回归,确认旧校验失败后修改。
- [x] 共用前端 validator 与后端 schema 取消非空限制,Web/H5 取消必填标记,保留长度校验。
- [x] 后端 81 项、前端 29 项测试通过。ESLint 检出原文件已有的 ElMessageBox 全局声明及格式问题,使用 HEAD 原文件复现;本次未改动无关代码。
- [x] Web 四种日历与 H5 酸日历浏览器回归通过,包含留空创建后编辑补填;生产构建通过,diff 空白检查通过。未部署线上。
## 数据库执行记录
经用户明确授权,已在测试库和生产库执行 `docs/sql/migrations/2026-10-30-dispatch-calendar-site-kind.sql`,并核验 `pl_dispatch_calendar.calendar_kind` 注释增加 `site现场`。两库字段类型 `varchar(16)`、非空约束、默认值 `acid`、字符集及排序规则保持不变,未修改业务数据。应用代码尚未部署。