change card layout

This commit is contained in:
Peter Maquiran
2024-02-29 15:55:18 +01:00
parent d1b2387f4b
commit 3fd33066a9
3 changed files with 62 additions and 40 deletions
@@ -5,22 +5,25 @@
<div *ngFor="let attachment of taskViewerAttachment; let i = index"
class="ion-no-margin ion-no-padding cursor-pointer attachment-list" class="pa-10 mx-10 card-text" [ngClass]="{'selected-attachment': i === selectedIndex}"
>
<div class="attachment" (click)="clickDocument(attachment, i )">
<div class="attachment" >
<div class="attach-title-item tex-left">
<div>{{ attachment.Assunto || "Sem assunto" }}</div>
<div class="attach-title-item tex-left d-flex">
<div>
<div class="subject" [ngClass]="{'add-ellipsis': i != selectedIndex}">{{ attachment.Assunto || "Sem assunto" }}</div>
<div class="user" >
{{ attachment.Sender }}
</div>
</div>
<span class="document-type" *ngIf="isSelectedAttachmentIsDraft(attachment)">Rascunho</span>
<br *ngIf="isSelectedAttachmentIsDraft(attachment)">
<div class="date d-flex justify-content-between">
<div>
{{ attachment.DocDate | date: 'dd/MM/yy' }}
<div (click)="clickDocument(attachment, i )">
<button mat-icon-button aria-label="Example icon-button with a menu">
<ion-icon src="assets/images/icons-nav-actions.svg" class=" font-25-em "></ion-icon>
</button>
</div>
<div>
<button (click)="doSomething($event);" mat-icon-button [matMenuTriggerFor]="menu" aria-label="Example icon-button with a menu">
<mat-icon>more_vert</mat-icon>
</button>
@@ -41,7 +44,6 @@
<span>Assinar</span>
</button>
</mat-menu>
</div>
</div>
@@ -1,7 +1,16 @@
@import '~src/function.scss';
.subject {
font-size: rem(18);
width: 100%;
color:#0d89d1;
padding-bottom: 5px;
}
/* SPAN */
.user{
font-size: rem(15);
}
.card-text {
max-width: 350px;
border: 1px solid #3498db;
color: #3498db;
background: white;
@@ -14,7 +23,9 @@
margin: 0px;
}
.subject {
max-width: 230px;
}
}
iframe {
@@ -29,6 +40,10 @@ iframe {
.user, .date {
color: #3498db !important;
}
.subject {
max-width: unset !important;
}
}
.document-type{
@@ -66,17 +66,19 @@ export class ViewerAttachmentPage implements OnInit {
}
try {
setTimeout(async ()=> {
this.selectedIndex = i;
this.iframeContainer.nativeElement.style.display = 'none'
const requestI = this.selectedIndex
const linkRequest = await this.middlewareRepositoryService.getViewerLink({
ApplicationId: viewerAttachment.ApplicationId,
DocId: viewerAttachment.DocId
})
// alert(`ApplicationId:${viewerAttachment.ApplicationId}, DocId: ${viewerAttachment.DocId}`)
if(linkRequest.isOk()) {
if(linkRequest.isOk() && requestI == this.selectedIndex) {
// Optionally, you can add new content or recreate the iframe
var newIframe = document.createElement('iframe');
@@ -87,7 +89,6 @@ export class ViewerAttachmentPage implements OnInit {
newIframe.height = '100%'
this.iframeContainer.nativeElement.innerHTML = ""
setTimeout
this.iframeContainer.nativeElement.appendChild(newIframe)
} else {
@@ -96,15 +97,19 @@ export class ViewerAttachmentPage implements OnInit {
this.loading = false
this.iframeContainer.nativeElement.style.display = 'flex'
} else if (requestI != this.selectedIndex) {
} else {
this.loading = false
this.iframeContainer.nativeElement.style.display = 'none'
}
}, 1000)
} catch (error) {
setTimeout(async ()=> {
this.clickDocument(viewerAttachment, i);
}, 1000)
}