viewer hot-fix

This commit is contained in:
Peter Maquiran
2021-10-08 19:29:21 +01:00
parent 405c989b87
commit 9ceb915fef
37 changed files with 708 additions and 360 deletions
@@ -4,7 +4,7 @@ import { ModalController, NavParams } from '@ionic/angular';
import { Event } from 'src/app/models/event.model'
import { EventPerson } from 'src/app/models/eventperson.model';
import { SearchPage } from 'src/app/pages/search/search.page';
import { SearchDocumentDetails, SearchFolderDetails, SearchFolderDetailsDocuments, SearchList } from 'src/app/models/search-document';
import { SearchDocumentDetails, SearchFolderDetails, SearchList } from 'src/app/models/search-document';
import { LoginUserRespose } from 'src/app/models/user.model';
import { AuthService } from 'src/app/services/auth.service';
import { AttendeesPageModal } from 'src/app/pages/events/attendees/attendees.page';
@@ -14,7 +14,6 @@ import * as _moment from 'moment';
import * as _rollupMoment from 'moment';
import { NgxMatDateFormats } from '@angular-material-components/datetime-picker';
import { NGX_MAT_DATE_FORMATS } from '@angular-material-components/datetime-picker';
import { DocumentService } from 'src/app/Rules/document.service';
import { EventsService } from 'src/app/services/events.service';
import { EventService } from 'src/app/services/rules/event.service';
import { EventPipe } from 'src/app/pipes/event.pipe';
@@ -62,7 +61,6 @@ export class DocumentSetUpMeetingPage implements OnInit {
EventRecurrenceType = '-1'
showLoader = false
@ViewChild('picker') picker: any;
@ViewChild('fim') fim: any;
@ViewChild('inicio') inicio: any;
@@ -97,34 +95,30 @@ export class DocumentSetUpMeetingPage implements OnInit {
private navParams: NavParams,
authService: AuthService,
private toastService: ToastService,
private documentService: DocumentService,
private calendarService: EventsService,
private eventService: EventService
) {
) {
this.loggeduser = authService.ValidatedUser;
this.document = this.navParams.get('document')
this.subject = this.navParams.get('subject')
this.loggeduser = authService.ValidatedUser;
this.document = this.navParams.get('document')
this.subject = this.navParams.get('subject')
this.postData = new Event();
this.postData.Body ={ BodyType : "1", Text : ""};
this.postData = new Event();
this.postData.Body ={ BodyType : "1", Text : ""};
this.postData.Subject = this.subject
this.postData.CalendarName = "Oficial";
this.postData.Subject = this.subject
this.postData.CalendarName = "Oficial";
this.postData.Category = 'Reunião'
this.postData.Category = 'Reunião'
}
ngOnInit() {
this.adding = "intervenient";
this.setDefaultTime()
this.getRecurrenceTypes();
console.log(this.document);
}
getRecurrenceTypes() {
this.calendarService.getRecurrenceTypes().subscribe(res=>{
this.calendarService.getRecurrenceTypes().subscribe( res=> {
this.recurringTypes = res;
});
}
@@ -178,43 +172,12 @@ export class DocumentSetUpMeetingPage implements OnInit {
let Attendees = this.taskParticipants.concat(this.taskParticipantsCc);
var Attachments: addAttachment[] = []
let folder: SearchFolderDetails = this.document
let document: SearchDocumentDetails = this.document
/* if(folder.Documents) {
this.document.Documents.forEach( (_folder: SearchFolderDetailsDocuments) => {
Attachments.push({
ApplicationId: 361,
Source: 1,
SourceId: _folder['docID'] || _folder['docId'] || _folder.DocId,
SourceTitle: _folder.Assunto,
})
});
} else {
Attachments.push({
ApplicationId: 8,
Source: 1,
SourceId: document['docID'] || document['docId'] || document.DocId,
SourceTitle: document.Assunto
})
}
this.attachments.forEach((e)=> {
Attachments.push({
ApplicationId: e.ApplicationType,
Source: 1,
SourceId: e.Id,
SourceTitle: e.Assunto
})
}) */
if(this.document.Documents){
this.document.Documents.forEach((e)=> {
this.docs.push({
ApplicationId: e.ApplicationId || e.ApplicationType,
Source: 1,
SourceId: e.DocId || e.docID || e.docId,
SourceId: e.DocId || e.docID || e.docId || e.SourceId,
SourceName: e.Assunto
})
})
@@ -223,13 +186,11 @@ export class DocumentSetUpMeetingPage implements OnInit {
this.docs.push({
ApplicationId: this.document.ApplicationId || this.document.ApplicationType,
Source: 1,
SourceId: this.document.DocId || this.document.docID || this.document.docId,
SourceId: this.document.DocId || this.document.docID || this.document.docId || this.document.SourceId,
SourceName: this.document.Assunto
})
}
console.log(this.docs);
let postEvent = {
EventId: '',
Subject: this.postData.Subject,
@@ -255,28 +216,17 @@ export class DocumentSetUpMeetingPage implements OnInit {
Attachments: this.docs,
}
console.log(postEvent);
const laoder = this.toastService.loading()
this.eventService.create({ body: postEvent, calendar: this.postData.CalendarName }).subscribe(async (respose) => {
const res: any = respose;
const eventId: string = res
/* const DocumentToSave = this.attachments.map((e) => {
return this.eventPipe.AttactSearchResult(e, eventId, {})
});
await DocumentToSave.forEach(async (attachments, i) => {
await this.eventService.addAttachment(attachments).toPromise();
}); */
this.toastService.successMessage('Reunião criada')
laoder.remove()
this.toastService.successMessage('Reunião criada')
this.modalController.dismiss()
},(error) => {
}, (error) => {
laoder.remove()
this.toastService.badRequest('Não foi possível marcar a reunião');
}, ()=>{
laoder.remove()
});
}
@@ -2,7 +2,6 @@
<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>
@@ -10,7 +9,7 @@
{{file.title}}
</div>
<div class="right cursor-pointer">
<div class="right cursor-pointer" (click)="openOptions()">
<fa-icon icon="ellipsis-v" class="menu-icon"></fa-icon>
</div>
@@ -19,7 +18,12 @@
</ion-header>
<ion-content class="pt-10 height-100">
<div class="height-100">
<div class="height-100" *ngIf="trustedUrl">
<iframe id="iframe" [src]="trustedUrl" height="100%" width="100%" title="Iframe Example"></iframe>
</div>
<div *ngIf="!trustedUrl" class=" height-100 width-100 d-flex align-center justify-center">
<img src="/assets/images/Blocks-loader.gif" />
</div>
</ion-content>
@@ -1,7 +1,13 @@
import { Component, OnInit } from '@angular/core';
import { DomSanitizer } from '@angular/platform-browser';
import { ModalController, NavParams } from '@ionic/angular';
import { ExpedientTaskModalPageNavParamsTask } from 'src/app/models/ExpedientTaskModalPage';
import { SearchDocumentDetails, SearchFolderDetails } from 'src/app/models/search-document';
import { ExpedientTaskModalPage } from 'src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page';
import { ProcessesService } from 'src/app/services/processes.service';
import { EventDetailsDocumentsOptionsPage } from 'src/app/shared/popover/event-details-documents-options/event-details-documents-options.page';
import { DocumentSetUpMeetingPage } from '../document-set-up-meeting/document-set-up-meeting.page';
8
@Component({
selector: 'app-view-document',
templateUrl: './view-document.page.html',
@@ -13,28 +19,122 @@ export class ViewDocumentPage implements OnInit {
a:string = "https://equilibrium.dyndns.info/FileShare/pdfjs/web/viewer.html?file=";
viewerUrl: string;
trustedUrl: any;
file:any;
file: any;
sourceId: any;
applicationId: any;
LoadedDocument: any;
docId: any
folderId: any
task: ExpedientTaskModalPageNavParamsTask;
Document: any
constructor(
private modalController: ModalController,
private navParams: NavParams,
private sanitazer: DomSanitizer,
private processes: ProcessesService,
) {
this.file = this.navParams.get('file');
this.url = this.file.title_link;
console.log(this.url);
this.sourceId = this.navParams.get('sourceId');
this.applicationId = this.navParams.get('applicationId');
this.docId = this.navParams.get('docId');
this.folderId = this.navParams.get('folderId')
this.Document = this.navParams.get('Document')
}
// console.log('this.Document', this.Document)
// if(this.Document.ApplicationId == 361) {
// this.sourceId = this.folderId
// } else if(this.Document.ApplicationId == 8) {
// this.sourceId = this.Document.DocId || this.Document.SourceId
// }
}
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);
this.processes.GetViewer(this.docId, this.applicationId).subscribe(res=>{
const link: string = res
this.trustedUrl = this.sanitazer.bypassSecurityTrustResourceUrl(link);
console.log('trustedUrl', this.trustedUrl)
})
//this.getDetails()
}
close() {
this.modalController.dismiss();
}
async openOptions() {
const modal = await this.modalController.create({
component: EventDetailsDocumentsOptionsPage,
cssClass: 'model aside-modal search-submodal',
componentProps: {
fulltask: this.task,
task: this.task
}
});
await modal.present();
modal.onDidDismiss().then((res)=>{
if(res.data.component == 'openBookMeetingModal') {
this.openBookMeetingModal()
} else if(res.data.component == 'openExpedientActionsModal') {
this.openExpedientActionsModal(res.data.taskAction)
} else {
console.log('component not found')
}
})
}
async openBookMeetingModal() {
let classs;
if( window.innerWidth < 701) {
classs = 'book-meeting-modal modal modal-desktop'
} else {
classs = 'modal modal-desktop showAsideOptions'
}
const modal = await this.modalController.create({
component: DocumentSetUpMeetingPage,
componentProps: {
subject: this.task.workflowInstanceDataFields.Subject,
document: this.LoadedDocument,
},
cssClass: classs,
backdropDismiss: false
});
await modal.present();
modal.onDidDismiss().then(res=>{
//this.location.back();
});
}
// efetuar despacho
async openExpedientActionsModal( taskAction: any) {
let classs;
if( window.innerWidth < 701) {
classs = 'modal modal-desktop'
} else {
classs = 'modal modal-desktop showAsideOptions'
}
const modal = await this.modalController.create({
component: ExpedientTaskModalPage,
componentProps: {
taskAction: taskAction,
task: this.task,
seachDocuments: this.LoadedDocument,
aplicationId: this.LoadedDocument.ApplicationId || this.LoadedDocument.ApplicationID
},
cssClass: classs,
});
await modal.present();
modal.onDidDismiss().then( async(res)=>{});
}
}