From 42d831892a9aaa940a58249d8ca385df33f06aa3 Mon Sep 17 00:00:00 2001 From: Polianin Nikita Date: Sat, 31 Aug 2024 02:18:55 +0300 Subject: [PATCH] feat: split group by graduate --- .../schedule/tabs/group/group.component.css | 5 ++ .../schedule/tabs/group/group.component.html | 64 +++++++++++++++++-- .../schedule/tabs/group/group.component.ts | 21 ++++-- 3 files changed, 82 insertions(+), 8 deletions(-) diff --git a/src/components/schedule/tabs/group/group.component.css b/src/components/schedule/tabs/group/group.component.css index e69de29..0da5953 100644 --- a/src/components/schedule/tabs/group/group.component.css +++ b/src/components/schedule/tabs/group/group.component.css @@ -0,0 +1,5 @@ +.div-wrapper { + display: block; + width: 100%; + padding: 10px 0; +} diff --git a/src/components/schedule/tabs/group/group.component.html b/src/components/schedule/tabs/group/group.component.html index 97a7801..b5b0c93 100644 --- a/src/components/schedule/tabs/group/group.component.html +++ b/src/components/schedule/tabs/group/group.component.html @@ -6,11 +6,13 @@ + @for (faculty of faculties; track $index) { {{ faculty.name }} } + @if (faculties === null) { + @for (course of courseNumbers; track $index) { {{ course }} } + @if (courseNumbers === null) { - @for (group of filteredGroups; track $index) { - - {{ group.name }} - + + @if (filteredGroupsSpecialist && filteredGroupsSpecialist.length > 0) { +
+ Специалитет: +
+ +
+ @for (group of filteredGroupsSpecialist; track $index) { + + {{ group.name }} + + } +
} + + @if (filteredGroupsSpecialist && filteredGroupsSpecialist.length > 0 && (filteredGroupsBehaviour && filteredGroupsBehaviour.length > 0 || filteredGroupsMagistracy && filteredGroupsMagistracy.length > 0)) { +
+
+
+ } + + @if (filteredGroupsBehaviour && filteredGroupsBehaviour.length > 0) { +
+ Бакалавариат: +
+ +
+ @for (group of filteredGroupsBehaviour; track $index) { + + {{ group.name }} + + } +
+ } + + @if (((filteredGroupsSpecialist && filteredGroupsSpecialist.length > 0 && filteredGroupsBehaviour && filteredGroupsBehaviour.length > 0) || + ((!filteredGroupsSpecialist || filteredGroupsSpecialist.length === 0) && filteredGroupsBehaviour && filteredGroupsBehaviour.length > 0)) && + filteredGroupsMagistracy && filteredGroupsMagistracy.length > 0) { +
+
+
+ } + + @if (filteredGroupsMagistracy && filteredGroupsMagistracy.length > 0) { +
+ Магистратура: +
+ +
+ @for (group of filteredGroupsMagistracy; track $index) { + + {{ group.name }} + + } +
+ } + @if (faculties === null) { 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) {