Bladeren bron

downlod attachment is done.

tags/2.037
Patrick Sun 4 jaren geleden
bovenliggende
commit
f202fc5755
3 gewijzigde bestanden met toevoegingen van 20 en 4 verwijderingen
  1. +6
    -0
      src/app/service/upload.attach.service.ts
  2. +2
    -1
      src/app/upload-cards/upload-cards.component.html
  3. +12
    -3
      src/app/upload-cards/upload-cards.component.ts

+ 6
- 0
src/app/service/upload.attach.service.ts Bestand weergeven

@@ -32,6 +32,12 @@ export class UploadAttachService {
const ts = Date.now();
return this.auth.getUrl('upload-as-pdf/' + id + '?date=' + ts);
}

public getUploadAsOriginalUrl(id: number): string {
const ts = Date.now();
return this.auth.getUrl('upload-original/' + id + '?date=' + ts + '&download=force');
}

public getUploadAsPdfUrlDefault(): string {
const ts = Date.now();
return this.auth.getUrl('upload-as-pdf/default' + '?date=' + ts);

+ 2
- 1
src/app/upload-cards/upload-cards.component.html Bestand weergeven

@@ -11,8 +11,9 @@
</kendo-card-body>
<kendo-card-footer>
<button class="action" kendoButton icon="track-changes" (click)="onNavigateTo(uploadId)"></button>
<button class="action" kendoButton icon="download" (click)="onDownload(uploadId)"></button>
<button class="action" kendoButton icon="download" (click)="onDownload(uploadId)" ></button>
<button class="action" kendoButton icon="search" (click)="onSearch(uploadId)" ></button>
<a #downloadLink ></a>
</kendo-card-footer>



+ 12
- 3
src/app/upload-cards/upload-cards.component.ts Bestand weergeven

@@ -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);

Laden…
Annuleren
Opslaan