번역 전체보기 기능 구현.

This commit is contained in:
leejinho 2020-01-02 08:44:16 +09:00
parent f2887eb01c
commit 2b5d80a3d2
6 changed files with 59 additions and 4 deletions

View File

@ -242,6 +242,7 @@
[translationSimpleview]="translationSimpleview"
(moreEvent)="onMoreEvent($event)"
(massDetail)="onMassDetail($event)"
(massTranslationDetail)="onClickMassTranslationDetail($event)"
(save)="onSave($event)"
(fileViewer)="onFileViewer($event)"
(contextMenu)="onContextMenuMessage($event)"

View File

@ -104,6 +104,10 @@ import {
} from '../dialogs/group/select-group.dialog.component';
import { GroupDetailData } from '@ucap-webmessenger/protocol-sync';
import { environment } from '../../../../environments/environment';
import {
MassDetailComponent,
MassDetailDialogData
} from '../dialogs/chat/mass-detail.component';
@Component({
selector: 'app-layout-messenger-messages',
@ -796,6 +800,23 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit {
);
}
onClickMassTranslationDetail(params: {
contents: string;
contentsType: string;
}) {
this.dialogService.open<MassDetailComponent, MassDetailDialogData>(
MassDetailComponent,
{
disableClose: false,
width: '550px',
data: {
title: 'Detail View',
contents: params.contents
}
}
);
}
async onFileViewer(fileInfo: FileEventJson) {
const result = await this.dialogService.open<
FileViewerDialogComponent,

View File

@ -14,10 +14,10 @@
<div class="btn-box">
<ul>
<li>
<button mat-button>전체보기</button>
<button mat-button (click)="onClickMassDetail('O')">전체보기</button>
</li>
<li>
<button mat-button>
<button mat-button (click)="onClickMassDetail('T')">
<span class="language">{{ message.sentMessageJson.destLocale }}</span
>번역보기
</button>

View File

@ -1,4 +1,4 @@
import { Component, OnInit, Input } from '@angular/core';
import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
import {
TranslationEventJson,
Info,
@ -20,7 +20,27 @@ export class MassTranslationComponent implements OnInit {
@Input()
isMe: boolean;
@Output()
massTranslationDetail = new EventEmitter<{
contents: string;
contentsType: string;
}>();
constructor() {}
ngOnInit() {}
onClickMassDetail(contentsType: string) {
let contents = '';
if (contentsType === 'O') {
contents = this.message.sentMessageJson.original;
} else {
contents = this.message.sentMessageJson.translation;
}
this.massTranslationDetail.emit({
contents,
contentsType
});
}
}

View File

@ -188,10 +188,11 @@
></ucap-chat-message-box-translation>
<ucap-chat-message-box-mass-translation
*ngSwitchCase="EventType.MassTranslation"
class="information-msg"
[message]="message"
[translationSimpleview]="translationSimpleview"
[isMe]="message.senderSeq === loginRes.userSeq"
class="information-msg"
(massTranslationDetail)="onClickMassTranslationDetail($event)"
>
</ucap-chat-message-box-mass-translation>

View File

@ -60,6 +60,11 @@ export class MessagesComponent implements OnInit {
@Output()
massDetail = new EventEmitter<number>();
@Output()
massTranslationDetail = new EventEmitter<{
contents: string;
contentsType: string;
}>();
@Output()
fileViewer = new EventEmitter<FileEventJson>();
@Output()
save = new EventEmitter<{ fileInfo: FileInfo; type: string }>();
@ -227,6 +232,13 @@ export class MessagesComponent implements OnInit {
this.massDetail.emit(value);
}
onClickMassTranslationDetail(params: {
contents: string;
contentsType: string;
}) {
this.massTranslationDetail.emit(params);
}
/** [Event] Image Viewer */
onFileViewer(fileInfo: FileEventJson) {
this.fileViewer.emit(fileInfo);