lesson-report.component.html 3.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <section class="lesson-report" [attr.aria-busy]="loading()">
  2. @if (error()) { <div class="load-error" role="alert"><p>{{ error() }}</p><button type="button" (click)="load()" [disabled]="loading()">重新加载</button></div> }
  3. @if (report(); as r) {
  4. <header class="report-hero">
  5. <div class="hero-top"><span>本次课堂报告</span><button type="button" aria-label="刷新学习报告" (click)="load()" [disabled]="loading()"><lucide-icon [img]="icons.RefreshCw" [size]="18" /></button></div>
  6. <h1>{{ r.order['kcmc'] || r.order['yykcmc'] || '课程学习报告' }}</h1>
  7. <p>{{ r.order['HoneyName'] || '学员' }}<span aria-hidden="true"> · </span>{{ dateLabel(r.order['yysj']) }}</p>
  8. @if (r.order['cancelled']) { <span class="status-badge">此预约已取消</span> }
  9. @else { <span class="status-badge">{{ r.feedback ? '已结课' : '反馈待提交' }}</span> }
  10. </header>
  11. <div class="learning-stats" aria-label="本次学习统计">
  12. <div><strong>{{ count('learned') }}</strong><span>学习单词</span></div>
  13. <div><strong>{{ count('ygg') }}</strong><span>已掌握</span></div>
  14. <div><strong>{{ r.antiForget.completed }}<small> / {{ r.antiForget.total }}</small></strong><span>抗遗忘完成</span></div>
  15. </div>
  16. <section class="report-card">
  17. <header><h2><lucide-icon [img]="icons.ClipboardList" [size]="19" aria-hidden="true" />完课反馈</h2>
  18. @if ($any(r.order['allowedActions'])?.includes('editFeedback')) { <a class="edit-link" routerLink="/pages/shop/get_order" [queryParams]="{id:orderId,editReport:1}">修改报告</a> }
  19. </header>
  20. @if (r.feedback; as f) { <app-lesson-feedback [feedback]="f" /> }
  21. @else { <p class="empty-copy">老师尚未提交反馈,提交后将在这里展示。</p> }
  22. </section>
  23. <section class="report-card">
  24. <header><h2><lucide-icon [img]="icons.BookOpen" [size]="19" aria-hidden="true" />学习记录</h2><span>{{ r.records.length }} 条记录</span></header>
  25. <div class="study-records">
  26. @for (item of r.records; track $index) {
  27. <article><time>{{ dateLabel(item['dqrq']) }}</time><p>{{ item['con'] || '单词学习' }}</p><div><span>已学 <b>{{ item['learned'] || 0 }}</b> 词</span><span>已掌握 <b>{{ item['ygg'] || 0 }}</b> 词</span><span>待加强 <b>{{ item['djq'] || 0 }}</b> 词</span></div></article>
  28. } @empty { <p class="empty-copy">暂无本次课程的单词学习记录</p> }
  29. </div>
  30. </section>
  31. <section class="report-card">
  32. <header><h2><lucide-icon [img]="icons.Star" [size]="19" aria-hidden="true" />学生评价</h2></header>
  33. @if (r.order['studentReview']; as review) { <p class="rating">{{ $any(review).score }}<small> / 5 分</small></p><p class="review-comment">{{ $any(review).comment || '学员未填写文字评价' }}</p> }
  34. @else { <p class="empty-copy">等待学员评价本次课程</p> }
  35. </section>
  36. <section class="report-card">
  37. <header><h2><lucide-icon [img]="icons.BrainCircuit" [size]="19" aria-hidden="true" />抗遗忘计划</h2><span>{{ reviewProgress() }}%</span></header>
  38. <div class="review-track" role="progressbar" aria-label="抗遗忘计划完成进度" [attr.aria-valuenow]="reviewProgress()" aria-valuemin="0" aria-valuemax="100"><span [style.width.%]="reviewProgress()"></span></div>
  39. <p class="empty-copy">{{ r.antiForget.total ? '已完成 ' + r.antiForget.completed + ' 项,共 ' + r.antiForget.total + ' 项复习任务' : '本次课程暂无抗遗忘任务' }}</p>
  40. </section>
  41. <p class="report-updated">数据更新于 {{ dateLabel(r.refreshedAt) }}</p>
  42. } @else if (loading()) { <div class="loading-state" role="status">正在整理本次学习报告…</div> }
  43. <footer><a routerLink="/pages/his/his">查看学习记录</a></footer>
  44. </section>