mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
viewer hot-fix
This commit is contained in:
@@ -33,7 +33,6 @@
|
||||
|
||||
<span class="date">{{loadedEvent.Location}}</span>
|
||||
|
||||
|
||||
<div *ngIf="loadedEvent.Organizer">
|
||||
<div *ngIf="loadedEvent.Organizer.Name == 'Agenda do Presidente da República' ">
|
||||
<span class="label" *ngIf="loadedEvent.CalendarName == 'Oficial' " style="background-color: #99e47b;">{{loadedEvent.CalendarName}}</span>
|
||||
@@ -82,8 +81,8 @@
|
||||
<h5>Documentos Anexados</h5>
|
||||
<ion-list class="width-100">
|
||||
<li *ngFor="let attach of loadedEvent.Attachments; let i = index" class="width-100" lines="none" class="ion-no-margin ion-no-padding pa-0">
|
||||
<ion-label class="width-100 d-flex align-center" >
|
||||
<p class="flex-grow-1" (click)="viewDocument(attach.SourceId)">
|
||||
<ion-label class="width-100 d-flex align-center" (click)="docIndex(i);LoadDocumentDetails()" >
|
||||
<p class="flex-grow-1" >
|
||||
<span class="attach-title-item d-block">{{attach.SourceName}}</span>
|
||||
<span class="span-left d-block">{{attach.Stakeholders}}</span>
|
||||
</p>
|
||||
|
||||
@@ -13,6 +13,8 @@ import { ExpedientTaskModalPageNavParamsTask } from 'src/app/models/ExpedientTas
|
||||
import { DocumentSetUpMeetingPage } from 'src/app/modals/document-set-up-meeting/document-set-up-meeting.page';
|
||||
import { ExpedientTaskModalPage } from 'src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page';
|
||||
import { SearchedDocumentOptionsPage } from '../../popover/searched-document-options/searched-document-options.page';
|
||||
import { EventDetailsDocumentsOptionsPage } from '../../popover/event-details-documents-options/event-details-documents-options.page';
|
||||
import { ViewDocumentPage } from 'src/app/modals/view-document/view-document.page';
|
||||
|
||||
@Component({
|
||||
selector: 'app-view-event',
|
||||
@@ -85,8 +87,7 @@ export class ViewEventPage implements OnInit {
|
||||
this.dicIndex = index;
|
||||
}
|
||||
|
||||
close(){
|
||||
console.log(this.isEventEdited);
|
||||
close() {
|
||||
|
||||
this.viewEventDetailDismiss.emit({
|
||||
type: 'close'
|
||||
@@ -101,8 +102,6 @@ export class ViewEventPage implements OnInit {
|
||||
this.customDate = this.days[this.today.getDay()]+ ", " + this.today.getDate() +" de " + ( this.months[this.today.getMonth()]);
|
||||
}, (error)=> {
|
||||
|
||||
// console.log('errer', )
|
||||
|
||||
this.viewEventDetailDismiss.emit({
|
||||
type: 'close'
|
||||
})
|
||||
@@ -139,7 +138,6 @@ export class ViewEventPage implements OnInit {
|
||||
()=>{
|
||||
loader.remove();
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -156,7 +154,6 @@ export class ViewEventPage implements OnInit {
|
||||
modal.onDidDismiss().then((res) => {
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
async editEvent() {
|
||||
@@ -168,155 +165,115 @@ export class ViewEventPage implements OnInit {
|
||||
|
||||
viewDocument(sourceId) {
|
||||
this.processes.GetDocumentUrl(sourceId, '8').subscribe(res=>{
|
||||
console.log(res);
|
||||
const url: string = res.replace("webTRIX.Viewer","webTRIX.Viewer.Branch1");
|
||||
const browser = this.iab.create(url,"_blank");
|
||||
browser.show();
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
async LoadDocumentDetails() {
|
||||
|
||||
const docId = this.loadedEvent.Attachments[ this.dicIndex].SourceId
|
||||
const applicationId = this.loadedEvent.Attachments[ this.dicIndex].ApplicationId
|
||||
const applicationId: any = this.loadedEvent.Attachments[ this.dicIndex].ApplicationId
|
||||
|
||||
console.log(this.loadedEvent.Attachments[ this.dicIndex])
|
||||
// this.processes.GetDocumentDetails(docId, applicationId).subscribe( async(res)=> {
|
||||
|
||||
// this.LoadedDocument = res;
|
||||
// this.LoadedDocument.Subject = this.LoadedDocument.Assunto
|
||||
|
||||
this.processes.GetDocumentDetails(docId, applicationId).subscribe( async(res)=> {
|
||||
// let thedate = new Date(this.LoadedDocument.DateDispatch || this.LoadedDocument.DocDate);
|
||||
// this.customDate = this.days[thedate.getDay()]+ ", " + thedate.getDate() +" de " + ( this.months[thedate.getMonth()]);
|
||||
|
||||
this.LoadedDocument = res;
|
||||
this.LoadedDocument.Subject = this.LoadedDocument.Assunto
|
||||
// let task: ExpedientTaskModalPageNavParamsTask
|
||||
// let document: SearchDocumentDetails = this.LoadedDocument
|
||||
// let folder: SearchFolderDetails = this.LoadedDocument
|
||||
|
||||
let thedate = new Date(this.LoadedDocument.DateDispatch || this.LoadedDocument.DocDate);
|
||||
// if(this.LoadedDocument.ApplicationID == 361 || this.LoadedDocument.ApplicationId == 361) {
|
||||
// task = {
|
||||
// serialNumber: folder.DispatchNumber,
|
||||
// taskStartDate: folder.DateDispatch,
|
||||
// isEvent: true,
|
||||
// workflowInstanceDataFields: {
|
||||
// FolderID: folder['FolderId'] || folder['FolderID'] || folder.folderId,
|
||||
// Subject: folder.Assunto,
|
||||
// SourceSecFsID: folder.ApplicationID || folder['ApplicationId'],
|
||||
// SourceType: 'FOLDER',
|
||||
// SourceID: folder.folderId,
|
||||
// DispatchNumber: folder.DispatchNumber
|
||||
// },
|
||||
// }
|
||||
// } else if (document.ApplicationID == 8 || document.ApplicationId == 8) {
|
||||
// task = {
|
||||
// serialNumber: document.DocId,
|
||||
// taskStartDate: document.DocDate,
|
||||
// isEvent: true,
|
||||
// workflowInstanceDataFields: {
|
||||
// FolderID: null,
|
||||
// Subject: document.Assunto,
|
||||
// DispatchNumber: null,
|
||||
// SourceSecFsID: document.ApplicationID || document.ApplicationId,
|
||||
// SourceType: 'DOC',
|
||||
// SourceID: document.DocId,
|
||||
// }
|
||||
// }
|
||||
// } else {
|
||||
// console.log('unexpected ApplicationID')
|
||||
// }
|
||||
|
||||
this.customDate = this.days[thedate.getDay()]+ ", " + thedate.getDate() +" de " + ( this.months[thedate.getMonth()]);
|
||||
|
||||
let task: ExpedientTaskModalPageNavParamsTask
|
||||
let document: SearchDocumentDetails = this.LoadedDocument
|
||||
let folder: SearchFolderDetails = this.LoadedDocument
|
||||
|
||||
if(this.LoadedDocument.ApplicationID == 361 || this.LoadedDocument.ApplicationId == 361) {
|
||||
task = {
|
||||
serialNumber: folder.DispatchNumber,
|
||||
taskStartDate: folder.DateDispatch,
|
||||
isEvent: true,
|
||||
workflowInstanceDataFields: {
|
||||
FolderID: folder['FolderId'] || folder['FolderID'] || folder.folderId,
|
||||
Subject: folder.Assunto,
|
||||
SourceSecFsID: folder.ApplicationID || folder['ApplicationId'],
|
||||
SourceType: 'FOLDER',
|
||||
SourceID: folder.folderId,
|
||||
DispatchNumber: folder.DispatchNumber
|
||||
},
|
||||
}
|
||||
} else if (document.ApplicationID == 8 || document.ApplicationId == 8) {
|
||||
task = {
|
||||
serialNumber: document.DocId,
|
||||
taskStartDate: document.DocDate,
|
||||
isEvent: true,
|
||||
workflowInstanceDataFields: {
|
||||
FolderID: null,
|
||||
Subject: document.Assunto,
|
||||
DispatchNumber: null,
|
||||
SourceSecFsID: document.ApplicationID || document.ApplicationId,
|
||||
SourceType: 'DOC',
|
||||
SourceID: document.DocId,
|
||||
}
|
||||
}
|
||||
} else {
|
||||
console.log('unexpected ApplicationID')
|
||||
}
|
||||
|
||||
this.task = task
|
||||
console.log('this.task = task', this.task)
|
||||
|
||||
this.task = task
|
||||
|
||||
const popover = await this.popoverController.create({
|
||||
component: SearchedDocumentOptionsPage,
|
||||
cssClass: 'exp-options',
|
||||
componentProps: {
|
||||
task: this.task,
|
||||
LoadedDocument: this.LoadedDocument
|
||||
},
|
||||
translucent: true
|
||||
});
|
||||
await popover.present()
|
||||
// const modal = await this.modalController.create({
|
||||
// component: ViewDocumentPage,
|
||||
// componentProps: {
|
||||
// trustedUrl: '',
|
||||
// file: {
|
||||
// title: task.workflowInstanceDataFields.Subject,
|
||||
// url: '',
|
||||
// title_link: '',
|
||||
// },
|
||||
// Document: this.LoadedDocument,
|
||||
// applicationId: task.workflowInstanceDataFields.SourceSecFsID,
|
||||
// docId: this.LoadedDocument.DocId || this.LoadedDocument.DocID,
|
||||
// folderId: folder['FolderId'] || folder['FolderID'] || folder.folderId
|
||||
// },
|
||||
// cssClass: 'modal modal-desktop'
|
||||
// });
|
||||
// await modal.present();
|
||||
// });
|
||||
|
||||
popover.onDidDismiss().then((res:any) => {
|
||||
if(res.data.component == 'openBookMeetingModal') {
|
||||
this.openBookMeetingModal()
|
||||
} else if(res.data.component == 'openExpedientActionsModal') {
|
||||
this.openExpedientActionsModal(res.data.taskAction)
|
||||
} else {
|
||||
console.log(res.data)
|
||||
}
|
||||
});
|
||||
const selectedDoc = this.loadedEvent.Attachments[ this.dicIndex]
|
||||
|
||||
});
|
||||
console.log('selectedDoc', selectedDoc)
|
||||
|
||||
}
|
||||
|
||||
async openTaskOptions() {
|
||||
|
||||
let task: ExpedientTaskModalPageNavParamsTask
|
||||
let document: SearchDocumentDetails = this.loadedEvent.Attachments[ this.dicIndex];
|
||||
let folder: SearchFolderDetails = this.loadedEvent.Attachments[ this.dicIndex];
|
||||
|
||||
if(this.loadedEvent.Attachments[this.dicIndex].ApplicationID == 361 || this.loadedEvent.Attachments[this.dicIndex].ApplicationId == 361) {
|
||||
task = {
|
||||
serialNumber: folder.DispatchNumber,
|
||||
taskStartDate: folder.DateDispatch,
|
||||
isEvent: true,
|
||||
workflowInstanceDataFields: {
|
||||
FolderID: folder['FolderId'] || folder['FolderID'] || folder.folderId,
|
||||
Subject: folder.Assunto,
|
||||
SourceSecFsID: folder.ApplicationID || folder['ApplicationId'],
|
||||
SourceType: 'FOLDER',
|
||||
SourceID: folder.folderId,
|
||||
DispatchNumber: folder.DispatchNumber
|
||||
},
|
||||
}
|
||||
} else if (document.ApplicationID == 8 || document.ApplicationId == 8) {
|
||||
task = {
|
||||
serialNumber: document.DocId,
|
||||
taskStartDate: document.DocDate,
|
||||
isEvent: true,
|
||||
workflowInstanceDataFields: {
|
||||
FolderID: null,
|
||||
Subject: document.Assunto,
|
||||
DispatchNumber: null,
|
||||
SourceSecFsID: document.ApplicationID || document.ApplicationId,
|
||||
SourceType: 'DOC',
|
||||
SourceID: document.DocId,
|
||||
}
|
||||
this.task = {
|
||||
serialNumber: '',
|
||||
taskStartDate: '',
|
||||
isEvent: true,
|
||||
workflowInstanceDataFields: {
|
||||
FolderID: '',
|
||||
Subject: selectedDoc.SourceName,
|
||||
SourceSecFsID: selectedDoc.ApplicationId,
|
||||
SourceType: 'DOC',
|
||||
SourceID: selectedDoc.SourceId,
|
||||
DispatchNumber: ''
|
||||
}
|
||||
}
|
||||
|
||||
this.task = task
|
||||
|
||||
const popover = await this.popoverController.create({
|
||||
component: SearchedDocumentOptionsPage,
|
||||
cssClass: 'exp-options',
|
||||
componentProps: {
|
||||
task: this.task,
|
||||
LoadedDocument: this.LoadedDocument
|
||||
},
|
||||
translucent: true
|
||||
});
|
||||
await popover.present()
|
||||
|
||||
popover.onDidDismiss().then((res:any) => {
|
||||
if(res.data.component == 'openBookMeetingModal') {
|
||||
this.openBookMeetingModal()
|
||||
} else if(res.data.component == 'openExpedientActionsModal') {
|
||||
this.openExpedientActionsModal(res.data.taskAction)
|
||||
} else {
|
||||
console.log(res.data)
|
||||
console.log('component not found')
|
||||
}
|
||||
});
|
||||
const modal = await this.modalController.create({
|
||||
component: ViewDocumentPage,
|
||||
componentProps: {
|
||||
trustedUrl: '',
|
||||
file: {
|
||||
title: this.task.workflowInstanceDataFields.Subject,
|
||||
url: '',
|
||||
title_link: '',
|
||||
},
|
||||
applicationId: this.task.workflowInstanceDataFields.SourceSecFsID,
|
||||
docId: selectedDoc.SourceId,
|
||||
folderId: ''
|
||||
},
|
||||
cssClass: 'modal modal-desktop'
|
||||
});
|
||||
await modal.present();
|
||||
|
||||
}
|
||||
|
||||
@@ -332,7 +289,7 @@ export class ViewEventPage implements OnInit {
|
||||
component: DocumentSetUpMeetingPage,
|
||||
componentProps: {
|
||||
subject: this.task.workflowInstanceDataFields.Subject,
|
||||
document: this.loadedEvent,
|
||||
document: this.loadedEvent.Attachments[ this.dicIndex],
|
||||
},
|
||||
cssClass: classs,
|
||||
backdropDismiss: false
|
||||
@@ -357,8 +314,8 @@ export class ViewEventPage implements OnInit {
|
||||
componentProps: {
|
||||
taskAction: taskAction,
|
||||
task: this.task,
|
||||
seachDocuments: this.loadedEvent,
|
||||
aplicationId: this.loadedEvent.ApplicationId || this.loadedEvent.ApplicationID
|
||||
seachDocuments: this.loadedEvent.Attachments[ this.dicIndex],
|
||||
aplicationId: this.loadedEvent.Attachments[ this.dicIndex].ApplicationId || this.loadedEvent.Attachments[ this.dicIndex].ApplicationID
|
||||
},
|
||||
cssClass: classs,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user