main
parent
06ddb19335
commit
c2fe066c8d
|
|
@ -1,5 +1,5 @@
|
||||||
|
|
||||||
<ejs-gantt #ganttObject id="ganttDefaultSum"
|
<ejs-gantt *ngIf="data" #ganttObject id="ganttDefaultSum"
|
||||||
[dataSource]="data"
|
[dataSource]="data"
|
||||||
[includeWeekend]="true"
|
[includeWeekend]="true"
|
||||||
[resources]="resources"
|
[resources]="resources"
|
||||||
|
|
@ -46,4 +46,5 @@
|
||||||
</div>
|
</div>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
</ejs-gantt>
|
</ejs-gantt>
|
||||||
|
<h1>TESTSS</h1>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
import { DataService } from 'src/app/data.service';
|
||||||
import { Component, Input, OnInit, ViewChild } from '@angular/core';
|
import { Component, Input, OnInit, ViewChild } from '@angular/core';
|
||||||
import { GanttComponent } from '@syncfusion/ej2-angular-gantt';
|
import { GanttComponent } from '@syncfusion/ej2-angular-gantt';
|
||||||
import { MAT_DATE_FORMATS } from '@angular/material/core';
|
import { MAT_DATE_FORMATS } from '@angular/material/core';
|
||||||
|
|
@ -24,9 +25,10 @@ export class PlanTimeBarComponent implements OnInit {
|
||||||
@Input() inputData: Array<any> = [];
|
@Input() inputData: Array<any> = [];
|
||||||
@Input() splitterSettings: object;
|
@Input() splitterSettings: object;
|
||||||
@Input() parentResources: Array<any> = [];
|
@Input() parentResources: Array<any> = [];
|
||||||
|
@Input() filters: Array<any> = [];
|
||||||
@ViewChild('ganttObjectSum')
|
@ViewChild('ganttObjectSum')
|
||||||
public ganttObjectSum!: GanttComponent;
|
public ganttObjectSum!: GanttComponent;
|
||||||
public data: any[] = [];
|
public data: any[];
|
||||||
public resources: any[] = [];
|
public resources: any[] = [];
|
||||||
public userSupportGroup: string;
|
public userSupportGroup: string;
|
||||||
public taskSettings: object = {};
|
public taskSettings: object = {};
|
||||||
|
|
@ -39,13 +41,15 @@ export class PlanTimeBarComponent implements OnInit {
|
||||||
public columns: object[] = [];
|
public columns: object[] = [];
|
||||||
public toolbar: any[] = [];
|
public toolbar: any[] = [];
|
||||||
public timelineSettings: object = {};
|
public timelineSettings: object = {};
|
||||||
|
public renderTimeGantt: boolean = false;
|
||||||
|
|
||||||
constructor() {
|
public filterObj: any;
|
||||||
|
constructor(public dataService: DataService) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
|
//this.renderTimeGantt = false;
|
||||||
this.splitterSettings = this.inputData[0];
|
this.splitterSettings = this.inputData[0];
|
||||||
this.projectStartDate = this.inputData[1];
|
this.projectStartDate = this.inputData[1];
|
||||||
this.projectEndDate = this.inputData[2];
|
this.projectEndDate = this.inputData[2];
|
||||||
|
|
@ -53,21 +57,58 @@ export class PlanTimeBarComponent implements OnInit {
|
||||||
taskLabel: '${taskData.planzeit}'
|
taskLabel: '${taskData.planzeit}'
|
||||||
}
|
}
|
||||||
this.resources = [{resourceId: 1, resourceName: 'Planzeit Summen pro Woche'}];
|
this.resources = [{resourceId: 1, resourceName: 'Planzeit Summen pro Woche'}];
|
||||||
|
// this.data.push({
|
||||||
|
// TaskID: '' + 0 , TaskName: "Woche " , StartDate: new Date(), EndDate: new Date() , planzeit: 0,
|
||||||
|
// resources: [{resourceId: 1}], Progress: 0, work: 0, isRes: false
|
||||||
|
// });
|
||||||
|
|
||||||
let calendarWeeks = this.getCalendarWeeks(this.projectStartDate , this.projectEndDate);
|
if(!this.filters){
|
||||||
|
this.filterObj ={
|
||||||
|
filter: {
|
||||||
|
filterElement: [{column: "SupportGroup", filter: "equals", criteria: [this.userSupportGroup]}]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
this.filterObj ={
|
||||||
|
filter: {
|
||||||
|
filterElement: [this.filters]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// let calendarWeeks = this.getCalendarWeeks(this.projectStartDate , this.projectEndDate);
|
||||||
|
|
||||||
|
this.dataService.fetchPlanTimes( this.filterObj, this.projectStartDate, this.projectEndDate).then((res:any[])=>{
|
||||||
|
console.log(res);
|
||||||
|
let arr = [];
|
||||||
|
res.forEach((week)=>{
|
||||||
|
arr.push(
|
||||||
|
{
|
||||||
|
TaskID: '' + week.week , TaskName: "Woche " + week, StartDate: week.startDate, EndDate: week.endDate , planzeit: week.planTime,
|
||||||
|
resources: [{resourceId: this.resources[0].resourceId},], Progress: 0, work: 0, isRes: false
|
||||||
|
});
|
||||||
|
this.data = arr;
|
||||||
|
});
|
||||||
|
|
||||||
|
// this.data = [];
|
||||||
|
//this.data = arr;
|
||||||
|
// let ress = [{resourceId: 1, resourceName: 'Planzeit Summen pro Woche'}];
|
||||||
|
// this.resources = ress;
|
||||||
|
console.log(this.data);
|
||||||
|
this.renderTimeGantt = true;
|
||||||
|
});
|
||||||
|
|
||||||
// Ausgabe der Kalenderwochen
|
// Ausgabe der Kalenderwochen
|
||||||
calendarWeeks.forEach((week, index) => {
|
// calendarWeeks.forEach((week, index) => {
|
||||||
let weekNr = this.getWeekNumber(new Date(calendarWeeks[index].start.toISOString()));
|
// let weekNr = this.getWeekNumber(new Date(calendarWeeks[index].start.toISOString()));
|
||||||
let planzeit = this.getPlantimeFromResources(this.parentResources, weekNr);
|
// let planzeit = this.getPlantimeFromResources(this.parentResources, weekNr);
|
||||||
// console.log(`Kalenderwoche ${index + 1}: ${week.start} - ${week.end}`);
|
// // console.log(`Kalenderwoche ${index + 1}: ${week.start} - ${week.end}`);
|
||||||
// console.log(week);
|
// // console.log(week);
|
||||||
this.data.push(
|
// this.data.push(
|
||||||
{
|
// {
|
||||||
TaskID: '' + weekNr, index , TaskName: "Woche " + weekNr, StartDate: calendarWeeks[index].start.toISOString(), EndDate: calendarWeeks[index].end.toISOString() , planzeit: planzeit.toFixed(0),
|
// TaskID: '' + weekNr, index , TaskName: "Woche " + weekNr, StartDate: calendarWeeks[index].start.toISOString(), EndDate: calendarWeeks[index].end.toISOString() , planzeit: planzeit.toFixed(0),
|
||||||
resources: [{resourceId: this.resources[0].resourceId},], Progress: 0, work: 0, isRes: false
|
// resources: [{resourceId: this.resources[0].resourceId},], Progress: 0, work: 0, isRes: false
|
||||||
});
|
// });
|
||||||
});
|
// });
|
||||||
|
|
||||||
|
|
||||||
this.timelineSettings = {
|
this.timelineSettings = {
|
||||||
|
|
|
||||||
|
|
@ -143,6 +143,7 @@
|
||||||
[inputData]="inputForTimeline"
|
[inputData]="inputForTimeline"
|
||||||
[splitterSettings]="splitterSettings"
|
[splitterSettings]="splitterSettings"
|
||||||
[parentResources]="allResources"
|
[parentResources]="allResources"
|
||||||
|
[filters]="filters"
|
||||||
></app-plan-time-bar>
|
></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 =='DE'"><h2>Die Suche lieferte keine Ergebnisse</h2></div>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue