feat: show campus name with lecture hall
This commit is contained in:
@ -18,6 +18,7 @@ import {AuthRoles} from "@model/authRoles";
|
|||||||
import {HasRoleDirective} from "@/directives/has-role.directive";
|
import {HasRoleDirective} from "@/directives/has-role.directive";
|
||||||
import {TabSelectType, TabStorageService} from "@service/tab-storage.service";
|
import {TabSelectType, TabStorageService} from "@service/tab-storage.service";
|
||||||
import {ScheduleRequest} from "@api/v1/scheduleRequest";
|
import {ScheduleRequest} from "@api/v1/scheduleRequest";
|
||||||
|
import {CampusService} from "@api/v1/campus.service";
|
||||||
|
|
||||||
export enum TabsSelect {
|
export enum TabsSelect {
|
||||||
Group,
|
Group,
|
||||||
@ -43,7 +44,14 @@ export enum TabsSelect {
|
|||||||
],
|
],
|
||||||
templateUrl: './tabs.component.html',
|
templateUrl: './tabs.component.html',
|
||||||
styleUrl: './tabs.component.css',
|
styleUrl: './tabs.component.css',
|
||||||
providers: [ScheduleService, DisciplineService, LectureHallService, GroupService, ProfessorService, TabStorageService]
|
providers: [
|
||||||
|
ScheduleService,
|
||||||
|
DisciplineService,
|
||||||
|
LectureHallService,
|
||||||
|
GroupService,
|
||||||
|
ProfessorService,
|
||||||
|
TabStorageService,
|
||||||
|
CampusService]
|
||||||
})
|
})
|
||||||
|
|
||||||
export class TabsComponent implements AfterViewInit {
|
export class TabsComponent implements AfterViewInit {
|
||||||
@ -55,7 +63,8 @@ export class TabsComponent implements AfterViewInit {
|
|||||||
private lectureApi: LectureHallService,
|
private lectureApi: LectureHallService,
|
||||||
private groupApi: GroupService,
|
private groupApi: GroupService,
|
||||||
private professorApi: ProfessorService,
|
private professorApi: ProfessorService,
|
||||||
private tabStorage: TabStorageService) {
|
private tabStorage: TabStorageService,
|
||||||
|
private campusApi: CampusService) {
|
||||||
}
|
}
|
||||||
|
|
||||||
ngAfterViewInit(): void {
|
ngAfterViewInit(): void {
|
||||||
@ -159,12 +168,14 @@ export class TabsComponent implements AfterViewInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected async loadLectureHalls() {
|
protected async loadLectureHalls() {
|
||||||
|
this.campusApi.getCampus().subscribe(campus => {
|
||||||
this.lectureApi.getLectureHalls().subscribe(data => {
|
this.lectureApi.getLectureHalls().subscribe(data => {
|
||||||
this.lectureHallEx.Data = data.map(x => ({
|
this.lectureHallEx.Data = data.map(x => ({
|
||||||
id: x.id,
|
id: x.id,
|
||||||
name: x.name
|
name: x.name + ` (${campus.find(c => c.id == x.campusId)?.codeName})`
|
||||||
}) as SelectData);
|
}) as SelectData);
|
||||||
});
|
});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
protected async loadGroups() {
|
protected async loadGroups() {
|
||||||
|
Reference in New Issue
Block a user