feat: add filter by lesson type
This commit is contained in:
@ -23,6 +23,7 @@
|
||||
<app-other idButton="lecture-button" textButton="Кабинеты" #lecture (retryLoadData)="loadLectureHalls()"/>
|
||||
<app-other idButton="group-button" textButton="Группы" #group (retryLoadData)="loadGroups()"/>
|
||||
<app-other idButton="professor-button" textButton="Профессоры" #professor (retryLoadData)="loadProfessors()"/>
|
||||
<app-other idButton="lesson-type-button" textButton="Тип занятия" #lesson_type (retryLoadData)="loadLessonType()"/>
|
||||
<section>
|
||||
<button mat-flat-button (click)="otherFilter()">Отфильтровать</button>
|
||||
</section>
|
||||
|
@ -19,6 +19,7 @@ import {HasRoleDirective} from "@/directives/has-role.directive";
|
||||
import {TabSelectType, TabStorageService} from "@service/tab-storage.service";
|
||||
import {ScheduleRequest} from "@api/v1/scheduleRequest";
|
||||
import {CampusService} from "@api/v1/campus.service";
|
||||
import {LessonTypeService} from "@api/v1/lessonType.service";
|
||||
|
||||
export enum TabsSelect {
|
||||
Group,
|
||||
@ -51,7 +52,8 @@ export enum TabsSelect {
|
||||
GroupService,
|
||||
ProfessorService,
|
||||
TabStorageService,
|
||||
CampusService]
|
||||
CampusService,
|
||||
LessonTypeService]
|
||||
})
|
||||
|
||||
export class TabsComponent implements AfterViewInit {
|
||||
@ -64,7 +66,8 @@ export class TabsComponent implements AfterViewInit {
|
||||
private groupApi: GroupService,
|
||||
private professorApi: ProfessorService,
|
||||
private tabStorage: TabStorageService,
|
||||
private campusApi: CampusService) {
|
||||
private campusApi: CampusService,
|
||||
private lessonTypeApi: LessonTypeService) {
|
||||
}
|
||||
|
||||
ngAfterViewInit(): void {
|
||||
@ -151,6 +154,7 @@ export class TabsComponent implements AfterViewInit {
|
||||
await this.loadLectureHalls();
|
||||
await this.loadGroups();
|
||||
await this.loadProfessors();
|
||||
await this.loadLessonType();
|
||||
break;
|
||||
default:
|
||||
await this.chooseTabs(0);
|
||||
@ -196,6 +200,15 @@ export class TabsComponent implements AfterViewInit {
|
||||
});
|
||||
}
|
||||
|
||||
protected async loadLessonType() {
|
||||
this.lessonTypeApi.getLessonTypes().subscribe(data => {
|
||||
this.lessonTypeEx.Data = data.map(x => ({
|
||||
id: x.id,
|
||||
name: x.name
|
||||
}) as SelectData);
|
||||
});
|
||||
}
|
||||
|
||||
@ViewChild('groupTab') groupTab!: IScheduleTab;
|
||||
@ViewChild('professorTab') professorTab!: IScheduleTab;
|
||||
@ViewChild('lectureHallTab') lectureHallTab!: IScheduleTab;
|
||||
@ -204,6 +217,7 @@ export class TabsComponent implements AfterViewInit {
|
||||
@ViewChild('lecture') lectureHallEx!: OtherComponent;
|
||||
@ViewChild('group') groupEx!: OtherComponent;
|
||||
@ViewChild('professor') professorEx!: OtherComponent;
|
||||
@ViewChild('lesson_type') lessonTypeEx!: OtherComponent;
|
||||
|
||||
@ViewChild('tabGroup') tabs!: MatTabGroup;
|
||||
protected readonly AuthRoles = AuthRoles;
|
||||
@ -213,7 +227,8 @@ export class TabsComponent implements AfterViewInit {
|
||||
groups: this.groupEx.selectedIds,
|
||||
disciplines: this.disciplineEx.selectedIds,
|
||||
professors: this.professorEx.selectedIds,
|
||||
lectureHalls: this.lectureHallEx.selectedIds
|
||||
lectureHalls: this.lectureHallEx.selectedIds,
|
||||
lessonType: this.lessonTypeEx.selectedIds
|
||||
});
|
||||
|
||||
this.eventResult.emit(
|
||||
|
Reference in New Issue
Block a user