cdk-virtual-scroll-viewport is removed

This commit is contained in:
richard-loafle 2020-01-30 17:46:32 +09:00
parent 787cac6359
commit f8c717551e
2 changed files with 10 additions and 12 deletions

View File

@ -62,14 +62,14 @@
</div> </div>
</div> </div>
<div *ngIf="!isShowSearch" class="search-list"> <div *ngIf="!isShowSearch" class="search-list">
<cdk-virtual-scroll-viewport <virtual-scroller
itemSize="60" #vsDeptUser
#cvsvDeptUser [items]="selectedDepartmentUserInfoList"
perfectScrollbar perfectScrollbar
fxFlexFill fxFlexFill
> >
<ucap-profile-user-list-item <ucap-profile-user-list-item
*cdkVirtualFor="let userInfo of selectedDepartmentUserInfoList" *ngFor="let userInfo of vsDeptUser.viewPortItems"
[userInfo]="userInfo" [userInfo]="userInfo"
[sessionVerinfo]="sessionVerinfo" [sessionVerinfo]="sessionVerinfo"
[selectedUserList]="selectedUserList" [selectedUserList]="selectedUserList"
@ -85,7 +85,7 @@
matTooltipPosition="after" matTooltipPosition="after"
> >
</ucap-profile-user-list-item> </ucap-profile-user-list-item>
</cdk-virtual-scroll-viewport> </virtual-scroller>
</div> </div>
<div *ngIf="isShowSearch" class="search-result"> <div *ngIf="isShowSearch" class="search-result">
<virtual-scroller <virtual-scroller
@ -95,7 +95,6 @@
fxFlexFill fxFlexFill
> >
<ucap-profile-user-list-item <ucap-profile-user-list-item
style="height: 60px;"
*ngFor="let userInfo of vsDeptSearchUser.viewPortItems" *ngFor="let userInfo of vsDeptSearchUser.viewPortItems"
[userInfo]="userInfo" [userInfo]="userInfo"
[checkable]="userInfo.seq !== loginRes.userSeq" [checkable]="userInfo.seq !== loginRes.userSeq"

View File

@ -119,8 +119,8 @@ export class OrganizationComponent
@Output() @Output()
sendSms = new EventEmitter<string>(); sendSms = new EventEmitter<string>();
@ViewChild('cvsvDeptUser', { static: false }) @ViewChild('vsDeptUser', { static: false })
cvsvDeptUser: CdkVirtualScrollViewport; private vsDeptUser: VirtualScrollerComponent;
@ViewChild('vsDeptSearchUser', { static: false }) @ViewChild('vsDeptSearchUser', { static: false })
private vsDeptSearchUser: VirtualScrollerComponent; private vsDeptSearchUser: VirtualScrollerComponent;
@ -206,8 +206,8 @@ export class OrganizationComponent
this.selectedDepartmentUserInfoList = list; this.selectedDepartmentUserInfoList = list;
}), }),
tap(() => { tap(() => {
if (!!this.cvsvDeptUser) { if (!!this.vsDeptUser) {
this.cvsvDeptUser.scrollToOffset(0); this.vsDeptUser.scrollToIndex(0);
} }
if (!!this.psDirectiveRef) { if (!!this.psDirectiveRef) {
this.psDirectiveRef.update(); this.psDirectiveRef.update();
@ -252,14 +252,13 @@ export class OrganizationComponent
ngAfterViewChecked(): void { ngAfterViewChecked(): void {
if ( if (
!!this.cvsvDeptUser && !!this.vsDeptUser &&
!!this.selectedDepartmentUserInfoList && !!this.selectedDepartmentUserInfoList &&
this.selectedDepartmentUserInfoList.length > 0 && this.selectedDepartmentUserInfoList.length > 0 &&
!this.isInitList && !this.isInitList &&
this.isVisible this.isVisible
) { ) {
this.isInitList = true; this.isInitList = true;
this.cvsvDeptUser.checkViewportSize();
} }
} }