수정 :: 새로운 대화 개설용 유저 선택 팝업 > 유저선택 처리

This commit is contained in:
leejh 2019-10-17 15:07:39 +09:00
parent 99d7440c25
commit d29ca388bf
3 changed files with 34 additions and 7 deletions

View File

@ -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

View File

@ -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>

View File

@ -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
});
}
}