|
|
|
@@ -1,4 +1,4 @@ |
|
|
|
import {Component, EventEmitter, Input, OnInit, Output, ViewChild} from '@angular/core'; |
|
|
|
import {Component, ElementRef, EventEmitter, Input, OnInit, Output, ViewChild} from '@angular/core'; |
|
|
|
import {Router} from '@angular/router'; |
|
|
|
import {ImagePopupDialogComponent} from '../image-popup-dialog/image-popup-dialog.component'; |
|
|
|
import {AuthService} from '../service/auth.service'; |
|
|
|
@@ -16,6 +16,7 @@ export class UploadCardsComponent implements OnInit { |
|
|
|
@Input() uploadId: number; |
|
|
|
@Input() icon = ''; |
|
|
|
@ViewChild('imgBox', {static: true}) imgBox: ImagePopupDialogComponent; |
|
|
|
@ViewChild('downloadLink', {static: true}) downloadLink: ElementRef<HTMLAnchorElement>; |
|
|
|
public uploadMeta: UploadMetaModel = new UploadMetaModel({}); |
|
|
|
|
|
|
|
public thumbImage = 'https://svr2021.lawipac.com:8080/api/v1/upload-as-thumbnail/31'; |
|
|
|
@@ -36,11 +37,19 @@ export class UploadCardsComponent implements OnInit { |
|
|
|
} |
|
|
|
|
|
|
|
public onNavigateTo(id: number ): void{ |
|
|
|
this.router.navigate(['/upload-details/' + id]); |
|
|
|
this.router.navigate(['/upload-details/', id]); |
|
|
|
} |
|
|
|
|
|
|
|
public urlForDownload(id: number ): string{ |
|
|
|
return this.uas.getUploadAsOriginalUrl(id); |
|
|
|
} |
|
|
|
|
|
|
|
public onDownload(id: number ): void{ |
|
|
|
this.router.navigate(['/upload-details/' + id]); |
|
|
|
const el = this.downloadLink.nativeElement; |
|
|
|
el.href = this.urlForDownload(id); |
|
|
|
el.click(); |
|
|
|
} |
|
|
|
|
|
|
|
public onSearch(id: number ): void{ |
|
|
|
this.popupImage(this.fullImage); |
|
|
|
// this.popupImage(this.thumbImage); |