From f6c23c2d2b1533f1f8e1006d2f326e88821149ca Mon Sep 17 00:00:00 2001 From: DanielKirchmeier Date: Mon, 29 Aug 2022 01:40:27 +0200 Subject: [PATCH] =?UTF-8?q?Vor=20erster=20Pr=C3=A4sentation=20am=2029.8.20?= =?UTF-8?q?22?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/app.module.ts | 7 +- src/app/ausbildung/ausbildung.component.html | 4 +- src/app/beruf/beruf.component.html | 4 +- src/app/dash/dash.component.html | 54 ++---- src/app/dash/dash.component.ts | 2 +- src/app/dashboard/dashboard.component.html | 10 +- src/app/kompetenz/kompetenz.component.html | 92 +++++++--- src/app/kompetenz/kompetenz.component.ts | 93 +++++++++- .../lehrling2beruf.component.html | 4 +- .../list-lehrlinge.component.css | 14 ++ .../list-lehrlinge.component.html | 136 ++++++++++---- .../list-lehrlinge.component.ts | 85 ++++++++- src/app/modul/modul.component.html | 18 +- src/app/modul/modul.component.ts | 2 +- src/app/notfound/notfound.component.html | 5 +- src/app/prergebnis/prergebnis.component.css | 16 +- src/app/prergebnis/prergebnis.component.html | 169 +++++++++--------- src/app/prergebnis/prergebnis.component.ts | 14 +- src/app/pruefung/pruefung.component.html | 13 +- src/app/sidebar/sidebar.component.html | 24 ++- src/bildungsdb.css | 30 +++- 21 files changed, 569 insertions(+), 227 deletions(-) diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 151150e..7a279b7 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -45,7 +45,8 @@ import { MatOption } from '@angular/material/core'; import { MatSelectModule } from '@angular/material/select'; import { PruefungsergebnisComponent } from './pruefungsergebnis/pruefungsergebnis.component'; import { MatDatepickerModule } from '@angular/material/datepicker'; - +import {MatTabsModule} from '@angular/material/tabs'; +import {MatRadioModule} from '@angular/material/radio'; @NgModule({ imports: [ HttpClientModule, @@ -68,7 +69,9 @@ import { MatDatepickerModule } from '@angular/material/datepicker'; NgbModule, MatCardModule, MatSelectModule, - MatDatepickerModule + MatDatepickerModule, + MatTabsModule, + MatRadioModule ], declarations: [ AppComponent, diff --git a/src/app/ausbildung/ausbildung.component.html b/src/app/ausbildung/ausbildung.component.html index 5a96450..c8ead96 100644 --- a/src/app/ausbildung/ausbildung.component.html +++ b/src/app/ausbildung/ausbildung.component.html @@ -1 +1,3 @@ -

ausbildung works!

+
+ Ausbildung +
diff --git a/src/app/beruf/beruf.component.html b/src/app/beruf/beruf.component.html index 86ec577..255f2f5 100644 --- a/src/app/beruf/beruf.component.html +++ b/src/app/beruf/beruf.component.html @@ -1 +1,3 @@ -

beruf works!

+
+ Beruf +
\ No newline at end of file diff --git a/src/app/dash/dash.component.html b/src/app/dash/dash.component.html index 41206e4..88ddb54 100644 --- a/src/app/dash/dash.component.html +++ b/src/app/dash/dash.component.html @@ -1,10 +1,7 @@ - +
+ Übersicht der Ausbildung +
-
 
Filter @@ -53,36 +50,23 @@ aria-label="Seite wählen">
+
- - -
-
...
-
...
-
...
-
...
-
- - - +
Lehrling
+ + +

Hier werden die erworbenen und noch fehlenden Kompetenzen des ausgewählten Lehrlings angezeigt +
+ +

Hier werden die erworbenen und noch fehlenden Module des ausgewählten Lehrlings angezeigt +
+ +

Hier werden die absolvierten und noch fehlenden Prüfungen des ausgewählten Lehrlings angezeigt +
+ +

Hier können Anmerkungen zum ausgewählten Lehrlings angezeigt oder eingetragen werden. +
+
diff --git a/src/app/dash/dash.component.ts b/src/app/dash/dash.component.ts index 817c97e..91b84b3 100644 --- a/src/app/dash/dash.component.ts +++ b/src/app/dash/dash.component.ts @@ -12,7 +12,7 @@ import { MatPaginatorModule } from '@angular/material/paginator'; import { MatPaginator} from '@angular/material/paginator'; import { MatSortModule, Sort } from '@angular/material/sort'; import { MatSort } from '@angular/material/sort'; - +import {MatTabsModule} from '@angular/material/tabs'; @Component({ selector: 'app-dash', templateUrl: './dash.component.html', diff --git a/src/app/dashboard/dashboard.component.html b/src/app/dashboard/dashboard.component.html index 2353084..80d1495 100644 --- a/src/app/dashboard/dashboard.component.html +++ b/src/app/dashboard/dashboard.component.html @@ -1,11 +1,13 @@ -

Übersicht

+
+ Übersicht +
Lehrlinge
-
Lehrlinge
+
Lehrlinge
@@ -31,7 +33,7 @@
Kompetenz
-
Kompetenzen
+
Kompetenzen
Name
@@ -67,7 +69,7 @@
...
-
Prüfungen
+
Prüfungen
diff --git a/src/app/kompetenz/kompetenz.component.html b/src/app/kompetenz/kompetenz.component.html index 53b5f9f..f7073a2 100644 --- a/src/app/kompetenz/kompetenz.component.html +++ b/src/app/kompetenz/kompetenz.component.html @@ -1,24 +1,70 @@ -

Kompetenzen

-
+
+ Kompetenzen +
+
+ + Filter + + + +
Prüfung
+ + + + + + + + + + + + + + +
ID {{com.competenceid}} Kompetenz {{com.competence}} Beschreibung {{com.competencedescription}}
+ +
+ +
+
 
+
Kompetenz bearbeiten
+
+ +
+
+ + ID + + + + Dauer in Halbtagen + + +
+
+ + Kompetenz + + +
+
+ + Beschreibung + + + +
+
+ + +
+
+
+
+
+
- - - - - - - - - - - - - - -
KompetenzBeschreibungHalbtageAktion
{{aktkomp.competence}}{{aktkomp.competencedescription}}{{aktkomp.dauer}} - -
diff --git a/src/app/kompetenz/kompetenz.component.ts b/src/app/kompetenz/kompetenz.component.ts index c24d11a..abb986b 100644 --- a/src/app/kompetenz/kompetenz.component.ts +++ b/src/app/kompetenz/kompetenz.component.ts @@ -1,7 +1,15 @@ -import { Component, OnInit } from '@angular/core'; +import { Component, OnInit, ViewChild } from '@angular/core'; import { KompetenzService } from '../services/kompetenz.service'; import { Observable } from 'rxjs'; import { MatSliderModule } from '@angular/material/slider'; +import { LiveAnnouncer } from '@angular/cdk/a11y'; +import { MatTableDataSource } from '@angular/material/table'; +import { MatSort, Sort } from '@angular/material/sort'; +import { MatPaginator } from '@angular/material/paginator'; +import { Kompetenz } from '../kompetenz'; +import { HttpClient, HttpHeaders } from '@angular/common/http'; +import { FormBuilder, UntypedFormBuilder, Validators } from '@angular/forms'; +import { ActivatedRoute, Router } from '@angular/router'; @Component({ selector: 'app-kompetenz', @@ -11,9 +19,31 @@ import { MatSliderModule } from '@angular/material/slider'; export class KompetenzComponent implements OnInit { public kompetenzen: any; - - constructor(private Kompetenz: KompetenzService) { - + public selection: any; + public dataSource: any; + public editForm: any; + public aktKompetenzId: any; + public aktkompetenz?: Kompetenz; + headers: HttpHeaders = new HttpHeaders() + .set('Accept', 'application/json'); + + + displayedColumns: any = ["competenceid", "competence", "competencedescription"]; + + constructor(private Kompetenz: KompetenzService, + private _liveAnnouncer: LiveAnnouncer, + private formbuilder: FormBuilder, + private router: Router, + private kompetenzservice: KompetenzService, + private activatedRoute: ActivatedRoute, + private http: HttpClient,) + { + this.editForm = this.formbuilder.group({ + competenceid: [], + competence: ['', Validators.required], + competencedescription: ['', Validators.required ], + dauer: [''] + }) } ngOnInit(): void { @@ -22,7 +52,62 @@ export class KompetenzComponent implements OnInit { ( result: any) => { this.kompetenzen = result; + this.dataSource = new MatTableDataSource(this.kompetenzen); + this.dataSource.paginator = this.paginator; + this.dataSource.sort = this.sort; }) } + @ViewChild('paginator') paginator: MatPaginator; + @ViewChild(MatSort) sort: MatSort; + + ngAfterViewInit() { + if(this.dataSource != undefined) { + this.dataSource.paginator = this.paginator; + this.dataSource.sort = this.sort; + console.log(this.dataSource); + } + else + console.log("DataSource undefined in AfterViewInit"); + + } + + applyFilter(event: Event) { + const filterValue = (event.target as HTMLInputElement).value; + this.dataSource.filter = filterValue.trim().toLowerCase(); + console.log("Filter: " + this.dataSource.filter); + } + + /** Announce the change in sort state for assistive technology. */ + announceSortChange(sortState: Sort) { + // This example uses English messages. If your application supports + // multiple language, you would internationalize these strings. + // Furthermore, you can customize the message to add additional + // details about the values being sorted. + if (sortState.direction) { + this._liveAnnouncer.announce(`Sorted ${sortState.direction}ending`); + } else { + this._liveAnnouncer.announce('Sorting cleared'); + } + } + + onclick(aktuell: Kompetenz) { + this.aktKompetenzId = aktuell.competenceid; + console.log("ausgewählt: " + aktuell.competenceid) + if (this.aktKompetenzId > 0) { + this.kompetenzservice.getSingleKompetenz(this.aktKompetenzId).subscribe(( + (data: any) => { + // console.log(data); + this.editForm.patchValue(data); + } + )) + } + } + + onEdit(): void { + + } + onCancel(): void { + this.editForm.reset(); + } } diff --git a/src/app/lehrling2beruf/lehrling2beruf.component.html b/src/app/lehrling2beruf/lehrling2beruf.component.html index 267a8ff..396f5b0 100644 --- a/src/app/lehrling2beruf/lehrling2beruf.component.html +++ b/src/app/lehrling2beruf/lehrling2beruf.component.html @@ -1,6 +1,6 @@ -
- Teilnehmer zu Ausbildung zuordnen! +
+ Teilnehmer zu Ausbildung zuordnen
diff --git a/src/app/list-lehrlinge/list-lehrlinge.component.css b/src/app/list-lehrlinge/list-lehrlinge.component.css index 9071202..a54bdc2 100644 --- a/src/app/list-lehrlinge/list-lehrlinge.component.css +++ b/src/app/list-lehrlinge/list-lehrlinge.component.css @@ -1,4 +1,18 @@ .table { width: 100%; } +.aktzeile { + color: red; + background: #472ddb; + font-weight: bold; +} +.mat-row .mat-cell { + border-bottom: 1px solid transparent; + border-top: 1px solid transparent; + cursor: pointer; +} + +.mat-row:hover .mat-cell { + border-color: currentColor; +} \ No newline at end of file diff --git a/src/app/list-lehrlinge/list-lehrlinge.component.html b/src/app/list-lehrlinge/list-lehrlinge.component.html index 574d608..0f5fa07 100644 --- a/src/app/list-lehrlinge/list-lehrlinge.component.html +++ b/src/app/list-lehrlinge/list-lehrlinge.component.html @@ -1,33 +1,109 @@ -

Lehrlinge

-
-
- -
+
+ Lehrlinge +
+
+ + Filter + + - - - - - - - - - - - - - - - - - - - - -
NameGruppeGeschlechtGeborenEintrittAustrittAktion
{{aktlehrling.firstname}} {{aktlehrling.lastname}}{{aktlehrling.groupname}}{{aktlehrling.sex}}{{aktlehrling.date_of_birth}}{{aktlehrling.date_joined}}{{aktlehrling.date_leave}}
+ + + + + + + + + + + + + + + + + + + + + + + +
ID {{user.apprenticeid}} Vorname {{user.firstname}} Name {{user.lastname}} Gruppe {{user.groupname}}
+ + +
+ +
+
Lehrling bearbeiten
+
+ +
+
+ + ID + + +
+
+ + Vorname + + + + Nachname + + +
+
+ + Geboren + + + + + Geschlecht + + +
+
+ + Eintritt + + + + + Austritt + + +
+
+
+ + +
+
+ +
+
diff --git a/src/app/list-lehrlinge/list-lehrlinge.component.ts b/src/app/list-lehrlinge/list-lehrlinge.component.ts index b436651..b2f4dcd 100644 --- a/src/app/list-lehrlinge/list-lehrlinge.component.ts +++ b/src/app/list-lehrlinge/list-lehrlinge.component.ts @@ -1,7 +1,14 @@ -import { Component, OnInit } from '@angular/core'; +import { Component, OnInit, ViewChild } from '@angular/core'; import { LehrlingService } from '../services/lehrling.service'; import { Observable } from 'rxjs'; import { Lehrling } from '../lehrling'; +import { MatTableDataSource } from '@angular/material/table'; +import { SelectionModel } from '@angular/cdk/collections'; +import { Router } from '@angular/router'; +import { UntypedFormBuilder, Validators } from '@angular/forms'; +import { LiveAnnouncer } from '@angular/cdk/a11y'; +import { MatSort, Sort } from '@angular/material/sort'; +import { MatPaginator } from '@angular/material/paginator'; @Component({ selector: 'app-list-lehrlinge', @@ -10,16 +17,90 @@ import { Lehrling } from '../lehrling'; }) export class ListLehrlingeComponent implements OnInit { + public dsLehrlinge?: MatTableDataSource; + selection = new SelectionModel(true, []); public lehrlinge: any; + public displayedColumns: any; + public editForm: any; + public aktlehrling: any; - constructor(private Lehrlinge: LehrlingService) { } + constructor(private Lehrlinge: LehrlingService, + private router: Router, + private formbuilder: UntypedFormBuilder, + private _liveAnnouncer: LiveAnnouncer,) + { + this.editForm = this.formbuilder.group({ + apprenticeid: [], + firstname: ['', Validators.required], + lastname: ['', Validators.required], + groupid: [''], + sex: [''], + date_of_birth: [''], + date_joined: [''], + date_leave: [''] + }) + } ngOnInit(): void { + this.displayedColumns = ["apprenticeid", "firstname", "lastname", "groupname"]; this.Lehrlinge.getLehrlinge().subscribe( ( data: any) => { console.log(data); this.lehrlinge = data.apprentice; + this.dsLehrlinge = this.lehrlinge; }) } + + @ViewChild('paginator') paginator: MatPaginator; + @ViewChild(MatSort) sort: MatSort; + + ngAfterViewInit() { + if(this.dsLehrlinge != undefined) { + this.dsLehrlinge.paginator = this.paginator; + this.dsLehrlinge.sort = this.sort; + // console.log(this.dsLehrlinge); + } + else + console.log("DataSource undefined in AfterViewInit"); + } + + onclick(aktlehrling: any) { + this.aktlehrling = aktlehrling; + console.log("ausgewählt: " + aktlehrling.lastname) + } + /** Selects all rows if they are not all selected; otherwise clear selection. */ + masterToggle() { + this.isAllSelected() ? + this.selection.clear() : + this.dsLehrlinge.data.forEach(row => this.selection.select(row)); + } + + /** Whether the number of selected elements matches the total number of rows. */ + isAllSelected() { + console.log(this.selection); + const numSelected = this.selection.selected.length; + const numRows = this.dsLehrlinge.data.length; + return numSelected === numRows; + } + applyFilter(event: Event) { + const filterValue = (event.target as HTMLInputElement).value; + this.dsLehrlinge.filter = filterValue.trim().toLowerCase(); + // console.log("Filter: " + this.dsLehrlinge.filter); + } + + /** Announce the change in sort state for assistive technology. */ + announceSortChange(sortState: Sort) { + if (sortState.direction) { + this._liveAnnouncer.announce(`Sorted ${sortState.direction}ending`); + } else { + this._liveAnnouncer.announce('Sorting cleared'); + } + } + onEdit(): void { + + } + onCancel(): void { + this.router.navigate(['/list-lehrling']); + } } diff --git a/src/app/modul/modul.component.html b/src/app/modul/modul.component.html index bf8790c..e3925df 100644 --- a/src/app/modul/modul.component.html +++ b/src/app/modul/modul.component.html @@ -1,8 +1,7 @@ +
+ Module +
-
-
Module
- -
Filter @@ -29,4 +28,15 @@ +
+ +
+ +
Modul bearbeiten
+
+ +
+ +
+
\ No newline at end of file diff --git a/src/app/modul/modul.component.ts b/src/app/modul/modul.component.ts index 1e5e206..2644273 100644 --- a/src/app/modul/modul.component.ts +++ b/src/app/modul/modul.component.ts @@ -32,7 +32,7 @@ export class ModulComponent implements OnInit { this.Modulservice.getModule().subscribe( ( data: any) => { - console.log(data); + // console.log(data); this.module = data.modul; this.dataSource = new MatTableDataSource(this.module); this.dataSource.paginator = this.paginator; diff --git a/src/app/notfound/notfound.component.html b/src/app/notfound/notfound.component.html index a9bfbd8..902617f 100644 --- a/src/app/notfound/notfound.component.html +++ b/src/app/notfound/notfound.component.html @@ -1,2 +1,5 @@ -

Seite wurde nicht gefunden!

+ +
+ Seite wurde nicht gefunden! +
diff --git a/src/app/prergebnis/prergebnis.component.css b/src/app/prergebnis/prergebnis.component.css index cdc60a0..13df60a 100644 --- a/src/app/prergebnis/prergebnis.component.css +++ b/src/app/prergebnis/prergebnis.component.css @@ -4,14 +4,24 @@ .row-is-clicked { color: red; - background-color: #fdf9e9; + background: #472ddb; font-weight: bold; } .mat-row.hovered { - background: #eee; + background: rgb(228, 238, 255); } .mat-row.highlighted { - background: #fdf9e9; + background: #d04b2d; + font-weight: bold; } +.radiogruppe { + vertical-align: middle; + text-align: left;; +} +.radioknopf { + vertical-align: bottom; + margin-left: 8px; + margin-top: 10px; +} \ No newline at end of file diff --git a/src/app/prergebnis/prergebnis.component.html b/src/app/prergebnis/prergebnis.component.html index 971486a..0571974 100644 --- a/src/app/prergebnis/prergebnis.component.html +++ b/src/app/prergebnis/prergebnis.component.html @@ -1,3 +1,6 @@ +
+ Prüfungsergebnisse +
@@ -24,91 +27,85 @@
-
-
- - - - - - - - - - - - - - - - - - - - - -
ID {{prue.examid}} Prüfung {{prue.examshort}} Name {{prue.examname}} Beschreibung {{prue.examdescription}}
- -
-
- - - - - - - - - - - - - - - - - - - - - -
Vorname {{pers.firstname}} Nachname {{pers.lastname}} Datum {{pers.date_of_exam}} Bestanden {{pers.acquired}} - -
- -
-
-
-

- Ausgewählt: -

- {{selection.selected | json}} +
+ + + + + + + + + + + + + + + + + + + + + +
ID {{prue.examid}} Prüfung {{prue.examshort}} Name {{prue.examname}} Beschreibung {{prue.examdescription}}
+
-
+
+ + + + + + + + + + + + + + + + + ja + nein + + + + +
Vorname {{pers.firstname}} Nachname {{pers.lastname}} Datum {{pers.date_of_exam | date:'d.M.y'}} Bestanden
+ +
+
+

+ Ausgewählte Prüfung: +

+ {{angewaehlt | json}} +
+
+

+ Ausgewähltes Ergebnis: +

+ {{ergangewaehlt | json}} +
+
+
diff --git a/src/app/prergebnis/prergebnis.component.ts b/src/app/prergebnis/prergebnis.component.ts index 11bf8a9..9580362 100644 --- a/src/app/prergebnis/prergebnis.component.ts +++ b/src/app/prergebnis/prergebnis.component.ts @@ -9,6 +9,7 @@ import { PruefungService } from '../services/pruefung.service'; import {MatSelectModule} from '@angular/material/select'; import { PruefungsergebnisService } from '../services/pruefungsergebnis.service'; import { Pruefungsergebnis } from '../Pruefungsergebnis'; +import {MatRadioModule} from '@angular/material/radio'; export enum SelectType { single, @@ -58,9 +59,9 @@ export class PrergebnisComponent implements OnInit { }) this.pruefungsergebnis.getPruefergebnisse().subscribe( ( - data: any) => { + dataerg: any) => { // console.log(data); - this.pruefergebnisse = data; + this.pruefergebnisse = dataerg; this.ergdataSource = new MatTableDataSource(this.pruefergebnisse); this.ergdataSource.ergpaginator = this.ergpaginator; this.ergdataSource.sort = this.sort; @@ -119,19 +120,22 @@ export class PrergebnisComponent implements OnInit { } onclick(pruerow: any) { this.angewaehlt = pruerow; - console.log(this.angewaehlt); + } + + onergclick(persrow: any) { + this.ergangewaehlt = persrow; } applypruefFilter(event: Event) { const filterValue = (event.target as HTMLInputElement).value; this.dataSource.filter = filterValue.trim().toLowerCase(); - console.log("Filter: " + this.dataSource.filter); + // console.log("Filter: " + this.dataSource.filter); } applypersonFilter(event: Event) { const filterValue = (event.target as HTMLInputElement).value; this.ergdataSource.filter = filterValue.trim().toLowerCase(); - console.log("Filter: " + this.ergdataSource.filter); + // console.log("Filter: " + this.ergdataSource.filter); } /** Announce the change in sort state for assistive technology. */ diff --git a/src/app/pruefung/pruefung.component.html b/src/app/pruefung/pruefung.component.html index 8607cd1..4745df9 100644 --- a/src/app/pruefung/pruefung.component.html +++ b/src/app/pruefung/pruefung.component.html @@ -1,8 +1,6 @@ -
-
-
Prüfungen
- -
+
+ Prüfungen +
Filter @@ -14,11 +12,11 @@ {{prue.examid}} - Prüfung + Prüfung {{prue.examshort}} - Name + Name {{prue.examname}} @@ -29,4 +27,3 @@ -
\ No newline at end of file diff --git a/src/app/sidebar/sidebar.component.html b/src/app/sidebar/sidebar.component.html index b52d650..c328662 100644 --- a/src/app/sidebar/sidebar.component.html +++ b/src/app/sidebar/sidebar.component.html @@ -8,54 +8,52 @@