From f622e91c5a3146ad5b398484c28071d8d12e62d6 Mon Sep 17 00:00:00 2001 From: manueltauber Date: Wed, 14 Jun 2023 12:28:52 +0200 Subject: [PATCH] PlanzeitSummen/Done --- frontend/src/app/data.service.ts | 3 +-- .../plan-time-bar.component.html | 22 ++++++++++++++++--- .../plan-time-bar/plan-time-bar.component.ts | 19 ++++++++++------ .../src/ntt-gantt/ntt-gantt.component.html | 6 +++-- frontend/src/ntt-gantt/ntt-gantt.component.ts | 10 +++++++-- 5 files changed, 44 insertions(+), 16 deletions(-) diff --git a/frontend/src/app/data.service.ts b/frontend/src/app/data.service.ts index 26a05df..065a126 100644 --- a/frontend/src/app/data.service.ts +++ b/frontend/src/app/data.service.ts @@ -255,7 +255,6 @@ export class DataService { //console.log(response); this.totalSize = response.totalSize; response.changes.forEach(resp=>{ - //console.log(resp.resourceId+" "+resp.approvalStatus) let tasks : any[] = []; @@ -322,7 +321,7 @@ export class DataService { changeImplementerLogin: resp.changeImplementerLogin, packageName: resp.packageName, coordinatorSg: resp.coordinatorSg, - planTime: 1, + plantime: resp.planTime, calenderWeek: this.getWeekNumber(new Date(resp.d2)) }); diff --git a/frontend/src/app/plan-time-bar/plan-time-bar.component.html b/frontend/src/app/plan-time-bar/plan-time-bar.component.html index 67583bb..db41c0f 100644 --- a/frontend/src/app/plan-time-bar/plan-time-bar.component.html +++ b/frontend/src/app/plan-time-bar/plan-time-bar.component.html @@ -16,9 +16,10 @@ [labelSettings]="labelSettings" viewType="ResourceView" - [allowSelection]='true' + [columns]="columns" + [allowSelection]='false' [allowResizing] = 'true' - [highlightWeekends] = 'true' + [highlightWeekends] = 'false' [treeColumnIndex]="1" [showOverAllocation] = 'true' [enableMultiTaskbar]= 'true' @@ -26,5 +27,20 @@ [enableVirtualization]="false" [allowSorting]= "false" [allowFiltering]="false" - gridLines="Both"> + + (queryTaskbarInfo)="queryTaskbarInfo($event)" + gridLines="Both"> + + +
+ + + + + + +
Planzeit: {{data.taskData.planzeit}}
+
+
+ diff --git a/frontend/src/app/plan-time-bar/plan-time-bar.component.ts b/frontend/src/app/plan-time-bar/plan-time-bar.component.ts index a51fdaf..22fca6e 100644 --- a/frontend/src/app/plan-time-bar/plan-time-bar.component.ts +++ b/frontend/src/app/plan-time-bar/plan-time-bar.component.ts @@ -54,12 +54,10 @@ export class PlanTimeBarComponent implements OnInit { } this.resources = [{resourceId: 1, resourceName: 'Planzeit Summen pro Woche'}]; - console.log(this.parentResources); let calendarWeeks = this.getCalendarWeeks(this.projectStartDate , this.projectEndDate); // Ausgabe der Kalenderwochen calendarWeeks.forEach((week, index) => { - let weekNr = this.getWeekNumber(new Date(calendarWeeks[index].start.toISOString())); let planzeit = this.getPlantimeFromResources(this.parentResources, weekNr); //console.log(`Kalenderwoche ${index + 1}: ${week.start} - ${week.end}`); @@ -71,8 +69,6 @@ export class PlanTimeBarComponent implements OnInit { }); - - this.timelineSettings = { bottomTier: { format: 'WW', @@ -98,13 +94,18 @@ export class PlanTimeBarComponent implements OnInit { id: 'resourceId', name: 'resourceName', }; + + this.columns = [ + { field: 'TaskName', headerText: 'Planzeit pro Woche', width: 250 }, + ] } getPlantimeFromResources(resources: any[], week: string){ let planzeit = 0; for (const res of resources) { - console.log(res); if(res.calenderWeek == week){ + // console.log(res.plantime); + // console.log(res.plantime); planzeit+= res.plantime; } @@ -141,10 +142,14 @@ getCalendarWeeks(startDate: Date, endDate: Date): { start: Date, end: Date }[] { currentDate = currentDate.add(7, 'days'); } - return weeks; } - + public queryTaskbarInfo(args: any) { + // console.log(args); + args.taskbarBgColor = "white"; + args.taskbarBorderColor = "white"; + args.taskLabelColor = "black"; + } } diff --git a/frontend/src/ntt-gantt/ntt-gantt.component.html b/frontend/src/ntt-gantt/ntt-gantt.component.html index bf9db30..cbdf5d8 100644 --- a/frontend/src/ntt-gantt/ntt-gantt.component.html +++ b/frontend/src/ntt-gantt/ntt-gantt.component.html @@ -138,11 +138,13 @@ - +

Die Suche lieferte keine Ergebnisse

The search did not return any results

diff --git a/frontend/src/ntt-gantt/ntt-gantt.component.ts b/frontend/src/ntt-gantt/ntt-gantt.component.ts index 584239e..3e9cf80 100644 --- a/frontend/src/ntt-gantt/ntt-gantt.component.ts +++ b/frontend/src/ntt-gantt/ntt-gantt.component.ts @@ -78,6 +78,7 @@ export class NttGanttComponent implements OnInit { public horizontalPosition: MatSnackBarHorizontalPosition = 'end'; public verticalPosition: MatSnackBarVerticalPosition = 'bottom'; public inputForTimeline = []; + public renderplanTime: boolean = false; public deMap : Map = new Map() public enMap : Map = new Map() @@ -461,7 +462,7 @@ public logg(args){ return resource.resourceId == args.data.taskData.resources[0].resourceId; }); this.dataService.updateDatePerChange(found); - + this.refreshData(); } } @@ -596,6 +597,7 @@ public logg(args){ * @param startDate new startDate from date-range-picker */ public startDateChanged(startDate: any){ + this.renderplanTime = false; } /** @@ -606,8 +608,10 @@ public logg(args){ if(this.range.status == 'VALID' && this.range.controls.start.value && this.range.controls.end.value){ //event for Requesting new Records based on the Dates this.projectStartDate = new Date(this.range.controls.start.value); this.projectEndDate = new Date(this.range.controls.end.value); + this.renderplanTime = true; } } + // public rowSelecting(args: any){ // console.log(args) // if(args.data.length){ @@ -1016,10 +1020,12 @@ public logg(args){ this.spin = true; this.renderGantt = true; this.showNoResultsError = false; + this.renderplanTime = true; }else{ this.renderGantt = false; this.spin = false; this.showNoResultsError = true; + this.renderplanTime = false; } }); @@ -1175,7 +1181,7 @@ private oldFilters:{}; }; } public actionBegin(args: any) { - console.log(args); //custom Action + //console.log(args); //custom Action if(args.dialogModel){ args.cancel = true; if(args.rowData.taskData.resources[0].state == 0){