2020-01-03 17:53:51 +09:00
|
|
|
import {
|
|
|
|
Component,
|
|
|
|
OnInit,
|
|
|
|
Inject,
|
|
|
|
OnDestroy,
|
|
|
|
ChangeDetectorRef,
|
|
|
|
ViewChild
|
|
|
|
} from '@angular/core';
|
2019-10-24 15:37:33 +09:00
|
|
|
import {
|
|
|
|
UCAP_NATIVE_SERVICE,
|
|
|
|
NativeService,
|
2019-12-12 17:15:09 +09:00
|
|
|
WindowState,
|
|
|
|
UpdateInfo
|
2019-10-24 15:37:33 +09:00
|
|
|
} from '@ucap-webmessenger/native';
|
2019-12-17 11:44:59 +09:00
|
|
|
import { Observable, Subscription, of } from 'rxjs';
|
2019-11-25 10:47:44 +09:00
|
|
|
import { Store, select } from '@ngrx/store';
|
2019-11-25 09:41:15 +09:00
|
|
|
|
2020-01-22 14:16:32 +09:00
|
|
|
import semver from 'semver';
|
|
|
|
|
2019-11-25 10:47:44 +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';
|
2019-12-12 17:15:09 +09:00
|
|
|
import * as UpdateStore from '@app/store/setting/update';
|
2020-01-13 13:55:54 +09:00
|
|
|
import * as SettingNativeStore from '@app/store/setting/native';
|
2020-01-10 16:49:53 +09:00
|
|
|
import * as StatusStore from '@app/store/messenger/status';
|
2019-10-24 15:37:33 +09:00
|
|
|
|
2019-11-25 10:47:44 +09:00
|
|
|
import { LoginResponse } from '@ucap-webmessenger/protocol-authentication';
|
2019-12-17 11:44:59 +09:00
|
|
|
import { tap, take, map, catchError } from 'rxjs/operators';
|
2019-12-13 16:51:44 +09:00
|
|
|
import {
|
|
|
|
RightDrawer,
|
|
|
|
KEY_URL_INFO,
|
|
|
|
LoginInfo,
|
2019-12-17 11:44:59 +09:00
|
|
|
KEY_LOGIN_INFO,
|
2020-01-22 14:16:32 +09:00
|
|
|
KEY_VER_INFO,
|
|
|
|
EnvironmentsInfo,
|
|
|
|
KEY_ENVIRONMENTS_INFO
|
2019-12-13 16:51:44 +09:00
|
|
|
} from '@app/types';
|
|
|
|
import {
|
|
|
|
WebLink,
|
|
|
|
DaesangUrlInfoResponse
|
|
|
|
} from '@ucap-webmessenger/api-external';
|
2019-12-17 11:44:59 +09:00
|
|
|
import {
|
|
|
|
SessionStorageService,
|
|
|
|
LocalStorageService
|
|
|
|
} from '@ucap-webmessenger/web-storage';
|
|
|
|
import { AppUserInfo, KEY_APP_USER_INFO } from '@app/types/app-user-info.type';
|
|
|
|
import { environment } from '../../../../environments/environment';
|
2019-12-31 16:37:21 +09:00
|
|
|
import {
|
|
|
|
DaesangApiService,
|
2020-01-03 11:05:17 +09:00
|
|
|
DaesangProtocolService,
|
2020-02-24 14:45:53 +09:00
|
|
|
WebLinkType,
|
|
|
|
DaesangCipherService
|
2019-12-31 16:37:21 +09:00
|
|
|
} from '@ucap-webmessenger/daesang';
|
2019-12-18 15:57:02 +09:00
|
|
|
import { NGXLogger } from 'ngx-logger';
|
2020-01-22 14:16:32 +09:00
|
|
|
import {
|
|
|
|
VersionInfo2Response,
|
|
|
|
PublicApiService
|
|
|
|
} from '@ucap-webmessenger/api-public';
|
2019-12-31 16:37:21 +09:00
|
|
|
import {
|
|
|
|
ProfileDialogComponent,
|
|
|
|
ProfileDialogResult,
|
|
|
|
ProfileDialogData
|
|
|
|
} from '@app/layouts/messenger/dialogs/profile/profile.dialog.component';
|
|
|
|
import { DialogService } from '@ucap-webmessenger/ui';
|
2020-01-03 17:53:51 +09:00
|
|
|
import { DOCUMENT } from '@angular/common';
|
2020-02-18 10:54:35 +09:00
|
|
|
import { MatMenu, MatMenuTrigger } from '@angular/material/menu';
|
2020-02-14 17:28:38 +09:00
|
|
|
import { StatusCode, StatusType, WindowUtil } from '@ucap-webmessenger/core';
|
2020-01-20 13:25:59 +09:00
|
|
|
import {
|
|
|
|
StatusInfo,
|
|
|
|
MessageIndexType,
|
|
|
|
MessageUpdateRequest
|
|
|
|
} from '@ucap-webmessenger/protocol-status';
|
2020-01-29 09:58:40 +09:00
|
|
|
import {
|
|
|
|
IntegratedSearchDialogComponent,
|
|
|
|
IntegratedSearchDialogResult,
|
|
|
|
IntegratedSearchDialogData
|
|
|
|
} from '@app/layouts/messenger/dialogs/search/integrated-search.dialog.component';
|
2020-02-18 10:54:35 +09:00
|
|
|
import { MatRadioChange } from '@angular/material/radio';
|
2019-11-25 10:47:44 +09:00
|
|
|
|
2020-01-13 13:55:54 +09:00
|
|
|
const zoomFactors = [60, 70, 85, 100, 120, 145, 170, 200];
|
2019-11-25 10:47:44 +09:00
|
|
|
|
2019-10-24 15:37:33 +09:00
|
|
|
@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;
|
2019-12-12 17:15:09 +09:00
|
|
|
|
2019-11-25 10:47:44 +09:00
|
|
|
loginRes: LoginResponse;
|
|
|
|
loginResSubscription: Subscription;
|
2019-12-31 16:37:21 +09:00
|
|
|
sessionVerinfo: VersionInfo2Response;
|
2019-10-24 15:37:33 +09:00
|
|
|
|
2019-12-12 17:15:09 +09:00
|
|
|
updateInfo$: Observable<UpdateInfo>;
|
|
|
|
|
2020-01-10 16:49:53 +09:00
|
|
|
myStatus: StatusInfo;
|
|
|
|
myStatusSubscription: Subscription;
|
|
|
|
|
|
|
|
myIdleCheckTime: number;
|
|
|
|
myIdleCheckTimeSubscription: Subscription;
|
|
|
|
|
2020-01-13 13:55:54 +09:00
|
|
|
zoom: number;
|
|
|
|
zoomSubscription: Subscription;
|
|
|
|
|
2019-12-13 16:51:44 +09:00
|
|
|
loginInfo: LoginInfo;
|
|
|
|
weblink: WebLink[] = [];
|
2019-12-17 11:44:59 +09:00
|
|
|
webLinkBadgeMail = 0;
|
|
|
|
webLinkBadgePayment = 0;
|
2019-12-06 15:14:12 +09:00
|
|
|
|
2020-01-13 15:41:35 +09:00
|
|
|
appVersion: string;
|
|
|
|
|
2020-01-03 11:05:17 +09:00
|
|
|
WebLinkType = WebLinkType;
|
2020-01-10 16:49:53 +09:00
|
|
|
StatusCode = StatusCode;
|
2020-01-03 11:05:17 +09:00
|
|
|
|
2020-01-22 14:16:32 +09:00
|
|
|
checkingUpdate = false;
|
|
|
|
checkingUpdateIsProcessing = false;
|
|
|
|
checkingUpdateAppVersion: string;
|
2020-01-22 16:10:30 +09:00
|
|
|
checkingUpdateIsExist = false;
|
2020-01-22 14:16:32 +09:00
|
|
|
|
2020-01-13 14:54:25 +09:00
|
|
|
readonly awayTimeList = [10, 20, 30];
|
|
|
|
|
2020-02-05 16:18:17 +09:00
|
|
|
@ViewChild('profileMenuTrigger', { static: false })
|
|
|
|
profileMenuTrigger: MatMenuTrigger;
|
|
|
|
|
2020-01-03 17:53:51 +09:00
|
|
|
@ViewChild('profileMenu', { static: true })
|
|
|
|
profileMenu: MatMenu;
|
|
|
|
|
2020-02-12 14:08:22 +09:00
|
|
|
integratedSearchWord = '';
|
|
|
|
|
2019-10-24 15:37:33 +09:00
|
|
|
constructor(
|
2019-11-25 09:41:15 +09:00
|
|
|
private store: Store<any>,
|
2019-12-13 16:51:44 +09:00
|
|
|
@Inject(UCAP_NATIVE_SERVICE) private nativeService: NativeService,
|
2020-01-22 14:16:32 +09:00
|
|
|
private changeDetectorRef: ChangeDetectorRef,
|
2019-12-31 16:37:21 +09:00
|
|
|
private dialogService: DialogService,
|
2020-02-24 14:45:53 +09:00
|
|
|
private daesangCipherService: DaesangCipherService,
|
2019-12-17 11:44:59 +09:00
|
|
|
private localStorageService: LocalStorageService,
|
|
|
|
private sessionStorageService: SessionStorageService,
|
2020-01-22 14:16:32 +09:00
|
|
|
private publicApiService: PublicApiService,
|
2019-12-18 15:57:02 +09:00
|
|
|
private daesangApiService: DaesangApiService,
|
2019-12-31 16:37:21 +09:00
|
|
|
private daesangProtocolService: DaesangProtocolService,
|
2020-01-03 17:53:51 +09:00
|
|
|
@Inject(DOCUMENT) private document: Document,
|
2019-12-18 15:57:02 +09:00
|
|
|
private logger: NGXLogger
|
2020-01-03 11:05:17 +09:00
|
|
|
) {}
|
2019-10-24 15:37:33 +09:00
|
|
|
|
|
|
|
ngOnInit() {
|
|
|
|
this.windowStateChanged$ = this.nativeService.windowStateChanged();
|
2019-11-25 10:47:44 +09:00
|
|
|
|
|
|
|
this.loginResSubscription = this.store
|
|
|
|
.pipe(
|
|
|
|
select(AppStore.AccountSelector.AuthenticationSelector.loginRes),
|
|
|
|
tap(loginRes => {
|
|
|
|
this.loginRes = loginRes;
|
2019-12-15 14:01:45 +09:00
|
|
|
|
|
|
|
this.loginInfo = this.sessionStorageService.get<LoginInfo>(
|
|
|
|
KEY_LOGIN_INFO
|
|
|
|
);
|
|
|
|
|
2020-01-03 11:05:17 +09:00
|
|
|
this.sessionVerinfo = this.sessionStorageService.get<
|
|
|
|
VersionInfo2Response
|
|
|
|
>(KEY_VER_INFO);
|
2020-01-02 08:43:54 +09:00
|
|
|
|
2019-12-15 14:01:45 +09:00
|
|
|
// WebLink init..
|
2020-01-14 08:27:53 +09:00
|
|
|
this.initWebLink(loginRes);
|
2019-11-25 10:47:44 +09:00
|
|
|
})
|
|
|
|
)
|
|
|
|
.subscribe();
|
2019-12-12 17:15:09 +09:00
|
|
|
|
2020-01-10 16:49:53 +09:00
|
|
|
this.myStatusSubscription = this.store
|
2020-01-13 13:55:54 +09:00
|
|
|
.pipe(select(AppStore.MessengerSelector.StatusSelector.selectMyStatus))
|
2020-01-10 16:49:53 +09:00
|
|
|
.subscribe(myStatus => {
|
|
|
|
this.myStatus = myStatus;
|
|
|
|
});
|
|
|
|
|
|
|
|
this.myIdleCheckTimeSubscription = this.store
|
|
|
|
.pipe(
|
2020-01-13 13:55:54 +09:00
|
|
|
select(AppStore.MessengerSelector.StatusSelector.selectMyIdleCheckTime)
|
2020-01-10 16:49:53 +09:00
|
|
|
)
|
|
|
|
.subscribe(myIdleCheckTime => {
|
|
|
|
this.myIdleCheckTime = myIdleCheckTime;
|
|
|
|
});
|
|
|
|
|
2020-01-13 13:55:54 +09:00
|
|
|
this.zoomSubscription = this.store
|
|
|
|
.pipe(select(AppStore.SettingSelector.NativeSelector.selectZoom))
|
|
|
|
.subscribe(zoom => {
|
|
|
|
this.zoom = zoom;
|
|
|
|
});
|
|
|
|
|
2019-12-12 17:15:09 +09:00
|
|
|
this.updateInfo$ = this.store.pipe(
|
|
|
|
select(AppStore.SettingSelector.UpdateSelector.updateInfo)
|
|
|
|
);
|
2020-01-13 13:55:54 +09:00
|
|
|
|
2020-01-13 15:41:35 +09:00
|
|
|
this.nativeService.getVersionInfo().then(ver => {
|
|
|
|
this.appVersion = ver;
|
|
|
|
});
|
2019-10-24 15:37:33 +09:00
|
|
|
}
|
|
|
|
|
2020-01-10 16:49:53 +09:00
|
|
|
ngOnDestroy(): void {
|
|
|
|
if (!!this.loginResSubscription) {
|
|
|
|
this.loginResSubscription.unsubscribe();
|
2020-01-13 14:54:25 +09:00
|
|
|
this.loginResSubscription = undefined;
|
2020-01-10 16:49:53 +09:00
|
|
|
}
|
|
|
|
if (!!this.myStatusSubscription) {
|
|
|
|
this.myStatusSubscription.unsubscribe();
|
2020-01-13 14:54:25 +09:00
|
|
|
this.myStatusSubscription = undefined;
|
2020-01-10 16:49:53 +09:00
|
|
|
}
|
|
|
|
if (!!this.myIdleCheckTimeSubscription) {
|
|
|
|
this.myIdleCheckTimeSubscription.unsubscribe();
|
2020-01-13 14:54:25 +09:00
|
|
|
this.myIdleCheckTimeSubscription = undefined;
|
|
|
|
}
|
|
|
|
if (!!this.zoomSubscription) {
|
|
|
|
this.zoomSubscription.unsubscribe();
|
|
|
|
this.zoomSubscription = undefined;
|
2020-01-10 16:49:53 +09:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-01-14 08:27:53 +09:00
|
|
|
initWebLink(loginRes: LoginResponse): void {
|
|
|
|
if (!!loginRes) {
|
|
|
|
const urlInfo: DaesangUrlInfoResponse = this.sessionStorageService.get<
|
|
|
|
DaesangUrlInfoResponse
|
|
|
|
>(KEY_URL_INFO);
|
2019-12-15 14:01:45 +09:00
|
|
|
|
2020-01-14 08:27:53 +09:00
|
|
|
if (!!urlInfo && !!urlInfo.webLink) {
|
|
|
|
// order by webLinkAllowedList..
|
2020-01-15 17:02:18 +09:00
|
|
|
this.weblink = urlInfo.webLinkAllowedList
|
|
|
|
.filter(
|
|
|
|
showWebLink =>
|
|
|
|
urlInfo.webLink.filter(wl => wl.key === showWebLink).length > 0
|
|
|
|
)
|
|
|
|
.map(showWeblink =>
|
|
|
|
urlInfo.webLink.find(weblink => weblink.key === showWeblink)
|
|
|
|
);
|
2019-12-17 13:00:33 +09:00
|
|
|
|
2020-01-14 08:27:53 +09:00
|
|
|
if (urlInfo.webLinkAllowedList.indexOf(WebLinkType.Mail) > -1) {
|
|
|
|
// 메일 카운트 체크.
|
|
|
|
const link = urlInfo.webLink.filter(
|
|
|
|
weblink => weblink.key === WebLinkType.MailCnt
|
|
|
|
);
|
|
|
|
if (link.length > 0) {
|
|
|
|
const appUserInfo = this.localStorageService.encGet<AppUserInfo>(
|
|
|
|
KEY_APP_USER_INFO,
|
|
|
|
environment.customConfig.appKey
|
|
|
|
);
|
|
|
|
|
|
|
|
const WebLinkMailCnt = link[0];
|
|
|
|
const loginPw = appUserInfo.loginPw;
|
|
|
|
const loginPw2 = this.loginInfo.loginPw;
|
|
|
|
const loginId = this.loginInfo.loginId;
|
|
|
|
const token = loginRes.tokenString;
|
|
|
|
|
|
|
|
const url = WebLinkMailCnt.url
|
|
|
|
.replace(/(\(%USER_TOKEN%\))/g, token)
|
|
|
|
.replace(/(\(%USER_ID%\))/g, loginId)
|
|
|
|
.replace(/(\(%USER_PASS%\))/g, loginPw);
|
|
|
|
|
|
|
|
this.daesangApiService
|
|
|
|
.retrieveMailCount(url)
|
|
|
|
.pipe(
|
|
|
|
take(1),
|
|
|
|
map(res => (this.webLinkBadgeMail = res.count)),
|
|
|
|
catchError(error => of(this.logger.log(error)))
|
|
|
|
)
|
|
|
|
.subscribe();
|
|
|
|
}
|
2019-12-15 14:01:45 +09:00
|
|
|
}
|
2020-01-14 08:27:53 +09:00
|
|
|
if (urlInfo.webLinkAllowedList.indexOf(WebLinkType.Payment) > -1) {
|
|
|
|
// 결제 카운트 체크.
|
|
|
|
const link = urlInfo.webLink.filter(
|
|
|
|
weblink => weblink.key === WebLinkType.PaymentCnt
|
2019-12-17 13:00:33 +09:00
|
|
|
);
|
2020-01-14 08:27:53 +09:00
|
|
|
if (link.length > 0) {
|
|
|
|
const appUserInfo = this.localStorageService.encGet<AppUserInfo>(
|
|
|
|
KEY_APP_USER_INFO,
|
|
|
|
environment.customConfig.appKey
|
|
|
|
);
|
|
|
|
|
|
|
|
const WebLinkPaymentCnt = link[0];
|
|
|
|
const loginPw = appUserInfo.loginPw;
|
|
|
|
const loginPw2 = this.loginInfo.loginPw;
|
|
|
|
const loginId = this.loginInfo.loginId;
|
|
|
|
const token = loginRes.tokenString;
|
|
|
|
|
|
|
|
const url = WebLinkPaymentCnt.url
|
|
|
|
.replace(/(\(%USER_TOKEN%\))/g, token)
|
|
|
|
.replace(/(\(%USER_ID%\))/g, loginId)
|
|
|
|
.replace(/(\(%USER_PASS%\))/g, loginPw);
|
|
|
|
|
|
|
|
this.daesangApiService
|
|
|
|
.retrievePaymentCount(url)
|
|
|
|
.pipe(
|
|
|
|
take(1),
|
|
|
|
map(res => {
|
|
|
|
this.webLinkBadgePayment = res.count;
|
|
|
|
}),
|
|
|
|
catchError(error => of(this.logger.log(error)))
|
|
|
|
)
|
|
|
|
.subscribe();
|
|
|
|
}
|
2019-12-15 14:01:45 +09:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-10-24 15:37:33 +09:00
|
|
|
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 {
|
2019-11-25 10:47:44 +09:00
|
|
|
this.store.dispatch(AuthenticationStore.logoutConfirmation());
|
2019-11-25 09:41:15 +09:00
|
|
|
}
|
2019-12-03 14:32:50 +09:00
|
|
|
|
2020-01-23 11:23:31 +09:00
|
|
|
onClickQuit(): void {
|
|
|
|
this.nativeService.appExit();
|
|
|
|
}
|
|
|
|
|
2019-12-31 16:37:21 +09:00
|
|
|
getMyProfileImageWidget(): string {
|
|
|
|
if (!!this.loginRes) {
|
|
|
|
return this.loginRes.userInfo.profileImageFile;
|
|
|
|
} else {
|
|
|
|
return '';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-01-03 14:27:11 +09:00
|
|
|
onClickOpenProfile(event: Event) {
|
2019-12-31 16:37:21 +09:00
|
|
|
// [GROUP]
|
|
|
|
// this.queryProtocolService
|
|
|
|
// .dataUser({
|
|
|
|
// divCd: 'OPENPROF',
|
|
|
|
// seq: userInfo.seq,
|
|
|
|
// senderCompanyCode: this.loginRes.userInfo.companyCode,
|
|
|
|
// senderEmployeeType: this.loginRes.userInfo.employeeType
|
|
|
|
// })
|
|
|
|
// .pipe(
|
|
|
|
// take(1),
|
|
|
|
// map(res => {
|
|
|
|
// if (!!res && !!res.userInfo) {
|
|
|
|
// this.dialogService.open<
|
|
|
|
// ProfileDialogComponent,
|
|
|
|
// ProfileDialogData,
|
|
|
|
// ProfileDialogResult
|
|
|
|
// >(ProfileDialogComponent, {
|
|
|
|
// data: {
|
|
|
|
// userInfo: res.userInfo
|
|
|
|
// }
|
|
|
|
// });
|
|
|
|
// }
|
|
|
|
// })
|
|
|
|
// )
|
|
|
|
// .subscribe();
|
2020-01-03 14:33:15 +09:00
|
|
|
event.preventDefault();
|
2019-12-31 16:37:21 +09:00
|
|
|
|
|
|
|
// [Daesang]
|
|
|
|
this.daesangProtocolService
|
|
|
|
.dataUserDaesang({
|
|
|
|
divCd: 'OPENPROF',
|
|
|
|
seq: this.loginRes.userSeq,
|
|
|
|
senderCompanyCode: this.loginRes.userInfo.companyCode,
|
|
|
|
senderEmployeeType: this.loginRes.userInfo.employeeType
|
|
|
|
})
|
|
|
|
.pipe(
|
|
|
|
take(1),
|
|
|
|
map(res => {
|
|
|
|
if (!!res && !!res.userInfo) {
|
|
|
|
this.dialogService.open<
|
|
|
|
ProfileDialogComponent,
|
|
|
|
ProfileDialogData,
|
|
|
|
ProfileDialogResult
|
|
|
|
>(ProfileDialogComponent, {
|
|
|
|
data: {
|
|
|
|
userInfo: res.userInfo
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
})
|
|
|
|
)
|
|
|
|
.subscribe();
|
|
|
|
}
|
|
|
|
|
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
|
|
|
|
2019-12-30 15:25:08 +09:00
|
|
|
/** About WebLink */
|
2019-12-13 16:51:44 +09:00
|
|
|
onClickWebLink(link: WebLink): void {
|
2019-12-17 13:00:33 +09:00
|
|
|
const appUserInfo = this.localStorageService.encGet<AppUserInfo>(
|
|
|
|
KEY_APP_USER_INFO,
|
|
|
|
environment.customConfig.appKey
|
|
|
|
);
|
|
|
|
|
|
|
|
const loginPw = appUserInfo.loginPw;
|
2019-12-17 11:44:59 +09:00
|
|
|
const loginPw2 = this.loginInfo.loginPw;
|
|
|
|
const loginId = this.loginInfo.loginId;
|
2019-12-13 16:51:44 +09:00
|
|
|
const token = this.loginRes.tokenString;
|
|
|
|
|
2019-12-17 11:44:59 +09:00
|
|
|
const url = link.url
|
|
|
|
.replace(/(\(%USER_TOKEN%\))/g, token)
|
|
|
|
.replace(/(\(%USER_ID%\))/g, loginId)
|
|
|
|
.replace(/(\(%USER_PASS%\))/g, loginPw);
|
2019-12-13 16:51:44 +09:00
|
|
|
|
2020-02-14 17:28:38 +09:00
|
|
|
let width = 1160;
|
|
|
|
let height = 800;
|
|
|
|
let openType = 'INNER-POPUP';
|
|
|
|
switch (link.key) {
|
|
|
|
case WebLinkType.Sms:
|
|
|
|
/** SMS URL */
|
|
|
|
{
|
|
|
|
width = 685;
|
|
|
|
height = 640;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
// case WebLinkType.Itsvcdesk:
|
|
|
|
// /** IT서비스데스크 URL */
|
|
|
|
// {
|
|
|
|
// width = 1400;
|
|
|
|
// height = 1000;
|
|
|
|
// }
|
|
|
|
// break;
|
2020-02-17 10:49:21 +09:00
|
|
|
case WebLinkType.Conf:
|
|
|
|
/** 화상회의 URL */
|
2020-02-14 17:28:38 +09:00
|
|
|
{
|
|
|
|
}
|
|
|
|
break;
|
2020-02-17 10:49:21 +09:00
|
|
|
case WebLinkType.Itsvcdesk:
|
|
|
|
/** IT서비스데스크 URL */
|
|
|
|
case WebLinkType.Dsp:
|
|
|
|
/** DSP URL */
|
2020-02-14 17:28:38 +09:00
|
|
|
case WebLinkType.Webhard:
|
|
|
|
/** 웹하드 URL */
|
|
|
|
case WebLinkType.Ep:
|
|
|
|
/** EP URL */
|
|
|
|
case WebLinkType.Sop:
|
|
|
|
/** S&OP회의 URL */
|
|
|
|
case WebLinkType.Som:
|
|
|
|
/** S&OM회의 URL */
|
|
|
|
case WebLinkType.Elephant:
|
|
|
|
/** 코끼리 URL */
|
|
|
|
case WebLinkType.UrgntNews:
|
|
|
|
/** 개인속보 URL */
|
|
|
|
case WebLinkType.MailCnt:
|
|
|
|
/** 메일Count URL */
|
|
|
|
case WebLinkType.Mail:
|
|
|
|
/** 메일 링크 URL */
|
|
|
|
case WebLinkType.PaymentCnt:
|
|
|
|
/** 결재Count URL */
|
|
|
|
case WebLinkType.Payment:
|
|
|
|
/** 결재링크 URL */
|
|
|
|
case WebLinkType.ChgPassword:
|
|
|
|
/** 비밀번호변경 URL ; PC 메신저만 해당 비밀번호 만료시 */
|
2020-02-17 10:49:21 +09:00
|
|
|
{
|
|
|
|
openType = 'DEFAULT-BROWSER';
|
|
|
|
}
|
2020-02-14 17:28:38 +09:00
|
|
|
break;
|
|
|
|
}
|
2020-02-13 11:02:51 +09:00
|
|
|
|
2020-02-14 17:28:38 +09:00
|
|
|
if (openType === 'DEFAULT-BROWSER') {
|
|
|
|
// // Old popup open.. >> default browser open.
|
|
|
|
// this.nativeService.openDefaultBrowser(url, {
|
|
|
|
// features:
|
|
|
|
// 'menubar=no,location=no,resizable=yes,scrollbars=yes,status=no,width=400,height=400'
|
|
|
|
// });
|
|
|
|
this.nativeService.openDefaultBrowser(url);
|
|
|
|
} else {
|
|
|
|
WindowUtil.popupOpen(url, link.title, width, height);
|
|
|
|
}
|
2019-12-13 16:51:44 +09:00
|
|
|
}
|
2019-12-12 17:15:09 +09:00
|
|
|
|
2020-01-22 16:37:47 +09:00
|
|
|
onClosedProfileMenu() {
|
|
|
|
this.checkingUpdate = false;
|
|
|
|
this.checkingUpdateIsProcessing = false;
|
|
|
|
this.checkingUpdateAppVersion = undefined;
|
|
|
|
this.checkingUpdateIsExist = false;
|
|
|
|
}
|
|
|
|
|
2019-12-12 17:15:09 +09:00
|
|
|
onClickUpdate() {
|
|
|
|
this.store.dispatch(UpdateStore.applyInstantUpdate());
|
|
|
|
}
|
2020-01-03 17:53:51 +09:00
|
|
|
|
|
|
|
onClickZoomOut(event: Event) {
|
2020-01-13 13:55:54 +09:00
|
|
|
const i = zoomFactors.indexOf(this.zoom);
|
|
|
|
if (-1 === i || 0 === i) {
|
|
|
|
return;
|
|
|
|
}
|
2020-01-03 17:53:51 +09:00
|
|
|
|
2020-01-13 13:55:54 +09:00
|
|
|
const zoom = zoomFactors[i - 1];
|
|
|
|
this.store.dispatch(SettingNativeStore.changeZoom({ zoom }));
|
|
|
|
}
|
2020-01-03 17:53:51 +09:00
|
|
|
|
2020-01-13 13:55:54 +09:00
|
|
|
onClickZoomLabel(event: Event) {
|
|
|
|
this.store.dispatch(SettingNativeStore.changeZoom({ zoom: 100 }));
|
2020-01-03 17:53:51 +09:00
|
|
|
}
|
|
|
|
|
|
|
|
onClickZoomIn(event: Event) {
|
2020-01-13 13:55:54 +09:00
|
|
|
const i = zoomFactors.indexOf(this.zoom);
|
|
|
|
if (-1 === i || zoomFactors.length - 1 === i) {
|
|
|
|
return;
|
|
|
|
}
|
2020-01-03 17:53:51 +09:00
|
|
|
|
2020-01-13 13:55:54 +09:00
|
|
|
const zoom = zoomFactors[i + 1];
|
|
|
|
this.store.dispatch(SettingNativeStore.changeZoom({ zoom }));
|
2020-01-03 17:53:51 +09:00
|
|
|
}
|
2020-01-09 18:52:08 +09:00
|
|
|
|
|
|
|
onClickRemoteSupport(event: Event) {
|
|
|
|
this.nativeService.executeProcess('AeroAdmin');
|
|
|
|
}
|
2020-01-10 16:49:53 +09:00
|
|
|
|
|
|
|
onClickStatusOnline(event: Event) {
|
|
|
|
this.store.dispatch(
|
|
|
|
StatusStore.status({
|
|
|
|
req: {
|
|
|
|
statusDivisionType: StatusType.Messenger,
|
|
|
|
statusType: StatusCode.OnLine
|
|
|
|
}
|
|
|
|
})
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
onClickStatusAway(event: Event) {
|
|
|
|
this.store.dispatch(
|
|
|
|
StatusStore.status({
|
|
|
|
req: {
|
|
|
|
statusDivisionType: StatusType.Messenger,
|
|
|
|
statusType: StatusCode.Away
|
|
|
|
}
|
|
|
|
})
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
onClickStatusBusy(event: Event, index: number) {
|
|
|
|
let statusMessage = '';
|
|
|
|
switch (index) {
|
|
|
|
case 1:
|
|
|
|
statusMessage = this.loginRes.statusMessage1;
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
statusMessage = this.loginRes.statusMessage2;
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
statusMessage = this.loginRes.statusMessage3;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
this.store.dispatch(
|
|
|
|
StatusStore.status({
|
|
|
|
req: {
|
|
|
|
statusDivisionType: StatusType.Messenger,
|
|
|
|
statusType: StatusCode.Busy,
|
|
|
|
statusMessage
|
|
|
|
}
|
|
|
|
})
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2020-01-20 13:25:59 +09:00
|
|
|
onApplyStatusMessage(index: MessageIndexType, statusMessage: string) {
|
2020-01-13 14:54:25 +09:00
|
|
|
this.logger.debug('StatusMessage', index, statusMessage);
|
|
|
|
|
|
|
|
this.store.dispatch(
|
2020-01-20 13:25:59 +09:00
|
|
|
StatusStore.messageUpdate({
|
|
|
|
index,
|
|
|
|
statusMessage
|
|
|
|
} as MessageUpdateRequest)
|
2020-01-13 14:54:25 +09:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2020-01-10 16:49:53 +09:00
|
|
|
onClickChangeStatusBusy(event: Event, index: number) {
|
|
|
|
event.stopPropagation();
|
|
|
|
}
|
|
|
|
|
|
|
|
onChangeAwayTime(event: MatRadioChange) {
|
|
|
|
this.store.dispatch(
|
|
|
|
StatusStore.changeMyIdleCheckTime({ checkTime: Number(event.value) })
|
|
|
|
);
|
|
|
|
}
|
2020-01-22 14:16:32 +09:00
|
|
|
|
2020-01-22 16:37:47 +09:00
|
|
|
onMenuOpenedinformationMenu() {
|
|
|
|
if (this.checkingUpdate) {
|
|
|
|
return;
|
|
|
|
}
|
2020-01-22 16:10:30 +09:00
|
|
|
|
|
|
|
this.checkForUpdates();
|
|
|
|
}
|
|
|
|
|
|
|
|
checkForUpdates() {
|
2020-01-22 14:16:32 +09:00
|
|
|
this.checkingUpdate = true;
|
|
|
|
this.checkingUpdateIsProcessing = true;
|
|
|
|
|
|
|
|
const loginInfo = this.sessionStorageService.get<LoginInfo>(KEY_LOGIN_INFO);
|
|
|
|
const environmentsInfo = this.sessionStorageService.get<EnvironmentsInfo>(
|
|
|
|
KEY_ENVIRONMENTS_INFO
|
|
|
|
);
|
|
|
|
|
|
|
|
this.publicApiService
|
|
|
|
.versionInfo2({
|
|
|
|
deviceType: environmentsInfo.deviceType,
|
|
|
|
companyGroupType: loginInfo.companyGroupType,
|
|
|
|
companyCode: loginInfo.companyCode,
|
|
|
|
loginId: loginInfo.loginId
|
|
|
|
})
|
|
|
|
.pipe(take(1))
|
|
|
|
.subscribe(
|
|
|
|
res => {
|
2020-01-22 16:10:30 +09:00
|
|
|
this.checkingUpdateAppVersion = res.appVersion;
|
2020-01-22 14:16:32 +09:00
|
|
|
if (semver.lt(this.appVersion, res.appVersion)) {
|
2020-01-22 16:10:30 +09:00
|
|
|
this.checkingUpdateIsExist = true;
|
2020-01-22 14:16:32 +09:00
|
|
|
} else {
|
2020-01-22 16:10:30 +09:00
|
|
|
this.checkingUpdateIsExist = false;
|
2020-01-22 14:16:32 +09:00
|
|
|
}
|
|
|
|
},
|
|
|
|
error => {},
|
|
|
|
() => {
|
|
|
|
this.checkingUpdateIsProcessing = false;
|
|
|
|
}
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
onClickApplyUpdate(event: Event) {
|
2020-02-05 16:18:17 +09:00
|
|
|
// this.profileMenuTrigger.closeMenu();
|
2020-02-10 13:45:02 +09:00
|
|
|
this.store.dispatch(
|
|
|
|
UpdateStore.applyUpdate({ currentVersion: this.checkingUpdateAppVersion })
|
|
|
|
);
|
2020-01-22 14:16:32 +09:00
|
|
|
}
|
2020-01-29 09:58:40 +09:00
|
|
|
|
2020-02-12 14:08:22 +09:00
|
|
|
async onIntegratedSearch(keyword: string) {
|
2020-01-31 17:16:50 +09:00
|
|
|
if (!keyword || keyword.trim().length === 0) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2020-02-12 14:08:22 +09:00
|
|
|
this.integratedSearchWord = keyword;
|
|
|
|
|
|
|
|
const result = await this.dialogService.open<
|
2020-01-29 09:58:40 +09:00
|
|
|
IntegratedSearchDialogComponent,
|
|
|
|
IntegratedSearchDialogData,
|
|
|
|
IntegratedSearchDialogResult
|
|
|
|
>(IntegratedSearchDialogComponent, {
|
|
|
|
data: {
|
|
|
|
keyword
|
2020-02-12 14:08:22 +09:00
|
|
|
},
|
|
|
|
restoreFocus: false
|
2020-01-29 09:58:40 +09:00
|
|
|
});
|
2020-02-12 14:08:22 +09:00
|
|
|
|
|
|
|
this.integratedSearchWord = '';
|
2020-01-29 09:58:40 +09:00
|
|
|
}
|
2019-10-24 15:37:33 +09:00
|
|
|
}
|