|
|
@@ -4,7 +4,7 @@ import { CommonModule } from '@angular/common';
|
|
|
import { ChangeDetectionStrategy, Component, computed, inject, NgZone, OnDestroy, OnInit, signal } from '@angular/core';
|
|
|
import { FormsModule } from '@angular/forms';
|
|
|
import { ActivatedRoute, Router } from '@angular/router';
|
|
|
-import { AlertCircle, BarChart3, BookOpen, CalendarDays, ChevronRight, GraduationCap, LoaderCircle, LucideAngularModule, Search, X } from 'lucide-angular';
|
|
|
+import { AlertCircle, BarChart3, BookOpen, CalendarDays, ChevronDown, ChevronRight, GraduationCap, LoaderCircle, LucideAngularModule, Search, X } from 'lucide-angular';
|
|
|
import { finalize, map, Subscription } from 'rxjs';
|
|
|
import { HomeDailyCacheService } from '../../core/home-daily-cache.service';
|
|
|
import { ApiError, ApiService } from '../../core/api.service';
|
|
|
@@ -69,6 +69,9 @@ export class CourseCenterPageComponent implements OnInit, OnDestroy {
|
|
|
readonly listPage=signal(1); readonly listPages=signal(1); readonly listTotal=signal(0); readonly serverDates=signal<Array<{date:string;finished:number;planned:number}>>([]); readonly serverStudents=signal<StudentOption[]>([]);
|
|
|
private loadRequest?:Subscription; private loadId=0;
|
|
|
readonly courses = signal<Item[]>([]);
|
|
|
+ readonly coursesExpanded = signal(false);
|
|
|
+ readonly visibleCourses = computed(() => this.coursesExpanded() ? this.courses() : this.courses().slice(0, 3));
|
|
|
+ toggleCourses(): void { this.coursesExpanded.update(expanded => !expanded); }
|
|
|
readonly schedules = signal<Item[]>([]);
|
|
|
readonly scheduleFilter = signal<ScheduleFilter>('all');
|
|
|
readonly scheduleRange = signal<ScheduleRange>('day');
|
|
|
@@ -100,7 +103,7 @@ export class CourseCenterPageComponent implements OnInit, OnDestroy {
|
|
|
if (this.scheduleRange() === 'week') return `${this.selectedDate()} 所在周`;
|
|
|
return this.selectedDate();
|
|
|
});
|
|
|
- readonly icons = { AlertCircle, BarChart3, BookOpen, CalendarDays, ChevronRight, GraduationCap, LoaderCircle, Search, X };
|
|
|
+ readonly icons = { AlertCircle, BarChart3, BookOpen, CalendarDays, ChevronDown, ChevronRight, GraduationCap, LoaderCircle, Search, X };
|
|
|
|
|
|
private readonly api = inject(ApiService);
|
|
|
private readonly dailyCache = inject(HomeDailyCacheService);
|