From b68bb1d83ae8706e3747b773280a043be90bbc0c Mon Sep 17 00:00:00 2001 From: leejinho Date: Tue, 24 Dec 2019 14:58:43 +0900 Subject: [PATCH] =?UTF-8?q?=ED=94=84=EB=A1=9C=ED=95=84=201=EC=B0=A8=20?= =?UTF-8?q?=EC=88=98=EC=A0=95=EB=B3=B8.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/lib/protocols/data-user.ts | 3 +- .../src/lib/models/user-info-ss.ts | 4 +- .../message-box/mass.component.html | 2 +- .../src/lib/components/profile.component.html | 294 +++++++++++++----- .../src/lib/pipes/ucapString.pipe.ts | 44 +++ .../src/lib/ucap-ui.module.ts | 8 +- 6 files changed, 280 insertions(+), 75 deletions(-) create mode 100644 projects/ucap-webmessenger-ui/src/lib/pipes/ucapString.pipe.ts diff --git a/projects/ucap-webmessenger-daesang/src/lib/protocols/data-user.ts b/projects/ucap-webmessenger-daesang/src/lib/protocols/data-user.ts index 3773a261..f25dbe7c 100644 --- a/projects/ucap-webmessenger-daesang/src/lib/protocols/data-user.ts +++ b/projects/ucap-webmessenger-daesang/src/lib/protocols/data-user.ts @@ -67,7 +67,8 @@ export const decodeDataUser: ProtocolDecoder = ( employeeType: info[28] as EmployeeType, workplace: info[29], responsibilities: info[30], - workstatus: info[31] + workstatus: info[31], + customerInfo: info[32] }; } return decodeProtocolMessage(message, { diff --git a/projects/ucap-webmessenger-protocol-query/src/lib/models/user-info-ss.ts b/projects/ucap-webmessenger-protocol-query/src/lib/models/user-info-ss.ts index c5131223..996f98f1 100644 --- a/projects/ucap-webmessenger-protocol-query/src/lib/models/user-info-ss.ts +++ b/projects/ucap-webmessenger-protocol-query/src/lib/models/user-info-ss.ts @@ -64,8 +64,10 @@ export interface UserInfoSS { /** 사업장 */ workplace?: string; - /** 담당업무 */ + /** 담당업무(SC직무) */ responsibilities?: string; /** 업무 상태 */ workstatus?: string; + /** 거래처 정보 */ + customerInfo?: string; } diff --git a/projects/ucap-webmessenger-ui-chat/src/lib/components/message-box/mass.component.html b/projects/ucap-webmessenger-ui-chat/src/lib/components/message-box/mass.component.html index 967b4eaf..bebf2830 100644 --- a/projects/ucap-webmessenger-ui-chat/src/lib/components/message-box/mass.component.html +++ b/projects/ucap-webmessenger-ui-chat/src/lib/components/message-box/mass.component.html @@ -1,7 +1,7 @@
- {{ moment(message.sendDate).toDate() | date: 'short' }} + {{ message.sendDate | ucapDate: 'YYYY.MM.DD a hh:mm' }}
diff --git a/projects/ucap-webmessenger-ui-profile/src/lib/components/profile.component.html b/projects/ucap-webmessenger-ui-profile/src/lib/components/profile.component.html index 3396717c..f5d7c5ff 100644 --- a/projects/ucap-webmessenger-ui-profile/src/lib/components/profile.component.html +++ b/projects/ucap-webmessenger-ui-profile/src/lib/components/profile.component.html @@ -2,56 +2,107 @@
- +
- - - {{ getWorkstatus(userInfo) }} 휴가중 + + {{ getWorkstatus(userInfo) }} - - - + +
{{ userInfo | ucapTranslate: 'name' }} - (A123456) + {{ userInfo.employeeNum }} - {{userInfo | ucapTranslate: 'deptName'}} + {{ userInfo | ucapTranslate: 'deptName' }} {{ userInfo | ucapTranslate: 'grade' }} -
{{ userInfo.intro }}가나다라라라마마마바사아자차카타파하가나다라마사아자차카타파하가나다라마사아자차카타파하가나다라마사아자차카타파하가나다라마사아자차카타파하
+
+ {{ userInfo.intro }} +
- - - - + + + - + @@ -59,9 +110,21 @@ - + @@ -70,21 +133,23 @@
-
- - -
+
    -
  • -
    사업장
    -
    {{ userInfo.workplace }}
    -
  • 담당업무/근무지
    -
    {{ userInfo.responsibilities }}
    +
    + {{ userInfo.responsibilities | ucapStringEmptycheck }} / + {{ userInfo.workplace | ucapStringEmptycheck }} +
  • 사원직무/거래처
    @@ -92,35 +157,67 @@
  • 이메일
    -
    {{ userInfo.email }}
    +
    {{ userInfo.email | ucapStringEmptycheck }}
    +
  • +
  • 사무실
    -
    {{ userInfo.lineNumber }}1234567890123456789012345678901234567890
    -
  • 핸드폰
    -
    {{ userInfo.hpNumber }}
    -
@@ -128,44 +225,99 @@
-
- SMS
- 화상
- 쪽지
diff --git a/projects/ucap-webmessenger-ui/src/lib/pipes/ucapString.pipe.ts b/projects/ucap-webmessenger-ui/src/lib/pipes/ucapString.pipe.ts new file mode 100644 index 00000000..5891bf55 --- /dev/null +++ b/projects/ucap-webmessenger-ui/src/lib/pipes/ucapString.pipe.ts @@ -0,0 +1,44 @@ +import { Pipe, PipeTransform } from '@angular/core'; + +@Pipe({ name: 'ucapStringEmptycheck' }) +export class StringEmptyCheckPipe implements PipeTransform { + transform(value: string): string { + return value.trim().length > 0 ? value.trim() : '-'; + } +} + +@Pipe({ name: 'ucapStringFormatterPhone' }) +export class StringFormatterPhonePipe implements PipeTransform { + transform(value: string, hidden?: boolean): string { + const num = value.trim().replace(/[-, ]/g, ''); + let formatNum = ''; + if (num.length === 0) { + return num; + } + + if (num.length === 11) { + if (!!hidden && hidden) { + formatNum = num.replace(/(\d{3})(\d{4})(\d{4})/, '$1-****-$3'); + } else { + formatNum = num.replace(/(\d{3})(\d{4})(\d{4})/, '$1-$2-$3'); + } + } else if (num.length === 8) { + formatNum = num.replace(/(\d{4})(\d{4})/, '$1-$2'); + } else { + if (num.indexOf('02') === 0) { + if (!!hidden && hidden) { + formatNum = num.replace(/(\d{2})(\d{4})(\d{4})/, '$1-****-$3'); + } else { + formatNum = num.replace(/(\d{2})(\d{4})(\d{4})/, '$1-$2-$3'); + } + } else { + if (!!hidden && hidden) { + formatNum = num.replace(/(\d{3})(\d{3})(\d{4})/, '$1-***-$3'); + } else { + formatNum = num.replace(/(\d{3})(\d{3})(\d{4})/, '$1-$2-$3'); + } + } + } + return formatNum; + } +} diff --git a/projects/ucap-webmessenger-ui/src/lib/ucap-ui.module.ts b/projects/ucap-webmessenger-ui/src/lib/ucap-ui.module.ts index fb84ce3c..5ae1a53a 100644 --- a/projects/ucap-webmessenger-ui/src/lib/ucap-ui.module.ts +++ b/projects/ucap-webmessenger-ui/src/lib/ucap-ui.module.ts @@ -67,6 +67,10 @@ import { TranslatePipe } from './pipes/translate.pipe'; import { DatePipe } from './pipes/date.pipe'; import { MatTabsModule } from '@angular/material'; +import { + StringEmptyCheckPipe, + StringFormatterPhonePipe +} from './pipes/ucapString.pipe'; const COMPONENTS = [ FileUploadQueueComponent, @@ -102,7 +106,9 @@ const PIPES = [ SecondsToMinutesPipe, LinkyPipe, TranslatePipe, - DatePipe + DatePipe, + StringEmptyCheckPipe, + StringFormatterPhonePipe ]; const SERVICES = [ BottomSheetService,