feat: add import to excel

Made at the request of the customer
This commit is contained in:
2024-10-27 08:29:30 +03:00
parent 7c66f31bac
commit 38b877608f
7 changed files with 141 additions and 35 deletions

View File

@ -18,6 +18,7 @@ import {ProfessorService} from "@api/v1/professor.service";
import {AuthRoles} from "@model/AuthRoles";
import {HasRoleDirective} from "@/directives/has-role.directive";
import {TabSelectType, TabStorageService} from "@service/tab-storage.service";
import {ScheduleRequest} from "@api/v1/scheduleRequest";
export enum TabsSelect {
Group,
@ -48,7 +49,7 @@ export enum TabsSelect {
})
export class TabsComponent implements AfterViewInit {
@Output() eventResult = new EventEmitter<[TabsSelect, number, Observable<ScheduleResponse[]>]>();
@Output() eventResult = new EventEmitter<[TabsSelect, number, Observable<ScheduleResponse[]>, ScheduleRequest]>();
private currentTab: number = -1;
constructor(private scheduleApi: ScheduleService,
@ -68,7 +69,8 @@ export class TabsComponent implements AfterViewInit {
[
TabsSelect.Group,
event,
this.scheduleApi.getByGroup(event)
this.scheduleApi.getByGroup(event),
{groups: [event]}
]
));
@ -76,7 +78,8 @@ export class TabsComponent implements AfterViewInit {
[
TabsSelect.Professor,
event,
this.scheduleApi.getByProfessor(event)
this.scheduleApi.getByProfessor(event),
{professors: [event]}
]
));
@ -84,7 +87,8 @@ export class TabsComponent implements AfterViewInit {
[
TabsSelect.LectureHall,
event,
this.scheduleApi.getByLectureHall(event)
this.scheduleApi.getByLectureHall(event),
{lectureHalls: [event]}
]
));
@ -196,16 +200,19 @@ export class TabsComponent implements AfterViewInit {
protected readonly AuthRoles = AuthRoles;
protected otherFilter() {
const data: ScheduleRequest = ({
groups: this.groupEx.selectedIds,
disciplines: this.disciplineEx.selectedIds,
professors: this.professorEx.selectedIds,
lectureHalls: this.lectureHallEx.selectedIds
});
this.eventResult.emit(
[
TabsSelect.Other,
0,
this.scheduleApi.postSchedule(({
groups: this.groupEx.selectedIds,
disciplines: this.disciplineEx.selectedIds,
professors: this.professorEx.selectedIds,
lectureHalls: this.lectureHallEx.selectedIds
}))
this.scheduleApi.postSchedule(data),
data
]
);
}