weblink 관련 팝업 오픈로직 수정.

This commit is contained in:
leejinho 2020-02-14 17:28:38 +09:00
parent 66d32415d4
commit 14dcd34688
4 changed files with 86 additions and 13 deletions

View File

@ -64,7 +64,7 @@ import {
import { DialogService } from '@ucap-webmessenger/ui';
import { DOCUMENT } from '@angular/common';
import { MatMenu, MatRadioChange, MatMenuTrigger } from '@angular/material';
import { StatusCode, StatusType } from '@ucap-webmessenger/core';
import { StatusCode, StatusType, WindowUtil } from '@ucap-webmessenger/core';
import {
StatusInfo,
MessageIndexType,
@ -411,16 +411,69 @@ export class TopBarComponent implements OnInit, OnDestroy {
.replace(/(\(%USER_ID%\))/g, loginId)
.replace(/(\(%USER_PASS%\))/g, loginPw);
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;
case WebLinkType.Itsvcdesk:
/** IT서비스데스크 URL */
case WebLinkType.Dsp:
/** DSP URL */
{
openType = 'DEFAULT-BROWSER';
}
break;
case WebLinkType.Webhard:
/** 웹하드 URL */
case WebLinkType.Conf:
/** 화상회의 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 메신저만 해당 비밀번호 만료시 */
break;
}
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'
// });
open(
url,
link.title,
'frame=true,menubar=no,location=no,resizable=yes,scrollbars=yes,status=no,width=1000,height=800'
);
this.nativeService.openDefaultBrowser(url);
} else {
WindowUtil.popupOpen(url, link.title, width, height);
}
}
onClosedProfileMenu() {

View File

@ -0,0 +1,17 @@
export class WindowUtil {
public static popupOpen(
url: string,
title: string = 'Messenger',
width: number,
height: number
): void {
let optionStr = `frame=true,menubar=no,location=no,resizable=yes,scrollbars=yes,status=no`;
if (width > 0) {
optionStr += `,width=${width}`;
}
if (width > 0) {
optionStr += `,height=${height + 15}`;
}
open(url, title, optionStr);
}
}

View File

@ -25,6 +25,7 @@ export * from './lib/utils/mime.util';
export * from './lib/utils/object.util';
export * from './lib/utils/sticker.util';
export * from './lib/utils/string.util';
export * from './lib/utils/window.util';
export * from './lib/config/host.config';
export * from './lib/config/url.config';

View File

@ -3,6 +3,7 @@ import { SessionStorageService } from '@ucap-webmessenger/web-storage';
import { KEY_URL_INFO } from '@app/types';
import { NativeService } from '@ucap-webmessenger/native';
import { WebLinkType } from '../types/web-link.type';
import { WindowUtil } from '@ucap-webmessenger/core';
export class SmsUtils {
constructor(
@ -39,10 +40,11 @@ export class SmsUtils {
const url = this.url.replace(/(\(%USER_TOKEN%\))/g, token);
// this.nativeService.openDefaultBrowser(url);
open(
url + `&ruser=${employeeNum},`, // ruser 파라미터에 ','가 마지막에 꼭 붙어야 한다.
WindowUtil.popupOpen(
url + `&ruser=${employeeNum},`,
'DaesangSMS',
'frame=true,menubar=no,location=no,resizable=yes,scrollbars=yes,status=no,width=685,height=700'
685,
640
);
}
}