mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-20 05:16:07 +00:00
fix donwload attachment and modal to edit message
This commit is contained in:
@@ -1,52 +1,45 @@
|
||||
import { SafeResourceUrl } from "@angular/platform-browser";
|
||||
import { MessageAttachmentFileType, MessageAttachmentSource, MessageEntity } from "src/app/core/chat/entity/message";
|
||||
import { IMessageType, MessageEntity, MessageEntitySchema } from "src/app/core/chat/entity/message";
|
||||
import { SessionStore } from "src/app/store/session.service";
|
||||
|
||||
export class MessageViewModal {
|
||||
$id!: number
|
||||
id!: string
|
||||
$id?: number
|
||||
id?: string
|
||||
roomId?: string
|
||||
receiverId?: number
|
||||
message!: string
|
||||
message?: string
|
||||
messageType: number = 0
|
||||
canEdit: boolean = false
|
||||
oneShot: boolean = false
|
||||
sentAt!: string
|
||||
sentAt?: string
|
||||
requireUnlock: boolean = false
|
||||
info: {
|
||||
memberId?: number
|
||||
readAt?: string,
|
||||
deliverAt?: string
|
||||
}[] = []
|
||||
sender!: {
|
||||
wxUserId: number,
|
||||
wxFullName: string,
|
||||
wxeMail: string,
|
||||
userPhoto: string,
|
||||
}
|
||||
info: typeof MessageEntitySchema._type.info = []
|
||||
sender!: typeof MessageEntitySchema._type.sender
|
||||
sending: boolean = false
|
||||
sendAttemp = 0
|
||||
|
||||
attachments: {
|
||||
safeFile?: SafeResourceUrl;
|
||||
fileType: MessageAttachmentFileType,
|
||||
source: MessageAttachmentSource,
|
||||
file?: string,
|
||||
fileName: string,
|
||||
applicationId?: number,
|
||||
docId?: string,
|
||||
mimeType?: string,
|
||||
description?: string
|
||||
id?: string
|
||||
}[] = []
|
||||
|
||||
reactions = []
|
||||
attachments: typeof MessageEntitySchema._type.attachments = []
|
||||
reactions: typeof MessageEntitySchema._type.reactions = []
|
||||
requestId!: string
|
||||
status = ''
|
||||
isDeleted: typeof MessageEntitySchema._type.isDeleted = false
|
||||
|
||||
status!: 'allViewed' | 'allReceived'| 'enviado'| 'enviar'
|
||||
messageUiType!: 'info-meeting'| 'my-message'| 'other-message'
|
||||
|
||||
constructor(model: MessageEntity) {
|
||||
Object.assign(this, model)
|
||||
this.setMessageUIType()
|
||||
}
|
||||
|
||||
setMessageUIType() {
|
||||
if(this.messageType == IMessageType.information) {
|
||||
this.messageUiType = 'info-meeting'
|
||||
} else if (this.sender?.wxUserId === SessionStore.user.UserId) {
|
||||
this.messageUiType = 'my-message'
|
||||
} else {
|
||||
this.messageUiType = 'other-message'
|
||||
}
|
||||
}
|
||||
|
||||
messageStatus(totalMembers: number) {
|
||||
if(this.allViewed(totalMembers)) {
|
||||
|
||||
Reference in New Issue
Block a user