diff --git a/frontend/sidebar/src/components/SummaryCard.tsx b/frontend/sidebar/src/components/SummaryCard.tsx index c1c7c32..8474838 100644 --- a/frontend/sidebar/src/components/SummaryCard.tsx +++ b/frontend/sidebar/src/components/SummaryCard.tsx @@ -1,5 +1,6 @@ /** * 每日总结卡片渲染组件(summary / summary-search 页面共用) + * 样式:对话气泡(学员咨询左 / 老师解答右)+ 跟进建议卡片 + 灰色标签 */ export interface SummaryItem { @@ -31,46 +32,89 @@ export function SummaryCard({ item }: { item: SummaryItem }) { const parsed = parseSummary(item.summary) const hasStructure = parsed.sections.length > 0 || parsed.tags.length > 0 + // 按区块类型归类:学员咨询(左气泡) / 老师解答(右气泡) / 跟进建议(卡片) / 其它(通用卡片) + const customerItems: string[] = [] + const teacherItems: string[] = [] + const todoItems: string[] = [] + let hasTodoSection = false + const otherSections: SummarySection[] = [] + + for (const section of parsed.sections) { + if (section.title.includes('核心诉求')) { + customerItems.push(...section.items) + } else if (section.title.includes('处理结果')) { + teacherItems.push(...section.items) + } else if (section.title.includes('待办') || section.title.includes('后续')) { + hasTodoSection = true + todoItems.push(...section.items.filter(t => !isNoneText(t))) + } else { + otherSections.push(section) + } + } + return (