# 이슈처리
156 쪽지 수신자 추가 후 한번 더 선택 시 추가된 수신자 사라짐
This commit is contained in:
parent
93944da65d
commit
3b94b4083b
|
@ -10,7 +10,7 @@
|
|||
[isModify]="isModify"
|
||||
[detail]="data.detail"
|
||||
[detailContents]="data.detailContents"
|
||||
[curReceiverList]="data.receiverList"
|
||||
[curReceiverList]="curReceiverList"
|
||||
[fileAllowSize]="fileAllowSize"
|
||||
(send)="onSend($event)"
|
||||
(selectReceiver)="onSelectReceiver($event)"
|
||||
|
|
|
@ -7,10 +7,14 @@ import {
|
|||
DetailResponse,
|
||||
DetailContent,
|
||||
MessageApiService,
|
||||
MessageType
|
||||
MessageType,
|
||||
DetailReceiver
|
||||
} 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 {
|
||||
WriteComponent as UCapMessageWriteComponent,
|
||||
|
@ -34,6 +38,7 @@ import { TranslateService } from '@ngx-translate/core';
|
|||
import { VersionInfo2Response } from '@ucap-webmessenger/api-public';
|
||||
import { SessionStorageService } from '@ucap-webmessenger/web-storage';
|
||||
import { environment } from '../../../../../environments/environment';
|
||||
import { EmployeeType } from '@ucap-webmessenger/protocol-room';
|
||||
|
||||
export interface MessageWriteDialogData {
|
||||
loginRes: LoginResponse;
|
||||
|
@ -62,6 +67,8 @@ export class MessageWriteDialogComponent implements OnInit {
|
|||
@ViewChild('messageWrite', { static: true })
|
||||
messageWrite: UCapMessageWriteComponent;
|
||||
|
||||
curReceiverList: (UserInfo | UserInfoSS)[];
|
||||
|
||||
sessionVerInfo: VersionInfo2Response;
|
||||
|
||||
fileAllowSize: number;
|
||||
|
@ -94,6 +101,11 @@ export class MessageWriteDialogComponent implements OnInit {
|
|||
|
||||
if (!!this.data.detail && !!this.data.detail.msgInfo) {
|
||||
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) {
|
||||
while (receiverList.length) {
|
||||
receiverList.pop();
|
||||
}
|
||||
// while (receiverList.length) {
|
||||
// receiverList.pop();
|
||||
// }
|
||||
const selectedUserList: UserInfo[] = [];
|
||||
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() {
|
||||
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: ''
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
}}</span>
|
||||
</button>
|
||||
<span
|
||||
*ngIf="receiverList.length > 0"
|
||||
*ngIf="!!receiverList && receiverList.length > 0"
|
||||
class="receiver-sum text-accent-color"
|
||||
>
|
||||
{{
|
||||
|
|
|
@ -79,7 +79,11 @@ export interface MessageModify extends Message {
|
|||
})
|
||||
export class WriteComponent implements OnInit, OnDestroy, AfterViewInit {
|
||||
@Input()
|
||||
curReceiverList: UserInfo[] = [];
|
||||
set curReceiverList(userInfoList: UserInfo[]) {
|
||||
if (!!userInfoList && userInfoList.length > 0) {
|
||||
this.receiverList = userInfoList;
|
||||
}
|
||||
}
|
||||
@Input()
|
||||
detail?: DetailResponse;
|
||||
@Input()
|
||||
|
@ -122,14 +126,6 @@ export class WriteComponent implements OnInit, OnDestroy, AfterViewInit {
|
|||
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.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);
|
||||
}
|
||||
|
||||
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: ''
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user