diff --git a/src/app/modals/document-detail/document-detail.page.ts b/src/app/modals/document-detail/document-detail.page.ts index 53e6865d2..4348f2ace 100644 --- a/src/app/modals/document-detail/document-detail.page.ts +++ b/src/app/modals/document-detail/document-detail.page.ts @@ -9,6 +9,8 @@ import { SearchDocumentDetails, SearchFolderDetails } from 'src/app/models/searc import { ExpedientTaskModalPageNavParamsTask } from 'src/app/models/ExpedientTaskModalPage'; import { PermissionService } from 'src/app/OtherService/permission.service'; import { SearchedDocumentOptionsPage } from 'src/app/shared/popover/searched-document-options/searched-document-options.page'; +import { BookMeetingModalPage } from 'src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page'; +import { Location } from '@angular/common'; @Component({ selector: 'app-document-detail', @@ -39,7 +41,8 @@ export class DocumentDetailPage implements OnInit { private menu: MenuController, private iab: InAppBrowser, public p: PermissionService, - private popoverController: PopoverController + private popoverController: PopoverController, + private location: Location, ) { this.docId = this.navParams.get('docId'); this.applicationId = this.navParams.get('applicationId'); @@ -51,6 +54,8 @@ export class DocumentDetailPage implements OnInit { async LoadDocumentDetails() { this.processes.GetDocumentDetails(this.docId, this.applicationId).subscribe(res=>{ + console.log(res); + this.LoadedDocument = res; this.LoadedDocument.Subject = this.LoadedDocument.Assunto @@ -63,7 +68,7 @@ export class DocumentDetailPage implements OnInit { 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, @@ -95,7 +100,7 @@ export class DocumentDetailPage implements OnInit { } else { console.log('unexpected ApplicationID') } - + this.task = task console.log('this.task = task', this.task) @@ -120,16 +125,16 @@ export class DocumentDetailPage implements OnInit { close() { this.modalController.dismiss(); } - + notImplemented() { this.alertService.presentAlert('Funcionalidade em desenvolvimento'); } - // efetuar despacho + // efetuar despacho async openExpedientActionsModal( taskAction: any) { let classs; - if( window.innerWidth <= 800) { + if( window.innerWidth < 701) { classs = 'modal modal-desktop' } else { classs = 'modal modal-desktop showAsideOptions' @@ -150,9 +155,10 @@ export class DocumentDetailPage implements OnInit { } async openBookMeetingModal() { + console.log(this.LoadedDocument); let classs; - if( window.innerWidth <= 800) { + if( window.innerWidth < 701) { classs = 'book-meeting-modal modal modal-desktop' } else { classs = 'modal modal-desktop showAsideOptions' @@ -170,6 +176,29 @@ export class DocumentDetailPage implements OnInit { modal.onDidDismiss(); } + /* async openBookMeetingModal() { + //console.log(task); + + 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: BookMeetingModalPage, + componentProps: { + task: this.task, + }, + cssClass: classs, + backdropDismiss: false + }); + await modal.present(); + modal.onDidDismiss().then(res=>{ + this.location.back(); + }); + } */ + async openOptions() { const popover = await this.popoverController.create({ component: SearchedDocumentOptionsPage, @@ -193,5 +222,5 @@ export class DocumentDetailPage implements OnInit { } }); } - -} \ No newline at end of file + +} diff --git a/src/app/modals/document-set-up-meeting/document-set-up-meeting.page.ts b/src/app/modals/document-set-up-meeting/document-set-up-meeting.page.ts index 34972d358..ee913ea5f 100644 --- a/src/app/modals/document-set-up-meeting/document-set-up-meeting.page.ts +++ b/src/app/modals/document-set-up-meeting/document-set-up-meeting.page.ts @@ -86,8 +86,9 @@ export class DocumentSetUpMeetingPage implements OnInit { emptyTextDescription = "Sem intervenientes selecionados"; document: SearchFolderDetails | SearchDocumentDetails | any; - subject: string - + subject: string; + docs:any[] = []; + eventPipe = new EventPipe() constructor( @@ -178,8 +179,8 @@ export class DocumentSetUpMeetingPage implements OnInit { var Attachments: addAttachment[] = [] let folder: SearchFolderDetails = this.document let document: SearchDocumentDetails = this.document - - if(folder.Documents) { + + /* if(folder.Documents) { this.document.Documents.forEach( (_folder: SearchFolderDetailsDocuments) => { Attachments.push({ ApplicationId: 361, @@ -204,8 +205,18 @@ export class DocumentSetUpMeetingPage implements OnInit { SourceId: e.Id, SourceTitle: e.Assunto }) + }) */ + + this.document.Documents.forEach((e)=> { + this.docs.push({ + ApplicationId: e.ApplicationId || e.ApplicationType, + Source: 1, + SourceId: e.DocId || e.docID || e.docId, + SourceName: e.Assunto + }) }) + console.log(this.docs); let postEvent = { EventId: '', @@ -229,25 +240,32 @@ export class DocumentSetUpMeetingPage implements OnInit { Type: this.EventRecurrenceType, LastOccurrence: this.Occurrence }, + Attachments: this.docs, /* [ + { + "Source": 1, + "SourceId": 121367, + "SourceName": "sample string 5", + "ApplicationId": 8 + } + ], */ } + console.log(postEvent); + + const laoder = this.toastService.loading() - this.eventService.create({ - body: postEvent, - calendar: this.postData.CalendarName - }).subscribe(async (respose) => { - + 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) => { + /* const DocumentToSave = this.attachments.map((e) => { return this.eventPipe.AttactSearchResult(e, eventId, {}) }); await DocumentToSave.forEach(async (attachments, i) => { await this.eventService.addAttachment(attachments).toPromise(); - }); + }); */ laoder.remove() this.modalController.dismiss() diff --git a/src/app/models/search-document.ts b/src/app/models/search-document.ts index c190e4461..970cda23f 100644 --- a/src/app/models/search-document.ts +++ b/src/app/models/search-document.ts @@ -12,6 +12,7 @@ export class SearchList { export class Attachments { Id?: number + ParentId?:any Source: number SourceId: any SourceName: any diff --git a/src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page.ts b/src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page.ts index c2273f7bc..488cc9a8d 100644 --- a/src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page.ts +++ b/src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page.ts @@ -469,7 +469,7 @@ export class ExpedienteDetailPage implements OnInit { console.log(task); let classs; - if( window.innerWidth <= 800){ + if( window.innerWidth < 701){ classs = 'book-meeting-modal modal modal-desktop' } else { classs = 'modal modal-desktop showAsideOptions' diff --git a/src/app/pages/search/search.page.ts b/src/app/pages/search/search.page.ts index a5d019f31..3dc1930a4 100644 --- a/src/app/pages/search/search.page.ts +++ b/src/app/pages/search/search.page.ts @@ -68,9 +68,9 @@ export class SearchPage implements OnInit { this.select = this.navParams.get('select'); this.showSearchInput = this.navParams.get('showSearchInput'); - + if(this.type == null || this.type == undefined) { - + if(this.currentPath == '/home/agenda') { this.type = "Agenda" } else if (this.currentPath =='/home/gabinete-digital') { @@ -138,7 +138,7 @@ export class SearchPage implements OnInit { res.forEach(e => { const array: any = Object.values(e); - + array[1] = (((array[1] - lowest) / perPercent) * (maximum - minimumSize)/ 100 ) + minimumSize; list.push(array) }); @@ -152,7 +152,7 @@ export class SearchPage implements OnInit { setTimeout(()=>{ WordCloud( elem, - { + { list: this.list, Family: 'Times, serif', gridSize: 15 @@ -171,7 +171,7 @@ export class SearchPage implements OnInit { WordCloud( elem, - { + { list: this.list, Family: 'Times, serif', gridSize: 15 @@ -188,7 +188,7 @@ export class SearchPage implements OnInit { reorderList(orderBy: string) { - + this.ordinance = orderBy; if(this.ordinance == 'recent'){ @@ -210,18 +210,18 @@ export class SearchPage implements OnInit { basicSearch() { if(this.type == "Agenda" ){ - + this.showLoader = true; this.search.basicSearch(this.searchSubject, this.searchDocumentDate, this.searchSender ,this.searchOrganicEntiry, this.searchDocTypeId, '0').subscribe(res=>{ console.log(res); - + res.Categories.forEach( e => { e['Active'] = false; }); - + // bind respose this.searchCategories = res.Categories; @@ -231,11 +231,11 @@ export class SearchPage implements OnInit { // hide show document if(this.searchDocuments.length >= 1){ - this.showDocuments = true; + this.showDocuments = true; } else { this.showDocuments = false } - + this.showLoader = false; this.loadWordCloud(); @@ -254,24 +254,24 @@ export class SearchPage implements OnInit { this.search.searchForDoc(this.searchSubject, this.searchDocumentDate, this.searchSender ,this.searchOrganicEntiry, this.searchDocTypeId, '8').subscribe(res=>{ - + res.Categories.forEach( e => { e['Active'] = false; this.searchCategories.push(e) }); - + // bind respose - + this.sortArrayISODate(res.Documents).forEach(e => { e['appName'] = 'Correspondencia' this.searchDocuments.push(e) }); - + this.reorderList(this.ordinance); - + // hide show document if(this.searchDocuments.length >= 1){ - this.showDocuments = true; + this.showDocuments = true; } else { this.showDocuments = false } @@ -280,33 +280,33 @@ export class SearchPage implements OnInit { if(counter ==2){ this.showLoader = false; } - + this.loadWordCloud(); }); - + this.search.searchForDoc(this.searchSubject, this.searchDocumentDate, this.searchSender ,this.searchOrganicEntiry, this.searchDocTypeId, '361').subscribe(res=>{ - + res.Categories.forEach( e => { e['Active'] = false; this.searchCategories.push(e) }); - - + + this.sortArrayISODate(res.Documents).forEach(e => { e['appName'] = 'ArquivoDespachoElect' this.searchDocuments.push(e) }); - + this.reorderList(this.ordinance); - + // hide show document if(this.searchDocuments.length >= 1){ - this.showDocuments = true; + this.showDocuments = true; } else { this.showDocuments = false } - + this.loadWordCloud(); counter++; @@ -314,34 +314,34 @@ export class SearchPage implements OnInit { this.showLoader = false; } }); - + } else { let counter = 0; this.search.basicSearch(this.searchSubject, this.searchDocumentDate, this.searchSender ,this.searchOrganicEntiry, this.searchDocTypeId, '8').subscribe(res=>{ - + res.Categories.forEach( e => { e['Active'] = false; this.searchCategories.push(e) }); - + // bind respose - + this.sortArrayISODate(res.Documents).forEach(e => { e['appName'] = 'Correspondencia' this.searchDocuments.push(e) }); - + this.reorderList(this.ordinance); - + // hide show document if(this.searchDocuments.length >= 1){ - this.showDocuments = true; + this.showDocuments = true; } else { this.showDocuments = false } - + counter++; if(counter ==2){ @@ -350,31 +350,31 @@ export class SearchPage implements OnInit { this.loadWordCloud(); }); - + this.search.basicSearch(this.searchSubject, this.searchDocumentDate, this.searchSender ,this.searchOrganicEntiry, this.searchDocTypeId, '361').subscribe(res=>{ - + res.Categories.forEach( e => { e['Active'] = false; this.searchCategories.push(e) }); - - + + this.sortArrayISODate(res.Documents).forEach(e => { e['appName'] = 'ArquivoDespachoElect' this.searchDocuments.push(e) }); - + this.reorderList(this.ordinance); - + // hide show document if(this.searchDocuments.length >= 1){ - this.showDocuments = true; + this.showDocuments = true; } else { this.showDocuments = false } - - + + counter++; if(counter ==2){ @@ -382,22 +382,22 @@ export class SearchPage implements OnInit { } this.loadWordCloud(); }); - + } } else if (this.type == "AccoesPresidenciais"){ - + this.showLoader = true; this.search.basicSearch(this.searchSubject, this.searchDocumentDate, this.searchSender ,this.searchOrganicEntiry, this.searchDocTypeId, '386').subscribe(res=>{ console.log(res); - + res.Categories.forEach( e => { e['Active'] = false; }); - + // bind respose this.searchCategories = res.Categories; @@ -407,11 +407,11 @@ export class SearchPage implements OnInit { // hide show document if(this.searchDocuments.length >= 1){ - this.showDocuments = true; + this.showDocuments = true; } else { this.showDocuments = false } - + this.showLoader = false; this.loadWordCloud(); }); @@ -447,7 +447,7 @@ export class SearchPage implements OnInit { this.searchCategories.forEach((e, j) => { if(i != j){ e['Active'] = false; - } + } }) if (this.searchCategories[i]['Active']){ @@ -526,10 +526,10 @@ export class SearchPage implements OnInit { } async filterDocList(categoryName:string){ - + // show all category if(this. showCategory == categoryName ){ - + this.showSearchDocuments = this.searchDocuments; } else { // filter category @@ -569,13 +569,13 @@ export class SearchPage implements OnInit { }); await modal.present(); modal.onDidDismiss().then((res)=>{}); - + } else if(this.type == "AccoesPresidenciais"){ - + this.viewPublicationDetail(Id); } else if(this.type == "AccoesPresidenciais & ArquivoDespachoElect"){ - + if(ApplicationType == '8' || ApplicationType == '361') { this.viewDocumentDetail(Id, ApplicationType); // this.openExpedientActionsModal(searchDocument) @@ -594,7 +594,7 @@ export class SearchPage implements OnInit { cssClass: 'publication-detail modal modal-desktop ', //backdropDismiss: false }); - + await modal.present(); modal.onDidDismiss().then(()=>{}); @@ -603,12 +603,12 @@ export class SearchPage implements OnInit { async viewDocumentDetail(docId:string, applicationId:string) { let classs; - if( window.innerWidth <= 800) { + if( window.innerWidth < 701) { classs = 'modal modal-desktop' } else { classs = 'modal modal-desktop showAsideOptions' } - + const modal = await this.modalController.create({ component: DocumentDetailPage, componentProps:{ @@ -622,5 +622,5 @@ export class SearchPage implements OnInit { } - + }