mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 13:02:56 +00:00
replicate download file from chat conversation mobile and web
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { Routes, RouterModule } from '@angular/router';
|
||||
|
||||
import { ViewDocumentPage } from './view-document.page';
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
component: ViewDocumentPage
|
||||
}
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [RouterModule.forChild(routes)],
|
||||
exports: [RouterModule],
|
||||
})
|
||||
export class ViewDocumentPageRoutingModule {}
|
||||
@@ -0,0 +1,22 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
|
||||
import { IonicModule } from '@ionic/angular';
|
||||
|
||||
import { ViewDocumentPageRoutingModule } from './view-document-routing.module';
|
||||
|
||||
import { ViewDocumentPage } from './view-document.page';
|
||||
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
FormsModule,
|
||||
IonicModule,
|
||||
FontAwesomeModule,
|
||||
ViewDocumentPageRoutingModule
|
||||
],
|
||||
declarations: [ViewDocumentPage]
|
||||
})
|
||||
export class ViewDocumentPageModule {}
|
||||
@@ -0,0 +1,25 @@
|
||||
<ion-header class="ion-no-border">
|
||||
<ion-toolbar class="d-flex">
|
||||
<div class="d-flex align-items-center px-20 pt-20 font-25">
|
||||
<div class="left cursor-pointer" (click)="close()">
|
||||
<!-- <ion-icon class="font-35" src="assets/images/icons-arrow-arrow-left.svg"></ion-icon> -->
|
||||
<fa-icon icon="chevron-left" class="menu-icon"></fa-icon>
|
||||
</div>
|
||||
|
||||
<div class="middle">
|
||||
{{file.title}}
|
||||
</div>
|
||||
|
||||
<div class="right cursor-pointer">
|
||||
<fa-icon icon="ellipsis-v" class="menu-icon"></fa-icon>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</ion-toolbar>
|
||||
</ion-header>
|
||||
|
||||
<ion-content class="pt-10 height-100">
|
||||
<div class="height-100">
|
||||
<iframe id="iframe" [src]="trustedUrl" height="100%" width="100%" title="Iframe Example"></iframe>
|
||||
</div>
|
||||
</ion-content>
|
||||
@@ -0,0 +1,11 @@
|
||||
.left{
|
||||
float: left;
|
||||
}
|
||||
.middle{
|
||||
float: left;
|
||||
padding-left: 5px !important;
|
||||
}
|
||||
.right{
|
||||
float: right;
|
||||
margin-left: auto;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
||||
import { IonicModule } from '@ionic/angular';
|
||||
|
||||
import { ViewDocumentPage } from './view-document.page';
|
||||
|
||||
describe('ViewDocumentPage', () => {
|
||||
let component: ViewDocumentPage;
|
||||
let fixture: ComponentFixture<ViewDocumentPage>;
|
||||
|
||||
beforeEach(waitForAsync(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ ViewDocumentPage ],
|
||||
imports: [IonicModule.forRoot()]
|
||||
}).compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(ViewDocumentPage);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
}));
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,40 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { DomSanitizer } from '@angular/platform-browser';
|
||||
import { ModalController, NavParams } from '@ionic/angular';
|
||||
|
||||
@Component({
|
||||
selector: 'app-view-document',
|
||||
templateUrl: './view-document.page.html',
|
||||
styleUrls: ['./view-document.page.scss'],
|
||||
})
|
||||
export class ViewDocumentPage implements OnInit {
|
||||
|
||||
url: string;
|
||||
a:string = "https://equilibrium.dyndns.info/FileShare/pdfjs/web/viewer.html?file=";
|
||||
viewerUrl: string;
|
||||
trustedUrl: any;
|
||||
file:any;
|
||||
|
||||
constructor(
|
||||
private modalController: ModalController,
|
||||
private navParams: NavParams,
|
||||
private sanitazer: DomSanitizer,
|
||||
) {
|
||||
|
||||
this.file = this.navParams.get('file');
|
||||
this.url = this.file.title_link;
|
||||
console.log(this.url);
|
||||
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.viewerUrl = this.url.replace("webTRIX.Viewer.Branch1/pdfjs/web/viewpdf.aspx?file=/webTRIX.Viewer.Branch1/arq/637690403731947760.pdf&i", "FileShare/pdfjs/web/viewer.html?file");
|
||||
this.trustedUrl = this.sanitazer.bypassSecurityTrustResourceUrl(this.viewerUrl);
|
||||
console.log(this.trustedUrl);
|
||||
}
|
||||
|
||||
close() {
|
||||
this.modalController.dismiss();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user