198 lines
5.2 KiB
TypeScript
Raw Normal View History

2019-12-06 15:14:12 +09:00
import { Component, OnInit, Inject, OnDestroy, ViewChild } from '@angular/core';
import {
UCAP_NATIVE_SERVICE,
NativeService,
WindowState
} from '@ucap-webmessenger/native';
import { Observable, Subscription } from 'rxjs';
import { Store, select } from '@ngrx/store';
2019-11-25 09:41:15 +09:00
import * as AppStore from '@app/store';
2019-12-03 14:32:50 +09:00
import * as ChatStore from '@app/store/messenger/chat';
2019-11-25 09:41:15 +09:00
import * as AuthenticationStore from '@app/store/account/authentication';
import * as SettingsStore from '@app/store/messenger/settings';
import { LoginResponse } from '@ucap-webmessenger/protocol-authentication';
import { tap } from 'rxjs/operators';
2019-12-03 14:32:50 +09:00
import { RightDrawer } from '@app/types';
@Component({
selector: 'app-layout-native-top-bar',
templateUrl: './top-bar.component.html',
styleUrls: ['./top-bar.component.scss']
})
export class TopBarComponent implements OnInit, OnDestroy {
windowStateChanged$: Observable<WindowState>;
WindowState = WindowState;
loginRes: LoginResponse;
loginResSubscription: Subscription;
2019-12-06 15:14:12 +09:00
showWeblink = false;
weblink: {
title: string;
url: string;
order: number;
activeYn: boolean;
}[] = [
{
order: 0,
title: '웹하드',
activeYn: true,
url:
'http://sso.daesang.com/messenger.do?eMateApps=WHD_78&eMatePTK=(%USER_ID%)'
},
{
order: 0,
title: 'DSP',
activeYn: true,
url:
'http://sso.daesang.com/messenger.do?eMateApps=GWS_01&eMatePTK=(%USER_ID%)'
},
{
order: 0,
title: 'SMS',
activeYn: true,
url:
'http://sso.daesang.com/messenger.do?eMateApps=SMS_21&eMatePTK=(%USER_ID%)'
},
{
order: 0,
title: '화상회의',
activeYn: true,
url:
'http://dsview.daesang.com/plugin/sso_login.asp?userid=(%USER_FIELD4%)'
},
{
order: 0,
title: 'EP',
activeYn: true,
url:
'http://sso.daesang.com/messenger.do?eMateApps=EPS_07&eMatePTK=(%USER_ID%)'
},
{
order: 0,
title: 'S & OP회의',
activeYn: true,
url:
'http://sso.daesang.com/messenger.do?eMateApps=SOP_05&eMatePTK=(%USER_ID%)'
},
{
order: 0,
title: 'S & OM회의',
activeYn: true,
url:
'http://sso.daesang.com/messenger.do?eMateApps=SOM_09&eMatePTK=(%USER_ID%)'
},
{
order: 0,
title: '코끼리',
activeYn: true,
url:
'http://dsp.daesang.com/names.nsf?login&username=(%USER_ID%)&password=(%USER_PASS%)&RedirectTo=http%3A%2F%2Fdsp%2Edaesang%2Ecom%3A80%2FDS%5F10%2Femate%5Fapp%2Felephant%2Fmaster%2Ensf%2Fmain%2Ehtml%3Freadform%26kind%3D3'
},
{
order: 0,
title: 'IT서비스데스크',
activeYn: true,
url:
'http://sso.daesang.com/messenger.do?eMateApps=HPD_13&eMatePTK=(%USER_ID%)'
},
{
order: 0,
title: '개인속보',
activeYn: true,
url:
'http://sso.daesang.com/messenger.do?eMateApps=DSB_43&eMatePTK=(%USER_ID%)'
},
{
order: 0,
title: '메일 count url',
activeYn: true,
url:
'http://dsp.daesang.com/names.nsf?login&username=(%USER_ID%)&password=(%USER_PASS%)&RedirectTo=http://dsp.daesang.com/common/sysorg.nsf/unreadmailcount2?openagent%26empno=(%USER_FIELD4%)'
},
{
order: 0,
title: '메일 link url',
activeYn: true,
url:
'http://dsp.daesang.com/names.nsf?login&username=(%USER_ID%)&password=(%USER_PASS%)&RedirectTo=%2Fportal%2Ensf%2Fmailredirect%3Fopenpage%26mode%3Dm'
},
{
order: 0,
title: '결제 count url',
activeYn: true,
url:
'http://dsp.daesang.com/names.nsf?login&username=(%USER_ID%)&password=(%USER_PASS%)&RedirectTo=http://dsp.daesang.com/common/sysorg.nsf/unreadmailcount2?openagent%26empno=(%USER_FIELD4%)'
},
{
order: 0,
title: '결제 link url',
activeYn: true,
url:
'http://dsp.daesang.com/names.nsf?login&username=(%USER_ID%)&password=(%USER_PASS%)&RedirectTo=%2Fportal%2Ensf%2Fmailredirect%3Fopenpage%26mode%3Dm'
},
{
order: 0,
title: '3개월 비밀번호 변경창 url',
activeYn: true,
url: 'sso.daesang.com / modify.do'
}
];
constructor(
2019-11-25 09:41:15 +09:00
private store: Store<any>,
@Inject(UCAP_NATIVE_SERVICE) private nativeService: NativeService
) {}
ngOnInit() {
this.windowStateChanged$ = this.nativeService.windowStateChanged();
this.loginResSubscription = this.store
.pipe(
select(AppStore.AccountSelector.AuthenticationSelector.loginRes),
tap(loginRes => {
this.loginRes = loginRes;
})
)
.subscribe();
}
ngOnDestroy(): void {}
onClickClose() {
this.nativeService.windowClose();
}
onClickMinimize() {
this.nativeService.windowMinimize();
}
onClickMaxmize() {
this.nativeService.windowMaximize();
}
2019-11-25 09:41:15 +09:00
onClickSettings(): void {
this.store.dispatch(SettingsStore.showDialog());
}
onClickLogout(): void {
this.store.dispatch(AuthenticationStore.logoutConfirmation());
2019-11-25 09:41:15 +09:00
}
2019-12-03 14:32:50 +09:00
onClickNotice(): void {
this.store.dispatch(
ChatStore.selectedRightDrawer({
req: RightDrawer.Notice
})
);
}
2019-12-06 15:14:12 +09:00
onToggleWebLinkSelector(): void {
this.showWeblink = !this.showWeblink;
}
}