Files
2026-06-26 14:33:31 +08:00

28 lines
1.3 KiB
Markdown
Raw Permalink 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.

# Schedule 模块业务逻辑
## 模块职责
Schedule 模块负责首页 `schedule_management` 入口,提供排班日历、某日排班列表、新增排班和删除排班能力。
模块状态只保存在 `ScheduleManagementViewModel``ScheduleAddViewModel` 内,不写入全局登录态、账号上下文或首页状态。
## 排班列表
`ScheduleManagementViewModel` 按当前月份加载有排班的日期标记,并按选中日期加载日排班列表。切换月份或日期时只刷新当前模块数据。
缺少当前景区时ViewModel 会清空月份标记和日程列表,并展示缺少经营上下文的空状态。
## 新增排班
`ScheduleAddViewModel` 管理名称、备注、日期、开始/结束时间和关联订单。关联订单可以从接口返回的可选订单中选择,也可以手填订单号兜底。
提交前会校验名称、景区、日期和时间顺序;重复提交会被忽略。提交成功后返回排班列表并刷新当前日期。
## 接口边界
`ScheduleAPI` 封装月排班日期、日排班列表、新增排班、删除排班和可关联订单接口。可关联订单模型放在共享业务模型中,避免 Schedule 直接依赖 Tasks 模块。
## 缓存边界
排班表单、关联订单、月标记和日程列表都只保存在内存中,不做本地缓存。