PlanzeitSummen/Done

main
manueltauber 2023-06-14 12:28:52 +02:00
parent 262eab4e68
commit f622e91c5a
5 changed files with 44 additions and 16 deletions

View File

@ -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))
});

View File

@ -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"></ejs-gantt>
(queryTaskbarInfo)="queryTaskbarInfo($event)"
gridLines="Both">
<ng-template #tooltipSettingsTaskbar let-data>
<div>
<table>
<ng-container>
<tr>
<td style="padding:3px"> Planzeit: {{data.taskData.planzeit}}</td>
</tr>
</ng-container>
</table>
</div>
</ng-template>
</ejs-gantt>

View File

@ -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";
}
}

View File

@ -138,11 +138,13 @@
</div>
</ng-template>
</ejs-gantt>
<app-plan-time-bar
<app-plan-time-bar *ngIf="renderGantt"
[inputData]="inputForTimeline"
[splitterSettings]="splitterSettings"
[parentResources]="resources"
[parentResources]="allResources"
></app-plan-time-bar>
<div *ngIf="this.showNoResultsError && this.language =='DE'"><h2>Die Suche lieferte keine Ergebnisse</h2></div>
<div *ngIf="this.showNoResultsError && this.language =='EN'"><h2>The search did not return any results</h2></div>
<!-- [filterSettings]="filterSettings" -->

View File

@ -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<string, string> = new Map<string, string>()
public enMap : Map<string, string> = new Map<string, string>()
@ -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){