feat: split group by graduate
This commit is contained in:
@ -30,7 +30,9 @@ export class GroupComponent implements IScheduleTab {
|
||||
protected faculties: FacultyResponse[] | null = null;
|
||||
protected courseNumbers: number[] | null = null;
|
||||
private groups: GroupResponse[] | null = null;
|
||||
protected filteredGroups: GroupResponse[] | null = [];
|
||||
protected filteredGroupsBehaviour: GroupResponse[] | null = null;
|
||||
protected filteredGroupsMagistracy: GroupResponse[] | null = null;
|
||||
protected filteredGroupsSpecialist: GroupResponse[] | null = null;
|
||||
|
||||
protected facultyId: number | null = null;
|
||||
protected courseNumber: number | null = null;
|
||||
@ -132,8 +134,17 @@ export class GroupComponent implements IScheduleTab {
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.courseNumber !== null)
|
||||
this.filteredGroups = this.groups!.filter(x => x.courseNumber === this.courseNumber);
|
||||
if (this.courseNumber !== null) {
|
||||
const groupByCourse = this.groups!.filter(x => x.courseNumber === this.courseNumber);
|
||||
groupByCourse.forEach(x => {
|
||||
if (x.name[2].toUpperCase() === 'Б')
|
||||
this.filteredGroupsBehaviour?.push(x);
|
||||
else if (x.name[2].toUpperCase() === 'С')
|
||||
this.filteredGroupsSpecialist?.push(x);
|
||||
else
|
||||
this.filteredGroupsMagistracy?.push(x);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
protected onFacultySelected(index: number) {
|
||||
@ -156,7 +167,9 @@ export class GroupComponent implements IScheduleTab {
|
||||
}
|
||||
|
||||
protected onCourseSelected(course: number) {
|
||||
this.filteredGroups = [];
|
||||
this.filteredGroupsBehaviour = [];
|
||||
this.filteredGroupsMagistracy = [];
|
||||
this.filteredGroupsSpecialist = [];
|
||||
this.formChipGroup.reset();
|
||||
|
||||
if (course === undefined) {
|
||||
|
Reference in New Issue
Block a user