-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5849ddb
commit 1aaedf2
Showing
67 changed files
with
2,561 additions
and
902 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<div style="line-height: 30px; padding: 15px; display: flex"> | ||
<div style="flex: 1"> | ||
<span class="text-primary">NgxGantt</span> | ||
默认开启了虚拟滚动功能,如需关闭该功能设置 virtualScrollEnabled 参数为 false 即可。 | ||
</div> | ||
</div> | ||
<thy-layout> | ||
<thy-content> | ||
<ngx-gantt #gantt [items]="items" virtualScrollEnabled="true"> | ||
<ngx-gantt-table> | ||
<ngx-gantt-column name="标题" width="180px"> | ||
<ng-template #cell let-item="item"> {{ item.title }} </ng-template> | ||
</ngx-gantt-column> | ||
<ngx-gantt-column name="开始时间" [class.start-time]="true" [width]="140"> | ||
<ng-template #cell let-item="item"> | ||
{{ item.start * 1000 | date : 'yyyy-MM-dd' }} | ||
</ng-template> | ||
</ngx-gantt-column> | ||
<ngx-gantt-column name="截止时间"> | ||
<ng-template #cell let-item="item"> | ||
{{ item.end * 1000 | date : 'yyyy-MM-dd' }} | ||
</ng-template> | ||
</ngx-gantt-column> | ||
</ngx-gantt-table> | ||
|
||
<ng-template #bar let-item="item"> | ||
<span style="color: #fff"> {{ item.title }} </span> | ||
</ng-template> | ||
</ngx-gantt> | ||
</thy-content> | ||
</thy-layout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { Component, OnInit, HostBinding, ViewChild, AfterViewInit } from '@angular/core'; | ||
import { GanttItem, GanttPrintService, NgxGanttComponent } from 'ngx-gantt'; | ||
import { randomItems, random } from '../helper'; | ||
|
||
@Component({ | ||
selector: 'app-gantt-virtual-scroll-example', | ||
templateUrl: './gantt.component.html', | ||
providers: [GanttPrintService] | ||
}) | ||
export class AppGanttVirtualScrollExampleComponent implements OnInit, AfterViewInit { | ||
items: GanttItem[] = randomItems(10000); | ||
|
||
@HostBinding('class.gantt-example-component') class = true; | ||
|
||
@ViewChild('gantt') ganttComponent: NgxGanttComponent; | ||
|
||
constructor() {} | ||
|
||
ngOnInit(): void { | ||
// init items children | ||
this.items.forEach((item, index) => { | ||
if (index % 5 === 0) { | ||
item.children = randomItems(random(1, 5), item); | ||
} | ||
}); | ||
} | ||
|
||
ngAfterViewInit() { | ||
setTimeout(() => this.ganttComponent.scrollToDate(1627729997), 200); | ||
} | ||
} |
Oops, something went wrong.