Version: 0.9.36.dev.260423

前端:
1. 精排弹窗修复——嵌入课程的任务正确传递宿主 event_id + 被嵌入课程不再单独渲染
- components/assistant/ScheduleFineTuneModal.vue:新增 buildCoursePositionIndex / resolveEmbedCourseEventId 辅助函数,按位置匹配 suggested task 与宿主课程
- buildPlacedItems / handleOfficialSave:embed_course_event_id 优先取后端预览值,兜底走位置索引查找,解决批量应用接口因缺宿主 ID 报日程冲突
- currentWeekEntries:被嵌入的 existing course 过滤不渲染,避免与任务卡片同位重叠导致课程视觉被吞

后端:
2. 预览转换补充嵌入关系桥接(防御性)
- newAgent/conv/schedule_preview.go:ScheduleStateToPreview 中 suggested 任务 EmbedHost 非空时,解析宿主课程 SourceID
  写入 entry.EventID,供前端作为 embed_course_event_id 透传
This commit is contained in:
LoveLosita
2026-04-23 10:51:11 +08:00
parent ad463eb6a1
commit 3c2f3c0b71
2 changed files with 53 additions and 4 deletions

View File

@@ -72,6 +72,13 @@ func ScheduleStateToPreview(
} else {
entry.TaskItemID = t.SourceID
entry.TaskClassID = t.TaskClassID
// 嵌入任务:将宿主课程的 source_id即 event_id桥接到 EventID
// 供前端作为 embed_course_event_id 传递给 BatchApplyPlans 做冲突豁免。
if t.EmbedHost != nil {
if host := state.TaskByStateID(*t.EmbedHost); host != nil {
entry.EventID = host.SourceID
}
}
}
// 嵌入与阻塞语义。