수정 :: 새로운 대화 개설용 유저 선택 팝업 > 유저선택 항목 탭간 서로 공유

This commit is contained in:
leejh 2019-10-17 17:02:20 +09:00
parent d29ca388bf
commit 687b49816a
5 changed files with 61 additions and 22 deletions

View File

@ -1,25 +1,16 @@
<div <div class="oraganization-tab" fxLayout="column" *ngIf="departmentInfoList$ | async">
class="oraganization-tab"
fxLayout="column"
*ngIf="departmentInfoList$ | async"
>
<div class="oraganization-tab-tree" fxFlex="50" style="overflow: scroll"> <div class="oraganization-tab-tree" fxFlex="50" style="overflow: scroll">
<ucap-organization-tree <ucap-organization-tree [oraganizationList]="departmentInfoList$ | async"
[oraganizationList]="departmentInfoList$ | async" (selected)="onSelectedOrganization($event)"></ucap-organization-tree>
(selected)="onSelectedOrganization($event)"
></ucap-organization-tree>
</div> </div>
<div fxFlex="50" style="overflow: scroll"> <div fxFlex="50" style="overflow: scroll">
<div> <div>
(선택된부서명) (선택된부서명)
</div> </div>
<div> <div>
<ucap-profile-user-list-item <ucap-profile-user-list-item *ngFor="let userInfo of selectedDepartmentUserInfoList$ | async"
*ngFor="let userInfo of selectedDepartmentUserInfoList$ | async" [userInfo]="userInfo" [checkable]="true" [sessionVerinfo]="sessionVerinfo" [selectedUserList]="selectedUserList"
[userInfo]="userInfo" [isChecked]="getCheckedUser(userInfo)" (checkUser)="onCheckUser($event)">
[checkable]="true"
[sessionVerinfo]="sessionVerinfo"
>
</ucap-profile-user-list-item> </ucap-profile-user-list-item>
</div> </div>
<div> <div>

View File

@ -1,4 +1,4 @@
import { Component, OnInit } from '@angular/core'; import { Component, OnInit, Output, EventEmitter, Input } from '@angular/core';
import { ucapAnimations } from '@ucap-webmessenger/ui'; import { ucapAnimations } from '@ucap-webmessenger/ui';
import { Observable } from 'rxjs'; import { Observable } from 'rxjs';
import { import {
@ -6,8 +6,11 @@ import {
QueryProtocolService, QueryProtocolService,
DeptSearchType, DeptSearchType,
UserInfoSS, UserInfoSS,
DeptUserResponse DeptUserResponse,
UserInfoF,
UserInfoDN
} from '@ucap-webmessenger/protocol-query'; } from '@ucap-webmessenger/protocol-query';
import { UserInfo } from '@ucap-webmessenger/protocol-sync';
import { Store, select } from '@ngrx/store'; import { Store, select } from '@ngrx/store';
import { NGXLogger } from 'ngx-logger'; import { NGXLogger } from 'ngx-logger';
@ -26,6 +29,16 @@ import { KEY_VER_INFO } from '@app/types/ver-info.type';
animations: ucapAnimations animations: ucapAnimations
}) })
export class OrganizationComponent implements OnInit { export class OrganizationComponent implements OnInit {
@Input()
/** 선택된 사용자의 리스트 */
selectedUserList?: (UserInfo | UserInfoSS | UserInfoF | UserInfoDN)[] = [];
@Output()
checkUser = new EventEmitter<{
isChecked: boolean;
userInfo: UserInfo | UserInfoSS | UserInfoF | UserInfoDN;
}>();
departmentInfoList$: Observable<DeptInfo[]>; departmentInfoList$: Observable<DeptInfo[]>;
selectedDepartmentUserInfoList$: Observable<UserInfoSS[]>; selectedDepartmentUserInfoList$: Observable<UserInfoSS[]>;
selectedDepartmentStatus$: Observable<DeptUserResponse>; selectedDepartmentStatus$: Observable<DeptUserResponse>;
@ -76,6 +89,16 @@ export class OrganizationComponent implements OnInit {
.subscribe(); .subscribe();
} }
getCheckedUser(userInfo: UserInfo | UserInfoSS | UserInfoF | UserInfoDN) {
if (!!this.selectedUserList && this.selectedUserList.length > 0) {
return (
this.selectedUserList.filter(item => item.seq === userInfo.seq).length >
0
);
}
return false;
}
onSelectedOrganization(deptInfo: DeptInfo) { onSelectedOrganization(deptInfo: DeptInfo) {
this.store this.store
.pipe( .pipe(
@ -97,4 +120,12 @@ export class OrganizationComponent implements OnInit {
) )
.subscribe(); .subscribe();
} }
onCheckUser(params: {
isChecked: boolean;
userInfo: UserInfo | UserInfoSS | UserInfoF | UserInfoDN;
}) {
console.log(this.selectedUserList);
this.checkUser.emit(params);
}
} }

View File

@ -15,7 +15,8 @@
<ucap-group-expansion-panel #groupExpansionPanel [groupBuddyList]="groupBuddyList$ | async" <ucap-group-expansion-panel #groupExpansionPanel [groupBuddyList]="groupBuddyList$ | async"
[favoritBuddyList]="favoritBuddyList$ | async" [checkable]="true" (checkGroup)="onCheckGroup($event)"> [favoritBuddyList]="favoritBuddyList$ | async" [checkable]="true" (checkGroup)="onCheckGroup($event)">
<ucap-profile-user-list-item *ucapGroupExpansionPanelItem="let userInfo" [userInfo]="userInfo" <ucap-profile-user-list-item *ucapGroupExpansionPanelItem="let userInfo" [userInfo]="userInfo"
[sessionVerinfo]="sessionVerinfo" (checkUser)="onCheckUser($event)" [checkable]="true"> [sessionVerinfo]="sessionVerinfo" [selectedUserList]="selectedUserList"
[isChecked]="getCheckedUser(userInfo)" (checkUser)="onCheckUser($event)" [checkable]="true">
</ucap-profile-user-list-item> </ucap-profile-user-list-item>
</ucap-group-expansion-panel> </ucap-group-expansion-panel>
</mat-tab> </mat-tab>
@ -23,7 +24,9 @@
<ng-template mat-tab-label> <ng-template mat-tab-label>
<mat-icon>device_hub</mat-icon> <mat-icon>device_hub</mat-icon>
</ng-template> </ng-template>
<app-layout-chat-left-sidenav-organization></app-layout-chat-left-sidenav-organization> <app-layout-chat-left-sidenav-organization [selectedUserList]="selectedUserList"
(checkUser)="onCheckUser($event)">
</app-layout-chat-left-sidenav-organization>
</mat-tab> </mat-tab>
<mat-tab> <mat-tab>
<ng-template mat-tab-label> <ng-template mat-tab-label>

View File

@ -207,7 +207,7 @@ export class CreateChatDialogComponent implements OnInit, OnDestroy {
this.selectedUserList.filter(user => user.seq === item.seq).length === this.selectedUserList.filter(user => user.seq === item.seq).length ===
0 0
) { ) {
this.selectedUserList.push(item); this.selectedUserList = [...this.selectedUserList, item];
} }
}); });
} else { } else {
@ -226,9 +226,10 @@ export class CreateChatDialogComponent implements OnInit, OnDestroy {
if (params.isChecked) { if (params.isChecked) {
if ( if (
this.selectedUserList.filter(user => user.seq === params.userInfo.seq) this.selectedUserList.filter(user => user.seq === params.userInfo.seq)
.length === 0 .length === 0 &&
params.userInfo
) { ) {
this.selectedUserList.push(params.userInfo); this.selectedUserList = [...this.selectedUserList, params.userInfo];
} }
} else { } else {
this.selectedUserList = this.selectedUserList.filter( this.selectedUserList = this.selectedUserList.filter(
@ -242,4 +243,14 @@ export class CreateChatDialogComponent implements OnInit, OnDestroy {
// choice // choice
// }); // });
} }
getCheckedUser(userInfo: UserInfo | UserInfoSS | UserInfoF | UserInfoDN) {
if (!!this.selectedUserList && this.selectedUserList.length > 0) {
return (
this.selectedUserList.filter(item => item.seq === userInfo.seq).length >
0
);
}
return false;
}
} }

View File

@ -48,6 +48,9 @@ export class UserListItemComponent implements OnInit, OnDestroy {
compactable = false; compactable = false;
@Input() @Input()
sessionVerinfo: VersionInfo2Response; sessionVerinfo: VersionInfo2Response;
@Input()
/** 선택된 사용자의 리스트 */
selectedUserList?: (UserInfo | UserInfoSS | UserInfoF | UserInfoDN)[] = [];
@Output() @Output()
checkUser = new EventEmitter<{ checkUser = new EventEmitter<{