diff --git a/projects/ucap-webmessenger-ui-organization/src/lib/components/detail-table.component.ts b/projects/ucap-webmessenger-ui-organization/src/lib/components/detail-table.component.ts index ed5ff0b3..3e5648b4 100644 --- a/projects/ucap-webmessenger-ui-organization/src/lib/components/detail-table.component.ts +++ b/projects/ucap-webmessenger-ui-organization/src/lib/components/detail-table.component.ts @@ -14,8 +14,12 @@ import { Sort } from '@angular/material/sort'; styleUrls: ['./detail-table.component.scss'] }) export class DetailTableComponent implements OnInit { - @Input() - selectedDepartmentUserInfoList: UserInfoSS[] = []; + @Input('selectedDepartmentUserInfoList') + set userInfoListIn(userInfo: UserInfoSS[]) { + this.selectedDepartmentUserInfoList = userInfo; + this.sortedData = userInfo; + } + @Input() presence: StatusBulkInfo[]; @Input() @@ -25,7 +29,20 @@ export class DetailTableComponent implements OnInit { @Output() openProfile = new EventEmitter(); + @Output() + checkUser = new EventEmitter<{ + isChecked: boolean; + userInfo: UserInfoSS; + }>(); + @Output() + toggleUser = new EventEmitter(); + @Output() + checkAllUser = new EventEmitter<{ + isChecked: boolean; + userInfos: UserInfoSS[]; + }>(); + selectedDepartmentUserInfoList: UserInfoSS[]; sortedData: UserInfoSS[] = []; PresenceType = PresenceType; @@ -40,9 +57,7 @@ export class DetailTableComponent implements OnInit { constructor(private logger: NGXLogger) {} - ngOnInit() { - this.sortedData = this.selectedDepartmentUserInfoList; - } + ngOnInit() {} getPresence(userInfo: UserInfoSS, type: PresenceType): string { const presences = this.presence.filter(p => p.userSeq === userInfo.seq); @@ -143,7 +158,6 @@ export class DetailTableComponent implements OnInit { } sortData(sort: Sort) { - console.log(sort); const data = this.selectedDepartmentUserInfoList.slice(); if (!sort.active || sort.direction === '') { this.sortedData = data;