조직도 부서원의 context 메뉴 기능 추가.
This commit is contained in:
parent
32155ed7a9
commit
1ccd32957f
|
@ -67,6 +67,7 @@
|
|||
(checkUser)="onCheckUser($event)"
|
||||
(openProfile)="onClickOpenProfile($event)"
|
||||
(click)="onToggleUser(userInfo)"
|
||||
(contextmenu)="onContextMenuOrgUser($event, userInfo)"
|
||||
>
|
||||
</ucap-profile-user-list-item>
|
||||
</cdk-virtual-scroll-viewport>
|
||||
|
@ -88,6 +89,7 @@
|
|||
(checkUser)="onCheckUser($event)"
|
||||
(openProfile)="onClickOpenProfile($event)"
|
||||
(click)="onToggleUser(userInfo)"
|
||||
(contextmenu)="onContextMenuOrgUser($event, userInfo)"
|
||||
>
|
||||
</ucap-profile-user-list-item>
|
||||
</cdk-virtual-scroll-viewport>
|
||||
|
@ -138,3 +140,34 @@
|
|||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div
|
||||
style="visibility: hidden; position: fixed"
|
||||
[style.left]="orgUserContextMenuPosition.x"
|
||||
[style.top]="orgUserContextMenuPosition.y"
|
||||
#orgUserContextMenuTrigger="matMenuTrigger"
|
||||
[matMenuTriggerFor]="orgUserContextMenu"
|
||||
></div>
|
||||
<mat-menu
|
||||
#orgUserContextMenu="matMenu"
|
||||
[hasBackdrop]="false"
|
||||
(ucapClickOutside)="orgUserContextMenuTrigger.closeMenu()"
|
||||
>
|
||||
<ng-template matMenuContent let-userInfo="userInfo">
|
||||
<button mat-menu-item (click)="onClickContextMenu('CALL_LINE', userInfo)">
|
||||
내선번호 전화걸기
|
||||
</button>
|
||||
<button mat-menu-item (click)="onClickContextMenu('CALL_MOBILE', userInfo)">
|
||||
모바일 전화걸기
|
||||
</button>
|
||||
<button
|
||||
mat-menu-item
|
||||
(click)="onClickContextMenu('SEND_MESSAGE', userInfo)"
|
||||
>
|
||||
쪽지 보내기
|
||||
</button>
|
||||
<button mat-menu-item (click)="onClickContextMenu('SEND_SMS', userInfo)">
|
||||
SMS 보내기
|
||||
</button>
|
||||
</ng-template>
|
||||
</mat-menu>
|
||||
|
|
|
@ -32,7 +32,13 @@ import * as SyncStore from '@app/store/messenger/sync';
|
|||
import * as ChatStore from '@app/store/messenger/chat';
|
||||
import * as StatusStore from '@app/store/messenger/status';
|
||||
import { SessionStorageService } from '@ucap-webmessenger/web-storage';
|
||||
import { LoginInfo, KEY_LOGIN_INFO, KEY_VER_INFO } from '@app/types';
|
||||
import {
|
||||
LoginInfo,
|
||||
KEY_LOGIN_INFO,
|
||||
KEY_VER_INFO,
|
||||
EnvironmentsInfo,
|
||||
KEY_ENVIRONMENTS_INFO
|
||||
} from '@app/types';
|
||||
import { take, map, tap, delay, catchError } from 'rxjs/operators';
|
||||
import { VersionInfo2Response } from '@ucap-webmessenger/api-public';
|
||||
import {
|
||||
|
@ -44,6 +50,12 @@ import { LoginResponse } from '@ucap-webmessenger/protocol-authentication';
|
|||
import { Company } from '@ucap-webmessenger/api-external';
|
||||
import { PerfectScrollbarDirective } from 'ngx-perfect-scrollbar';
|
||||
import { CdkVirtualScrollViewport } from '@angular/cdk/scrolling';
|
||||
import { MatMenuTrigger } from '@angular/material';
|
||||
import {
|
||||
MessageWriteDialogComponent,
|
||||
MessageWriteDialogResult,
|
||||
MessageWriteDialogData
|
||||
} from '../../dialogs/message/message-write.dialog.component';
|
||||
|
||||
@Component({
|
||||
selector: 'app-layout-chat-left-sidenav-organization',
|
||||
|
@ -53,6 +65,10 @@ import { CdkVirtualScrollViewport } from '@angular/cdk/scrolling';
|
|||
})
|
||||
export class OrganizationComponent
|
||||
implements OnInit, OnDestroy, AfterViewChecked {
|
||||
@ViewChild('orgUserContextMenuTrigger', { static: true })
|
||||
orgUserContextMenuTrigger: MatMenuTrigger;
|
||||
orgUserContextMenuPosition = { x: '0px', y: '0px' };
|
||||
|
||||
@Input()
|
||||
showTitle = true;
|
||||
@Input()
|
||||
|
@ -106,6 +122,7 @@ export class OrganizationComponent
|
|||
loginInfo: LoginInfo;
|
||||
loginRes: LoginResponse;
|
||||
sessionVerinfo: VersionInfo2Response;
|
||||
environmentsInfo: EnvironmentsInfo;
|
||||
|
||||
isShowSearch = false;
|
||||
searchUserInfos: UserInfoSS[] = [];
|
||||
|
@ -124,6 +141,9 @@ export class OrganizationComponent
|
|||
this.sessionVerinfo = this.sessionStorageService.get<VersionInfo2Response>(
|
||||
KEY_VER_INFO
|
||||
);
|
||||
this.environmentsInfo = this.sessionStorageService.get<EnvironmentsInfo>(
|
||||
KEY_ENVIRONMENTS_INFO
|
||||
);
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
@ -440,4 +460,55 @@ export class OrganizationComponent
|
|||
onClickConference() {
|
||||
this.logger.debug('onClickConference', this.selectedUserList);
|
||||
}
|
||||
|
||||
onContextMenuOrgUser(
|
||||
event: MouseEvent,
|
||||
userInfo: UserInfo | UserInfoSS | UserInfoF | UserInfoDN
|
||||
) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
|
||||
this.orgUserContextMenuPosition.x = event.clientX + 'px';
|
||||
this.orgUserContextMenuPosition.y = event.clientY + 'px';
|
||||
this.orgUserContextMenuTrigger.menu.focusFirstItem('mouse');
|
||||
this.orgUserContextMenuTrigger.menuData = { userInfo };
|
||||
this.orgUserContextMenuTrigger.openMenu();
|
||||
}
|
||||
|
||||
async onClickContextMenu(type: string, userInfo: UserInfo) {
|
||||
console.log(userInfo);
|
||||
switch (type) {
|
||||
case 'CALL_LINE':
|
||||
{
|
||||
}
|
||||
break;
|
||||
case 'CALL_MOBILE':
|
||||
{
|
||||
}
|
||||
break;
|
||||
case 'SEND_MESSAGE':
|
||||
{
|
||||
this.dialogService.open<
|
||||
MessageWriteDialogComponent,
|
||||
MessageWriteDialogData,
|
||||
MessageWriteDialogResult
|
||||
>(MessageWriteDialogComponent, {
|
||||
width: '600px',
|
||||
height: '600px',
|
||||
disableClose: true,
|
||||
hasBackdrop: false,
|
||||
data: {
|
||||
loginRes: this.loginRes,
|
||||
environmentsInfo: this.environmentsInfo,
|
||||
receiverList: [userInfo]
|
||||
}
|
||||
});
|
||||
}
|
||||
break;
|
||||
case 'SEND_SMS':
|
||||
{
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -119,7 +119,6 @@ export class AppMessengerResolver implements Resolve<void> {
|
|||
})
|
||||
.pipe(
|
||||
map(response => {
|
||||
console.log(response);
|
||||
if (response.statusCode === StatusCode.Success) {
|
||||
this.sessionStorageService.set<
|
||||
UrlInfoResponse | DaesangUrlInfoResponse
|
||||
|
|
Loading…
Reference in New Issue
Block a user