PlanzeitSummen/inProgress
parent
52c55419fe
commit
fdc5d18f7e
|
|
@ -34,6 +34,7 @@ import {MatIconModule} from '@angular/material/icon';
|
||||||
import { FilterDialogComponent } from './filter-dialog/filter-dialog.component';
|
import { FilterDialogComponent } from './filter-dialog/filter-dialog.component';
|
||||||
import {ScrollingModule} from '@angular/cdk/scrolling';
|
import {ScrollingModule} from '@angular/cdk/scrolling';
|
||||||
import { MomentDateModule } from '@angular/material-moment-adapter';
|
import { MomentDateModule } from '@angular/material-moment-adapter';
|
||||||
|
import { PlanTimeBarComponent } from './plan-time-bar/plan-time-bar.component';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
declarations: [
|
declarations: [
|
||||||
|
|
@ -43,7 +44,8 @@ import { MomentDateModule } from '@angular/material-moment-adapter';
|
||||||
ImplementerDialogComponent,
|
ImplementerDialogComponent,
|
||||||
FilterComponentComponent,
|
FilterComponentComponent,
|
||||||
MultiselectAutocompleteComponent,
|
MultiselectAutocompleteComponent,
|
||||||
FilterDialogComponent
|
FilterDialogComponent,
|
||||||
|
PlanTimeBarComponent
|
||||||
],
|
],
|
||||||
imports: [
|
imports: [
|
||||||
BrowserModule,
|
BrowserModule,
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,29 @@
|
||||||
|
|
||||||
|
<ejs-gantt #ganttObject id="ganttDefaultSum"
|
||||||
|
[dataSource]="data"
|
||||||
|
[resources]="resources"
|
||||||
|
[taskFields]="taskSettings"
|
||||||
|
[resourceFields]="resourceFields"
|
||||||
|
[editSettings]="editSettings"
|
||||||
|
[toolbar]="toolbar"
|
||||||
|
[labelSettings]="labelSettings"
|
||||||
|
[projectStartDate]="this.projectStartDate"
|
||||||
|
[projectEndDate]="this.projectEndDate"
|
||||||
|
[timelineSettings]="timelineSettings"
|
||||||
|
[tooltipSettings]="tooltipSettings"
|
||||||
|
[splitterSettings] = "splitterSettings"
|
||||||
|
[labelSettings]="labelSettings"
|
||||||
|
|
||||||
|
viewType="ResourceView"
|
||||||
|
[allowSelection]='true'
|
||||||
|
[allowResizing] = 'true'
|
||||||
|
[highlightWeekends] = 'true'
|
||||||
|
[treeColumnIndex]="1"
|
||||||
|
[showOverAllocation] = 'true'
|
||||||
|
[enableMultiTaskbar]= 'true'
|
||||||
|
[collapseAllParentTasks]= 'true'
|
||||||
|
[enableVirtualization]="false"
|
||||||
|
[allowSorting]= "false"
|
||||||
|
[allowFiltering]="false"
|
||||||
|
gridLines="Both"></ejs-gantt>
|
||||||
|
|
||||||
|
|
@ -0,0 +1,23 @@
|
||||||
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
|
import { PlanTimeBarComponent } from './plan-time-bar.component';
|
||||||
|
|
||||||
|
describe('PlanTimeBarComponent', () => {
|
||||||
|
let component: PlanTimeBarComponent;
|
||||||
|
let fixture: ComponentFixture<PlanTimeBarComponent>;
|
||||||
|
|
||||||
|
beforeEach(async () => {
|
||||||
|
await TestBed.configureTestingModule({
|
||||||
|
declarations: [ PlanTimeBarComponent ]
|
||||||
|
})
|
||||||
|
.compileComponents();
|
||||||
|
|
||||||
|
fixture = TestBed.createComponent(PlanTimeBarComponent);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
@ -0,0 +1,105 @@
|
||||||
|
import { Component, Input, OnInit, ViewChild } from '@angular/core';
|
||||||
|
import { GanttComponent } from '@syncfusion/ej2-angular-gantt';
|
||||||
|
import { MAT_DATE_FORMATS } from '@angular/material/core';
|
||||||
|
|
||||||
|
export const MY_DATE_FORMATS = {
|
||||||
|
parse: {
|
||||||
|
dateInput: 'DD.MM.YYYY',
|
||||||
|
},
|
||||||
|
display: {
|
||||||
|
dateInput: 'DD.MM.YYYY',
|
||||||
|
monthYearLabel: 'MMMM YYYY',
|
||||||
|
dateA11yLabel: 'LL',
|
||||||
|
monthYearA11yLabel: 'MMMM YYYY'
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-plan-time-bar',
|
||||||
|
templateUrl: './plan-time-bar.component.html',
|
||||||
|
styleUrls: ['./plan-time-bar.component.css']
|
||||||
|
})
|
||||||
|
export class PlanTimeBarComponent implements OnInit {
|
||||||
|
@Input() inputData: Array<any> = [];
|
||||||
|
@Input() splitterSettings: object;
|
||||||
|
@ViewChild('ganttObjectSum')
|
||||||
|
public ganttDefault!: GanttComponent;
|
||||||
|
public data: any[] = [];
|
||||||
|
public resources: any[] = [];
|
||||||
|
public userSupportGroup: string;
|
||||||
|
public taskSettings: object = {};
|
||||||
|
public labelSettings: object = {};
|
||||||
|
public projectStartDate: Date;
|
||||||
|
public projectEndDate: Date;
|
||||||
|
public resourceFields: object ={};
|
||||||
|
public editSettings: object = {};
|
||||||
|
public tooltipSettings: object ={};
|
||||||
|
public columns: object[] = [];
|
||||||
|
public toolbar: any[] = [];
|
||||||
|
public timelineSettings: object = {};
|
||||||
|
|
||||||
|
constructor() { }
|
||||||
|
|
||||||
|
ngOnInit(): void {
|
||||||
|
this.splitterSettings = this.inputData[0];
|
||||||
|
this.projectStartDate = this.inputData[1];
|
||||||
|
this.projectEndDate = this.inputData[2];
|
||||||
|
this.labelSettings = {
|
||||||
|
taskLabel: '${taskData.planzeit} H'
|
||||||
|
}
|
||||||
|
|
||||||
|
this.resources = [{resourceId: 1, resourceName: 'Planzeit Summen pro Woche'}];
|
||||||
|
|
||||||
|
this.data.push(
|
||||||
|
{
|
||||||
|
TaskID: '01', TaskName: "Woche 1", StartDate: new Date ('01.02.2023'), Duration: 7, planzeit: 1,
|
||||||
|
resources: [{resourceId: this.resources[0].resourceId},], Progress: 0, work: 0, isRes: false
|
||||||
|
});
|
||||||
|
|
||||||
|
this.data.push(
|
||||||
|
{
|
||||||
|
TaskID: '02', TaskName: "Woche 2", StartDate: new Date ('01.10.2023'), Duration: 7, planzeit: 4,
|
||||||
|
resources: [{resourceId: this.resources[0].resourceId},], Progress: 0, work: 0, isRes: false
|
||||||
|
});
|
||||||
|
this.data.push(
|
||||||
|
{
|
||||||
|
TaskID: '03', TaskName: "Woche 3", StartDate: new Date ('01.18.2023'), Duration: 7, planzeit: 7,
|
||||||
|
resources: [{resourceId: this.resources[0].resourceId},], Progress: 0, work: 0, isRes: false
|
||||||
|
});
|
||||||
|
|
||||||
|
this.data.push(
|
||||||
|
{
|
||||||
|
TaskID: '04', TaskName: "Woche 4", StartDate: new Date ('01.26.2023'), Duration: 7, planzeit: 11,
|
||||||
|
resources: [{resourceId: this.resources[0].resourceId},], Progress: 0, work: 0, isRes: false
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
this.timelineSettings = {
|
||||||
|
bottomTier: {
|
||||||
|
format: 'WW',
|
||||||
|
unit: 'Week',
|
||||||
|
count: 1
|
||||||
|
}
|
||||||
|
};
|
||||||
|
this.taskSettings = {
|
||||||
|
id: 'TaskID',
|
||||||
|
name: 'TaskName',
|
||||||
|
startDate: 'StartDate',
|
||||||
|
endDate: 'EndDate',
|
||||||
|
duration: 'Duration',
|
||||||
|
progress: 'Progress',
|
||||||
|
dependency: 'Predecessor',
|
||||||
|
resourceInfo: 'resources',
|
||||||
|
work: 'work',
|
||||||
|
expandState: 'isExpand',
|
||||||
|
child: 'subtasks',
|
||||||
|
planzeit: 'planzeit'
|
||||||
|
};
|
||||||
|
this.resourceFields = {
|
||||||
|
id: 'resourceId',
|
||||||
|
name: 'resourceName',
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -63,7 +63,7 @@
|
||||||
<ejs-gantt *ngIf="renderGantt" #ganttObject id="ganttDefault"
|
<ejs-gantt *ngIf="renderGantt" #ganttObject id="ganttDefault"
|
||||||
[ngStyle]="{'visibility':spin ? 'hidden' : 'visible'}"
|
[ngStyle]="{'visibility':spin ? 'hidden' : 'visible'}"
|
||||||
[dataSource]="data"
|
[dataSource]="data"
|
||||||
[allowSorting]= 'true'
|
[allowSorting] = 'true'
|
||||||
[resources]="resources"
|
[resources]="resources"
|
||||||
[taskFields]="taskSettings"
|
[taskFields]="taskSettings"
|
||||||
[resourceFields]="resourceFields"
|
[resourceFields]="resourceFields"
|
||||||
|
|
@ -94,7 +94,6 @@
|
||||||
(taskbarEditing)="taskbarEditing($event)"
|
(taskbarEditing)="taskbarEditing($event)"
|
||||||
(taskbarEdited)="taskbarEdited($event)"
|
(taskbarEdited)="taskbarEdited($event)"
|
||||||
(toolbarClick)="toolbarBtnClicked($event)"
|
(toolbarClick)="toolbarBtnClicked($event)"
|
||||||
(rowSelecting) = "rowSelecting($event)"
|
|
||||||
(rowSelected) = "rowSelected($event)"
|
(rowSelected) = "rowSelected($event)"
|
||||||
(rowDeselected) = "rowDeselected($event)"
|
(rowDeselected) = "rowDeselected($event)"
|
||||||
(created)="created($event)"
|
(created)="created($event)"
|
||||||
|
|
@ -139,7 +138,10 @@
|
||||||
</div>
|
</div>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
</ejs-gantt>
|
</ejs-gantt>
|
||||||
|
<app-plan-time-bar
|
||||||
|
[inputData]="inputForTimeline"
|
||||||
|
[splitterSettings]="splitterSettings"
|
||||||
|
></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>
|
||||||
<div *ngIf="this.showNoResultsError && this.language =='EN'"><h2>The search did not return any results</h2></div>
|
<div *ngIf="this.showNoResultsError && this.language =='EN'"><h2>The search did not return any results</h2></div>
|
||||||
<!-- [filterSettings]="filterSettings" -->
|
<!-- [filterSettings]="filterSettings" -->
|
||||||
|
|
|
||||||
|
|
@ -77,6 +77,7 @@ export class NttGanttComponent implements OnInit {
|
||||||
public language: string = 'DE';
|
public language: string = 'DE';
|
||||||
public horizontalPosition: MatSnackBarHorizontalPosition = 'end';
|
public horizontalPosition: MatSnackBarHorizontalPosition = 'end';
|
||||||
public verticalPosition: MatSnackBarVerticalPosition = 'bottom';
|
public verticalPosition: MatSnackBarVerticalPosition = 'bottom';
|
||||||
|
public inputForTimeline = [];
|
||||||
|
|
||||||
public deMap : Map<string, string> = new Map<string, string>()
|
public deMap : Map<string, string> = new Map<string, string>()
|
||||||
public enMap : Map<string, string> = new Map<string, string>()
|
public enMap : Map<string, string> = new Map<string, string>()
|
||||||
|
|
@ -359,14 +360,20 @@ public logg(args){
|
||||||
this.tooltipSettings = {
|
this.tooltipSettings = {
|
||||||
showTooltip: true,
|
showTooltip: true,
|
||||||
}
|
}
|
||||||
this.splitterSettings = {
|
|
||||||
columnIndex:3
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
this.projectStartDate = this.range.controls.start.value;
|
this.projectStartDate = this.range.controls.start.value;
|
||||||
this.projectEndDate = this.range.controls.end.value;
|
this.projectEndDate = this.range.controls.end.value;
|
||||||
|
|
||||||
|
this.splitterSettings = {
|
||||||
|
columnIndex:3
|
||||||
|
};
|
||||||
|
|
||||||
|
this.splitterSettings = {
|
||||||
|
position: 647+'px'
|
||||||
|
};
|
||||||
|
|
||||||
|
this.inputForTimeline = [this.splitterSettings, this.projectStartDate, this.projectEndDate];
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -527,8 +534,8 @@ public logg(args){
|
||||||
this.data.push(task);
|
this.data.push(task);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
console.log(this.resources[this.resources.length-1]);
|
// console.log(this.resources[this.resources.length-1]);
|
||||||
this.resources.push({resourceId: 'Timeline', resourceName: 'Planzeit Summen pro Woche'})
|
// this.resources.push({resourceId: 'Timeline', resourceName: 'Planzeit Summen pro Woche'})
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -600,29 +607,29 @@ public logg(args){
|
||||||
this.projectEndDate = new Date(this.range.controls.end.value);
|
this.projectEndDate = new Date(this.range.controls.end.value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public rowSelecting(args: any){
|
// public rowSelecting(args: any){
|
||||||
console.log(args)
|
// console.log(args)
|
||||||
if(args.data.length){
|
// if(args.data.length){
|
||||||
// if((args.data.length == this.resources.length+1)){
|
// // if((args.data.length == this.resources.length+1)){
|
||||||
// console.log("all")
|
// // console.log("all")
|
||||||
// }else{
|
// // }else{
|
||||||
// if(args.data[args.data.length-1].TaskID == 'Timeline'){
|
// // if(args.data[args.data.length-1].TaskID == 'Timeline'){
|
||||||
// args.cancel = true;
|
// // args.cancel = true;
|
||||||
// }
|
// // }
|
||||||
// }
|
// // }
|
||||||
if(args.data[args.data.length-1].TaskID == 'Timeline'){
|
// if(args.data[args.data.length-1].TaskID == 'Timeline'){
|
||||||
let data = args.data;
|
// let data = args.data;
|
||||||
data.pop();
|
// data.pop();
|
||||||
args.data = data;
|
// args.data = data;
|
||||||
}
|
// }
|
||||||
|
|
||||||
}else{
|
// }else{
|
||||||
if(args.data.TaskID == 'Timeline'){
|
// if(args.data.TaskID == 'Timeline'){
|
||||||
args.cancel = true;
|
// args.cancel = true;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
}
|
// }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The function rowSelected catches the corresponding syncfsuions event and checks if all selected resources (changes) have the same status, then it displays the corresponding buttons
|
* The function rowSelected catches the corresponding syncfsuions event and checks if all selected resources (changes) have the same status, then it displays the corresponding buttons
|
||||||
|
|
@ -1160,6 +1167,7 @@ private oldFilters:{};
|
||||||
this.refreshData();
|
this.refreshData();
|
||||||
}
|
}
|
||||||
public onResizing(args){
|
public onResizing(args){
|
||||||
|
|
||||||
let width ='' + args.paneSize[0]+'px';
|
let width ='' + args.paneSize[0]+'px';
|
||||||
this.splitterSettings = {
|
this.splitterSettings = {
|
||||||
position: width
|
position: width
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue