feat: 活动管理模块 SOP 清单增强与模板管理#80
Merged
opensourceways-bot merged 1 commit intoopensourceways:mainfrom Feb 25, 2026
Merged
Conversation
后端:
- ChecklistItem/ChecklistTemplateItem 新增 SOP 字段(is_mandatory、responsible_role、description、reference_url、completed_at、deadline_offset_days、estimated_hours)
- events.py 新增 POST/DELETE /events/{id}/checklist 端点,扩展 ChecklistItemUpdate 字段
- event_templates.py 新增模板条目 CRUD(POST/PATCH/DELETE /event-templates/{id}/items)及模板 DELETE 端点,修复列表/详情/更新权限校验
- 上传测试修复:autouse fixture 隔离 boto3/S3 依赖
- 新增 Alembic migration(sop_fields + reference_url)
前端:
- EventDetail.vue:清单 Tab 支持手动添加/编辑/删除单条清单项;新增「从模板导入」对话框(预览条目 + 按偏移量计算 due_date)
- Events.vue:创建活动表单新增 SOP 模板选择器
- EventTemplates.vue:新建 SOP 模板管理页面,支持条目拖拽排序(vuedraggable)
- App.vue:活动管理改为子菜单,新增 SOP 模板入口
- frontend/Dockerfile:npm ci + BuildKit 缓存加速,基础镜像固定版本
- 路由新增 /event-templates
测试:
- test_events_api.py 新增 TestChecklistCRUD(POST/PATCH/DELETE 全路径)、TestChecklistCompletedAt、TestCreateEventFromTemplate
- test_event_templates_api.py 完整覆盖权限、条目 CRUD、删除模板
Contributor
CLA Signature PassZhengZhenyu, thanks for your pull request. All authors of the commits have signed the CLA. 👍 |
Contributor
|
/lgtm |
Contributor
Review Code Feedback
Tips
|
Contributor
Review Code Feedback
Tips
|
Contributor
PR Merge Failed
|
This was referenced Feb 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
关联 Issue
Closes #79
变更概述
本 PR 实现了 Issue #79 描述的 SOP 清单全功能增强,覆盖后端模型/API、数据库迁移、前端页面及测试。
主要变更
后端
数据模型扩展(
models/event.py)ChecklistTemplateItem新增:is_mandatory、responsible_role、deadline_offset_days、estimated_hours、reference_urlChecklistItem新增:description、is_mandatory、responsible_role、completed_atAPI 新增(
api/events.py、api/event_templates.py)POST /events/{id}/checklist— 手动创建清单项DELETE /events/{id}/checklist/{item_id}— 删除清单项POST/PATCH/DELETE /event-templates/{id}/items— 模板条目 CRUDDELETE /event-templates/{id}— 删除模板自动化逻辑
deadline_offset_days自动计算清单项due_datedone时自动写入completed_at;改回pending/skipped时清空Alembic 迁移:新增两个 migration 文件
前端
新页面
EventTemplates.vue(路由/event-templates)Events.vue— 创建活动表单新增 SOP 模板选择器EventDetail.vue执行清单 TabApp.vue— 活动管理改为子菜单,新增 SOP 模板入口frontend/Dockerfile—npm ci+ BuildKit 缓存加速,基础镜像固定版本测试
test_events_api.py— 新增TestChecklistCRUD(12 个用例)、TestChecklistCompletedAt(4 个)、TestCreateEventFromTemplate(4 个)test_event_templates_api.py— 全面覆盖权限、条目 CRUD、删除模板test_upload_api.py— autouse fixture 隔离 boto3/S3 依赖,修复 CI 中的测试失败测试验证
前端构建无 TypeScript 错误。
测试计划
due_date按偏移量计算正确completed_at自动设置/清空