[20 전달 탭 사용자 선택 통일성 없음] 이슈처리.

이벤트 꼬이는 문제 수정 및 대화방 리스트 클릭시 체크박스 토글되도록 수정.
This commit is contained in:
leejinho 2019-11-27 14:39:43 +09:00
parent 0bc6968e98
commit 187efa67ab
4 changed files with 21 additions and 14 deletions

View File

@ -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)"
>
</ucap-room-list-item>
</div>

View File

@ -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<VersionInfo2Response>(
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) {

View File

@ -37,7 +37,7 @@
#checkbox
[checked]="isChecked"
(change)="onChangeCheck(checkbox.checked, userInfo)"
(click)="onClickCheck($event)"
(click)="$event.stopPropagation()"
>
</mat-checkbox>
</div>

View File

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