수정 :: 새로운 대화 개설용 유저 선택 팝업 > 유저선택 처리
This commit is contained in:
parent
99d7440c25
commit
d29ca388bf
|
@ -197,15 +197,39 @@ export class CreateChatDialogComponent implements OnInit, OnDestroy {
|
|||
);
|
||||
}
|
||||
|
||||
onCheckGroup(params: { isChecked: boolean; group: GroupDetailData }) {
|
||||
this.logger.debug(params);
|
||||
onCheckGroup(params: {
|
||||
isChecked: boolean;
|
||||
groupBuddyList: { group: GroupDetailData; buddyList: UserInfo[] };
|
||||
}) {
|
||||
if (params.isChecked) {
|
||||
params.groupBuddyList.buddyList.forEach(item => {
|
||||
if (
|
||||
this.selectedUserList.filter(user => user.seq === item.seq).length ===
|
||||
0
|
||||
) {
|
||||
this.selectedUserList.push(item);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.selectedUserList = this.selectedUserList.filter(
|
||||
item =>
|
||||
params.groupBuddyList.buddyList.filter(del => del.seq === item.seq)
|
||||
.length === 0
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
onCheckUser(params: {
|
||||
isChecked: boolean;
|
||||
userInfo: UserInfo | UserInfoSS | UserInfoF | UserInfoDN;
|
||||
}) {
|
||||
if (params.isChecked) {
|
||||
if (
|
||||
this.selectedUserList.filter(user => user.seq === params.userInfo.seq)
|
||||
.length === 0
|
||||
) {
|
||||
this.selectedUserList.push(params.userInfo);
|
||||
}
|
||||
} else {
|
||||
this.selectedUserList = this.selectedUserList.filter(
|
||||
item => item.seq !== params.userInfo.seq
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
(click)="onClickMore($event, groupBuddy.group)">
|
||||
<mat-icon>more_vert</mat-icon>
|
||||
</button>
|
||||
<mat-checkbox *ngIf="checkable" #checkbox (change)="onChangeCheck(checkbox.checked, groupBuddy.group)"
|
||||
<mat-checkbox *ngIf="checkable" #checkbox (change)="onChangeCheck(checkbox.checked, groupBuddy)"
|
||||
(click)="$event.stopPropagation()"></mat-checkbox>
|
||||
</mat-panel-description>
|
||||
</mat-expansion-panel-header>
|
||||
|
|
|
@ -40,7 +40,7 @@ export class ExpansionPanelComponent implements OnInit {
|
|||
@Output()
|
||||
checkGroup = new EventEmitter<{
|
||||
isChecked: boolean;
|
||||
group: GroupDetailData;
|
||||
groupBuddyList: { group: GroupDetailData; buddyList: UserInfo[] };
|
||||
}>();
|
||||
|
||||
@ContentChild(ExpansionPanelItemDirective, {
|
||||
|
@ -67,10 +67,13 @@ export class ExpansionPanelComponent implements OnInit {
|
|||
this.more.emit({ event, group });
|
||||
}
|
||||
|
||||
onChangeCheck(value: boolean, group: GroupDetailData) {
|
||||
onChangeCheck(
|
||||
value: boolean,
|
||||
groupBuddyList: { group: GroupDetailData; buddyList: UserInfo[] }
|
||||
) {
|
||||
this.checkGroup.emit({
|
||||
isChecked: value,
|
||||
group
|
||||
groupBuddyList
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user