# 이슈처리

156 쪽지 수신자 추가 후 한번 더 선택 시 추가된 수신자 사라짐
This commit is contained in:
leejinho 2020-01-20 09:00:15 +09:00
parent 93944da65d
commit 3b94b4083b
4 changed files with 63 additions and 53 deletions

View File

@ -10,7 +10,7 @@
[isModify]="isModify" [isModify]="isModify"
[detail]="data.detail" [detail]="data.detail"
[detailContents]="data.detailContents" [detailContents]="data.detailContents"
[curReceiverList]="data.receiverList" [curReceiverList]="curReceiverList"
[fileAllowSize]="fileAllowSize" [fileAllowSize]="fileAllowSize"
(send)="onSend($event)" (send)="onSend($event)"
(selectReceiver)="onSelectReceiver($event)" (selectReceiver)="onSelectReceiver($event)"

View File

@ -7,10 +7,14 @@ import {
DetailResponse, DetailResponse,
DetailContent, DetailContent,
MessageApiService, MessageApiService,
MessageType MessageType,
DetailReceiver
} from '@ucap-webmessenger/api-message'; } from '@ucap-webmessenger/api-message';
import { LoginResponse } from '@ucap-webmessenger/protocol-authentication'; import {
LoginResponse,
RoleCode
} from '@ucap-webmessenger/protocol-authentication';
import { NGXLogger } from 'ngx-logger'; import { NGXLogger } from 'ngx-logger';
import { import {
WriteComponent as UCapMessageWriteComponent, WriteComponent as UCapMessageWriteComponent,
@ -34,6 +38,7 @@ import { TranslateService } from '@ngx-translate/core';
import { VersionInfo2Response } from '@ucap-webmessenger/api-public'; import { VersionInfo2Response } from '@ucap-webmessenger/api-public';
import { SessionStorageService } from '@ucap-webmessenger/web-storage'; import { SessionStorageService } from '@ucap-webmessenger/web-storage';
import { environment } from '../../../../../environments/environment'; import { environment } from '../../../../../environments/environment';
import { EmployeeType } from '@ucap-webmessenger/protocol-room';
export interface MessageWriteDialogData { export interface MessageWriteDialogData {
loginRes: LoginResponse; loginRes: LoginResponse;
@ -62,6 +67,8 @@ export class MessageWriteDialogComponent implements OnInit {
@ViewChild('messageWrite', { static: true }) @ViewChild('messageWrite', { static: true })
messageWrite: UCapMessageWriteComponent; messageWrite: UCapMessageWriteComponent;
curReceiverList: (UserInfo | UserInfoSS)[];
sessionVerInfo: VersionInfo2Response; sessionVerInfo: VersionInfo2Response;
fileAllowSize: number; fileAllowSize: number;
@ -94,6 +101,11 @@ export class MessageWriteDialogComponent implements OnInit {
if (!!this.data.detail && !!this.data.detail.msgInfo) { if (!!this.data.detail && !!this.data.detail.msgInfo) {
this.isModify = true; this.isModify = true;
this.curReceiverList = this.data.detail.recvList.map(recvInfo =>
this.convertDetailReceivertoUserInfo(recvInfo)
);
} else {
this.curReceiverList = this.data.receiverList;
} }
} }
@ -112,12 +124,14 @@ export class MessageWriteDialogComponent implements OnInit {
}); });
if (!!result && !!result.choice && result.choice) { if (!!result && !!result.choice && result.choice) {
while (receiverList.length) { // while (receiverList.length) {
receiverList.pop(); // receiverList.pop();
} // }
const selectedUserList: UserInfo[] = [];
result.selectedUserList.forEach(v => { result.selectedUserList.forEach(v => {
receiverList.push(v as UserInfo); selectedUserList.push(v as UserInfo);
}); });
this.curReceiverList = selectedUserList;
} }
} }
@ -220,4 +234,40 @@ export class MessageWriteDialogComponent implements OnInit {
getBtnValid() { getBtnValid() {
return true; return true;
} }
private convertDetailReceivertoUserInfo(base: DetailReceiver): UserInfo {
return {
seq: base.userSeq,
name: base.userName,
profileImageFile: '',
grade: '',
intro: '',
companyCode: '',
hpNumber: '',
lineNumber: '',
email: '',
isMobile: false,
deptName: '',
isFavorit: false,
isBuddy: false,
isActive: false,
roleCd: RoleCode.Self,
employeeNum: '',
madn: '',
hardSadn: '',
fmcSadn: '',
nameEn: '',
nameCn: '',
gradeEn: '',
gradeCn: '',
deptNameEn: '',
deptNameCn: '',
isPrivacyAgree: false,
isValidLogin: false,
employeeType: EmployeeType.Regular,
nickName: '',
order: ''
};
}
} }

View File

@ -13,7 +13,7 @@
}}</span> }}</span>
</button> </button>
<span <span
*ngIf="receiverList.length > 0" *ngIf="!!receiverList && receiverList.length > 0"
class="receiver-sum text-accent-color" class="receiver-sum text-accent-color"
> >
{{ {{

View File

@ -79,7 +79,11 @@ export interface MessageModify extends Message {
}) })
export class WriteComponent implements OnInit, OnDestroy, AfterViewInit { export class WriteComponent implements OnInit, OnDestroy, AfterViewInit {
@Input() @Input()
curReceiverList: UserInfo[] = []; set curReceiverList(userInfoList: UserInfo[]) {
if (!!userInfoList && userInfoList.length > 0) {
this.receiverList = userInfoList;
}
}
@Input() @Input()
detail?: DetailResponse; detail?: DetailResponse;
@Input() @Input()
@ -122,14 +126,6 @@ export class WriteComponent implements OnInit, OnDestroy, AfterViewInit {
title: ['', []] title: ['', []]
}); });
if (!!this.curReceiverList && this.curReceiverList.length > 0) {
this.receiverList = this.curReceiverList;
} else if (!!this.detail && this.detail.recvList.length > 0) {
this.receiverList = this.detail.recvList.map(recvInfo =>
this.convertDetailReceivertoUserInfo(recvInfo)
);
}
if (this.isModify) { if (this.isModify) {
if (!!this.detail.msgInfo.title) { if (!!this.detail.msgInfo.title) {
this.messageWriteForm.setValue({ title: this.detail.msgInfo.title }); this.messageWriteForm.setValue({ title: this.detail.msgInfo.title });
@ -563,40 +559,4 @@ export class WriteComponent implements OnInit, OnDestroy, AfterViewInit {
range.insertNode(node); range.insertNode(node);
} }
private convertDetailReceivertoUserInfo(base: DetailReceiver): UserInfo {
return {
seq: base.userSeq,
name: base.userName,
profileImageFile: '',
grade: '',
intro: '',
companyCode: '',
hpNumber: '',
lineNumber: '',
email: '',
isMobile: false,
deptName: '',
isFavorit: false,
isBuddy: false,
isActive: false,
roleCd: RoleCode.Self,
employeeNum: '',
madn: '',
hardSadn: '',
fmcSadn: '',
nameEn: '',
nameCn: '',
gradeEn: '',
gradeCn: '',
deptNameEn: '',
deptNameCn: '',
isPrivacyAgree: false,
isValidLogin: false,
employeeType: EmployeeType.Regular,
nickName: '',
order: ''
};
}
} }