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" <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}" 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 class="attach-title-item tex-left d-flex">
<div>{{ attachment.Assunto || "Sem assunto" }}</div> <div>
<div class="subject" [ngClass]="{'add-ellipsis': i != selectedIndex}">{{ attachment.Assunto || "Sem assunto" }}</div>
<div class="user" > <div class="user" >
{{ attachment.Sender }} {{ attachment.Sender }}
</div> </div>
</div>
<span class="document-type" *ngIf="isSelectedAttachmentIsDraft(attachment)">Rascunho</span> <span class="document-type" *ngIf="isSelectedAttachmentIsDraft(attachment)">Rascunho</span>
<br *ngIf="isSelectedAttachmentIsDraft(attachment)"> <br *ngIf="isSelectedAttachmentIsDraft(attachment)">
<div class="date d-flex justify-content-between"> <div class="date d-flex justify-content-between">
<div> <div (click)="clickDocument(attachment, i )">
{{ attachment.DocDate | date: 'dd/MM/yy' }} <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>
<div> <div>
<button (click)="doSomething($event);" mat-icon-button [matMenuTriggerFor]="menu" aria-label="Example icon-button with a menu"> <button (click)="doSomething($event);" mat-icon-button [matMenuTriggerFor]="menu" aria-label="Example icon-button with a menu">
<mat-icon>more_vert</mat-icon> <mat-icon>more_vert</mat-icon>
</button> </button>
@@ -41,7 +44,6 @@
<span>Assinar</span> <span>Assinar</span>
</button> </button>
</mat-menu> </mat-menu>
</div> </div>
</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 { .card-text {
max-width: 350px;
border: 1px solid #3498db; border: 1px solid #3498db;
color: #3498db; color: #3498db;
background: white; background: white;
@@ -14,7 +23,9 @@
margin: 0px; margin: 0px;
} }
.subject {
max-width: 230px;
}
} }
iframe { iframe {
@@ -29,6 +40,10 @@ iframe {
.user, .date { .user, .date {
color: #3498db !important; color: #3498db !important;
} }
.subject {
max-width: unset !important;
}
} }
.document-type{ .document-type{
@@ -66,17 +66,19 @@ export class ViewerAttachmentPage implements OnInit {
} }
try { try {
setTimeout(async ()=> {
this.selectedIndex = i; this.selectedIndex = i;
this.iframeContainer.nativeElement.style.display = 'none'
const requestI = this.selectedIndex
const linkRequest = await this.middlewareRepositoryService.getViewerLink({ const linkRequest = await this.middlewareRepositoryService.getViewerLink({
ApplicationId: viewerAttachment.ApplicationId, ApplicationId: viewerAttachment.ApplicationId,
DocId: viewerAttachment.DocId DocId: viewerAttachment.DocId
}) })
// alert(`ApplicationId:${viewerAttachment.ApplicationId}, DocId: ${viewerAttachment.DocId}`) if(linkRequest.isOk() && requestI == this.selectedIndex) {
if(linkRequest.isOk()) {
// Optionally, you can add new content or recreate the iframe // Optionally, you can add new content or recreate the iframe
var newIframe = document.createElement('iframe'); var newIframe = document.createElement('iframe');
@@ -87,7 +89,6 @@ export class ViewerAttachmentPage implements OnInit {
newIframe.height = '100%' newIframe.height = '100%'
this.iframeContainer.nativeElement.innerHTML = "" this.iframeContainer.nativeElement.innerHTML = ""
setTimeout
this.iframeContainer.nativeElement.appendChild(newIframe) this.iframeContainer.nativeElement.appendChild(newIframe)
} else { } else {
@@ -96,15 +97,19 @@ export class ViewerAttachmentPage implements OnInit {
this.loading = false this.loading = false
this.iframeContainer.nativeElement.style.display = 'flex' this.iframeContainer.nativeElement.style.display = 'flex'
} else if (requestI != this.selectedIndex) {
} else { } else {
this.loading = false this.loading = false
this.iframeContainer.nativeElement.style.display = 'none' this.iframeContainer.nativeElement.style.display = 'none'
} }
}, 1000)
} catch (error) { } catch (error) {
setTimeout(async ()=> {
this.clickDocument(viewerAttachment, i); this.clickDocument(viewerAttachment, i);
}, 1000)
} }