mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 21:06:06 +00:00
Last git pull made
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
<div class="buttons">
|
||||
<button (click)="takePicture()" full class="btn-cancel hide-desktop" shape="round" >Tirar Fotografia</button>
|
||||
<button (click)="addPicture()" full class="btn-cancel" shape="round" >Anexar Fotografia</button>
|
||||
<button hidden (click)="addDocument()" class="btn-cancel" shape="round" >Documento</button>
|
||||
<button (click)="addDocument()" class="btn-cancel" shape="round" >Documento</button>
|
||||
<button (click)="addDocGestaoDocumental()" class="btn-cancel" shape="round" >Anexar Documento (G.D.)</button>
|
||||
<div class="solid"></div>
|
||||
<button (click)="bookMeeting()" class="btn-cancel" shape="round" >Novo Evento</button>
|
||||
|
||||
@@ -14,9 +14,8 @@
|
||||
</ion-header>
|
||||
|
||||
<ion-content class="pt-10 height-100">
|
||||
|
||||
|
||||
<div *ngIf="pdfSrc" class="height-100">
|
||||
<iframe id="iframe" src="https://equilibrium.dyndns.info/FileShare/pdfjs/web/viewer.html?file=https://equilibrium.dyndns.info/FileShare/merged_fastview.pdf" height="100%" width="100%" title="Iframe Example"></iframe>
|
||||
<iframe id="iframe" src="https://equilibrium.dyndns.info/FileShare/pdfjs/web/viewer.html?file=https://equilibrium.dyndns.info/FileShare/merged_fastview.pdf&caches=12321231231f23123" height="100%" width="100%" title="Iframe Example"></iframe>
|
||||
</div>
|
||||
|
||||
</ion-content>
|
||||
|
||||
@@ -1,14 +1,3 @@
|
||||
ion-content {
|
||||
background-color: #ececec;
|
||||
}
|
||||
|
||||
.ng2-pdf-viewer-container {
|
||||
padding-top: 10px;
|
||||
}
|
||||
|
||||
#pdf-container {
|
||||
canvas {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
@@ -10,7 +10,7 @@ import { ProcessesService } from 'src/app/services/processes.service';
|
||||
})
|
||||
export class DocumentViewerPage implements OnInit {
|
||||
|
||||
pdfSrc = 'http://laptop-46/FileShare/Test_25MB.pdf';
|
||||
pdfSrc = null;
|
||||
task = null
|
||||
DocId = null
|
||||
fileName = ''
|
||||
@@ -24,10 +24,7 @@ export class DocumentViewerPage implements OnInit {
|
||||
this.task = this.navParams.get('task') || null;
|
||||
this.DocId = this.navParams.get('DocId');
|
||||
|
||||
if(this.navParams.get('pdfSrc')) {
|
||||
this.pdfSrc = this.navParams.get('pdfSrc') || null;
|
||||
}
|
||||
|
||||
this.pdfSrc = 'https://equilibrium.dyndns.info/FileShare/pdfjs/web/viewer.html?file='
|
||||
|
||||
}
|
||||
|
||||
@@ -41,169 +38,6 @@ export class DocumentViewerPage implements OnInit {
|
||||
|
||||
})
|
||||
|
||||
// this.setPdfViewer()
|
||||
|
||||
|
||||
// setTimeout(() => {
|
||||
|
||||
// document.getElementById('iframe')['contentWindow'].postMessage(
|
||||
// {
|
||||
// sender: "get_page_button1",
|
||||
// message: 'url'
|
||||
// }, "*")
|
||||
|
||||
// }, 3000)
|
||||
|
||||
}
|
||||
|
||||
|
||||
setPdfViewer() {
|
||||
setTimeout( async () => {
|
||||
|
||||
// If absolute URL from the remote server is provided, configure the CORS
|
||||
// header on that server.
|
||||
var url = 'http://192.168.0.87:3000/000634977.pdf';
|
||||
|
||||
const pdfjsWorker = await import('pdfjs-dist/build/pdf.worker.entry');
|
||||
// Loaded via <script> tag, create shortcut to access PDF.js exports.
|
||||
var pdfjsLib = await import('pdfjs-dist/build/pdf');
|
||||
|
||||
// The workerSrc property shall be specified.
|
||||
// pdfjsLib.GlobalWorkerOptions.workerSrc = '//mozilla.github.io/pdf.js/build/pdf.worker.js';
|
||||
pdfjsLib.GlobalWorkerOptions.workerSrc = pdfjsWorker;
|
||||
|
||||
var pdfDoc = null,
|
||||
pageNum = 1,
|
||||
pageRendering = false,
|
||||
pageNumPending = null,
|
||||
scale = 0.8,
|
||||
canvas: any = document.getElementById('the-canvas'),
|
||||
ctx = canvas.getContext('2d');
|
||||
|
||||
/**
|
||||
* Get page info from document, resize canvas accordingly, and render page.
|
||||
* @param num Page number.
|
||||
*/
|
||||
function renderPage(num) {
|
||||
pageRendering = true;
|
||||
// Using promise to fetch the page
|
||||
pdfDoc.getPage(num).then(function(page) {
|
||||
var viewport = page.getViewport({scale: scale});
|
||||
canvas.height = viewport.height;
|
||||
canvas.width = viewport.width;
|
||||
|
||||
// Render PDF page into canvas context
|
||||
var renderContext = {
|
||||
canvasContext: ctx,
|
||||
viewport: viewport
|
||||
};
|
||||
var renderTask = page.render(renderContext);
|
||||
|
||||
// Wait for rendering to finish
|
||||
renderTask.promise.then(function() {
|
||||
pageRendering = false;
|
||||
if (pageNumPending !== null) {
|
||||
// New page rendering is pending
|
||||
renderPage(pageNumPending);
|
||||
pageNumPending = null;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// Update page counters
|
||||
// document.getElementById('page_num').textContent = num;
|
||||
}
|
||||
|
||||
/**
|
||||
* If another page rendering in progress, waits until the rendering is
|
||||
* finised. Otherwise, executes rendering immediately.
|
||||
*/
|
||||
function queueRenderPage(num) {
|
||||
if (pageRendering) {
|
||||
pageNumPending = num;
|
||||
} else {
|
||||
renderPage(num);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays previous page.
|
||||
*/
|
||||
function onPrevPage() {
|
||||
if (pageNum <= 1) {
|
||||
return;
|
||||
}
|
||||
pageNum--;
|
||||
queueRenderPage(pageNum);
|
||||
}
|
||||
|
||||
document.getElementById('prev').addEventListener('click', onPrevPage);
|
||||
|
||||
/**
|
||||
* Displays next page.
|
||||
*/
|
||||
function onNextPage() {
|
||||
if (pageNum >= pdfDoc.numPages) {
|
||||
return;
|
||||
}
|
||||
pageNum++;
|
||||
queueRenderPage(pageNum);
|
||||
}
|
||||
|
||||
document.getElementById('next').addEventListener('click', onNextPage);
|
||||
|
||||
var currPage = 1; //Pages are 1-based not 0-based
|
||||
var numPages = 0;
|
||||
var thePDF = null;
|
||||
|
||||
|
||||
function handlePages(page)
|
||||
{
|
||||
//This gives us the page's dimensions at full scale
|
||||
var viewport = page.getViewport( 1 );
|
||||
|
||||
//We'll create a canvas for each page to draw it on
|
||||
var canvas = document.createElement( "canvas" );
|
||||
canvas.style.display = "block";
|
||||
var context = canvas.getContext('2d');
|
||||
canvas.height = viewport.height;
|
||||
canvas.width = viewport.width;
|
||||
|
||||
//Draw it on the canvas
|
||||
page.render({canvasContext: context, viewport: viewport});
|
||||
|
||||
//Add it to the web page
|
||||
document.querySelector('#pdf-container').appendChild( canvas );
|
||||
|
||||
//Move to next page
|
||||
currPage++;
|
||||
if ( thePDF !== null && currPage <= numPages )
|
||||
{
|
||||
thePDF.getPage( currPage ).then( handlePages );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Asynchronously downloads PDF.
|
||||
*/
|
||||
pdfjsLib.getDocument(url).promise.then(function(pdfDoc_) {
|
||||
|
||||
pdfDoc = pdfDoc_;
|
||||
thePDF = pdfDoc_
|
||||
|
||||
pdfDoc.getPage(1).then(function(page) {
|
||||
// you can now use *page* here
|
||||
// alert('first page')
|
||||
});
|
||||
|
||||
// Initial/first page rendering
|
||||
renderPage(pageNum);
|
||||
|
||||
numPages = pdfDoc.numPages;
|
||||
pdfDoc.getPage( 1 ).then( handlePages );
|
||||
});
|
||||
|
||||
}, 100)
|
||||
}
|
||||
|
||||
close() {
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
</div>
|
||||
|
||||
</ion-col>
|
||||
<ion-col class="align-center d-flex">
|
||||
<ion-col hidden class="align-center d-flex">
|
||||
<div (click)="addFingerprint()" class="d-flex align-center">
|
||||
<ion-checkbox class="checkBox" [checked]="false"></ion-checkbox>
|
||||
Impressão Digital
|
||||
|
||||
@@ -65,7 +65,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</ion-list>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -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