From 187efa67ab66b0ef51692d7a8313455d4526dbb1 Mon Sep 17 00:00:00 2001 From: leejinho Date: Wed, 27 Nov 2019 14:39:43 +0900 Subject: [PATCH] =?UTF-8?q?[20=20=EC=A0=84=EB=8B=AC=20=ED=83=AD=20?= =?UTF-8?q?=EC=82=AC=EC=9A=A9=EC=9E=90=20=EC=84=A0=ED=83=9D=20=ED=86=B5?= =?UTF-8?q?=EC=9D=BC=EC=84=B1=20=EC=97=86=EC=9D=8C]=20=EC=9D=B4=EC=8A=88?= =?UTF-8?q?=EC=B2=98=EB=A6=AC.=20=EC=9D=B4=EB=B2=A4=ED=8A=B8=20=EA=BC=AC?= =?UTF-8?q?=EC=9D=B4=EB=8A=94=20=EB=AC=B8=EC=A0=9C=20=EC=88=98=EC=A0=95=20?= =?UTF-8?q?=EB=B0=8F=20=EB=8C=80=ED=99=94=EB=B0=A9=20=EB=A6=AC=EC=8A=A4?= =?UTF-8?q?=ED=8A=B8=20=ED=81=B4=EB=A6=AD=EC=8B=9C=20=EC=B2=B4=ED=81=AC?= =?UTF-8?q?=EB=B0=95=EC=8A=A4=20=ED=86=A0=EA=B8=80=EB=90=98=EB=8F=84?= =?UTF-8?q?=EB=A1=9D=20=EC=88=98=EC=A0=95.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chat/create-chat.dialog.component.html | 3 ++- .../chat/create-chat.dialog.component.ts | 22 +++++++++++++++---- .../components/user-list-item.component.html | 2 +- .../components/user-list-item.component.ts | 8 ------- 4 files changed, 21 insertions(+), 14 deletions(-) diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/chat/create-chat.dialog.component.html b/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/chat/create-chat.dialog.component.html index cb93dc2e..97e3c1ac 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/chat/create-chat.dialog.component.html +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/chat/create-chat.dialog.component.html @@ -82,7 +82,7 @@ [selectedUserList]="selectedUserList" [isChecked]="getCheckedUser(userInfo)" [checkable]="true" - [inTree]="true" + (checkUser)="onCheckUser($event)" (click)="onToggleUser(userInfo)" class="list-item-frame" > @@ -155,6 +155,7 @@ [isChecked]="getCheckedRoom(room)" [multiCheckable]="false" (checkRoom)="onCheckRoom($event)" + (click)="onToggleRoom(room)" > diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/chat/create-chat.dialog.component.ts b/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/chat/create-chat.dialog.component.ts index ac6813b1..51b0db01 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/chat/create-chat.dialog.component.ts +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/chat/create-chat.dialog.component.ts @@ -4,7 +4,8 @@ import { OnInit, OnDestroy, Inject, - EventEmitter + EventEmitter, + ChangeDetectorRef } from '@angular/core'; import { FormGroup, FormBuilder, Validators } from '@angular/forms'; import { @@ -103,7 +104,8 @@ export class CreateChatDialogComponent implements OnInit, OnDestroy { private queryProtocolService: QueryProtocolService, private formBuilder: FormBuilder, private logger: NGXLogger, - private dialogService: DialogService + private dialogService: DialogService, + private changeDetectorRef: ChangeDetectorRef ) { this.sessionVerinfo = this.sessionStorageService.get( KEY_VER_INFO @@ -380,6 +382,7 @@ export class CreateChatDialogComponent implements OnInit, OnDestroy { .length === 0 ); } + this.changeDetectorRef.detectChanges(); } /** 조직도 > 부서원 전체 선택 */ @@ -421,7 +424,7 @@ export class CreateChatDialogComponent implements OnInit, OnDestroy { item => item.seq !== params.userInfo.seq ); } - console.log(this.selectedUserList); + this.changeDetectorRef.detectChanges(); } onToggleUser(userInfo: UserInfo | UserInfoSS | UserInfoF | UserInfoDN) { if ( @@ -436,7 +439,7 @@ export class CreateChatDialogComponent implements OnInit, OnDestroy { } } - /** 대화방 > 대화방 선택 :: 해당 팝업에서는 대화방을 중복 선택하지 않는다 */ + /** 대화방 > 대화방 선택 */ onCheckRoom(params: { isChecked: boolean; roomInfo: RoomInfo }) { if (params.isChecked) { this.selectedRoom = params.roomInfo; @@ -444,6 +447,17 @@ export class CreateChatDialogComponent implements OnInit, OnDestroy { this.selectedRoom = null; } } + onToggleRoom(roomInfo: RoomInfo) { + if (!!this.selectedRoom) { + if (this.selectedRoom.roomSeq === roomInfo.roomSeq) { + this.selectedRoom = null; + } else { + this.selectedRoom = roomInfo; + } + } else { + this.selectedRoom = roomInfo; + } + } /** 그룹>부서원 리스트의 ischecked 를 판단. */ getCheckedUser(userInfo: UserInfo | UserInfoSS | UserInfoF | UserInfoDN) { diff --git a/projects/ucap-webmessenger-ui-profile/src/lib/components/user-list-item.component.html b/projects/ucap-webmessenger-ui-profile/src/lib/components/user-list-item.component.html index 82926569..d68dcd83 100644 --- a/projects/ucap-webmessenger-ui-profile/src/lib/components/user-list-item.component.html +++ b/projects/ucap-webmessenger-ui-profile/src/lib/components/user-list-item.component.html @@ -37,7 +37,7 @@ #checkbox [checked]="isChecked" (change)="onChangeCheck(checkbox.checked, userInfo)" - (click)="onClickCheck($event)" + (click)="$event.stopPropagation()" > diff --git a/projects/ucap-webmessenger-ui-profile/src/lib/components/user-list-item.component.ts b/projects/ucap-webmessenger-ui-profile/src/lib/components/user-list-item.component.ts index 5fbfde29..1b56f947 100644 --- a/projects/ucap-webmessenger-ui-profile/src/lib/components/user-list-item.component.ts +++ b/projects/ucap-webmessenger-ui-profile/src/lib/components/user-list-item.component.ts @@ -43,9 +43,6 @@ export class UserListItemComponent implements OnInit { @Input() /** 선택된 사용자의 리스트 */ selectedUserList?: (UserInfo | UserInfoSS | UserInfoF | UserInfoDN)[] = []; - @Input() - /** event bubbling fixed in custom tree */ - inTree = false; @Output() checkUser = new EventEmitter<{ @@ -105,11 +102,6 @@ export class UserListItemComponent implements OnInit { userInfo }); } - onClickCheck(event: MouseEvent) { - if (!this.inTree) { - event.stopPropagation(); - } - } onClickOpenProfile( event: MouseEvent,