mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 21:06:06 +00:00
Merge branch 'developer' of https://bitbucket.org/equilibriumito/gabinete-digital into developer
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
<ion-header class="ion-no-border bg-blue">
|
||||
<app-header class="bg-blue"></app-header>
|
||||
<ion-header class="ion-no-border ">
|
||||
<app-header ></app-header>
|
||||
</ion-header>
|
||||
|
||||
<ion-content id="timeline-conteiner agenda-container" class="timeline bg-blue">
|
||||
<ion-content id="timeline-conteiner agenda-container" class="timeline ">
|
||||
|
||||
<div class="d-flex bg-blue container-wrapper">
|
||||
<div class="d-flex container-wrapper">
|
||||
|
||||
<div class="calendar-timeline d-flex flex-column height-100 bg-blue">
|
||||
<div class="calendar-wrapper">
|
||||
|
||||
@@ -516,7 +516,7 @@ export class AgendaPage implements OnInit {
|
||||
|
||||
this.showLoader = true;
|
||||
|
||||
if(window.innerWidth < 1024){
|
||||
if(window.innerWidth < 800){
|
||||
|
||||
this.showTimeline = false;
|
||||
|
||||
|
||||
@@ -177,45 +177,42 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="container-div width-100 pb-20">
|
||||
<div class="ion-item-class-2 d-flex">
|
||||
<div class="ion-icon-class">
|
||||
<ion-icon slot="start" src="assets/images/icons-description.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="ion-input-class-no-height width-100">
|
||||
<ion-textarea placeholder="Detalhes" [(ngModel)]="postEvent.Body.Text" rows="6" cols="20"></ion-textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div hidden class="ion-item-container-no-border">
|
||||
<div (click)="getDoc()" class="d-flex container-div width-100 ion-item-container-no-border" >
|
||||
<ion-label>
|
||||
<div class="attach-icon">
|
||||
<ion-icon src="assets/images/icons-attach-doc.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="attach-document">
|
||||
<ion-label>Anexar Documentos</ion-label>
|
||||
<ion-label>Adicionar documentos</ion-label>
|
||||
</div>
|
||||
</ion-label>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="d-flex container-div width-100" *ngFor="let document of loadedEventAttachments" >
|
||||
<ion-list class="width-100 list">
|
||||
<ion-item class="width-100">
|
||||
<ion-label class="width-100">
|
||||
<p class="d-flex ion-justify-content-between">
|
||||
<span class="attach-title-item">{{document.SourceName}}</span>
|
||||
<span class="app-name" *ngIf="document.ApplicationId == 8"> Correspondencia </span>
|
||||
<span class="app-name" *ngIf="document.ApplicationId == 386"> AccoesPresidenciais </span>
|
||||
<span class="app-name" *ngIf="document.ApplicationId == 361 "> ArquivoDespachoElect </span>
|
||||
<span class="close-button text-black" (click)="deleteAttachment(document.Id)" >
|
||||
<ion-icon class="font-20" src="assets/images/icons-delete-25.svg"></ion-icon>
|
||||
</span>
|
||||
|
||||
</p>
|
||||
<p><span class="span-left">{{document.Stakeholders}}</span><span class="span-right"> {{document.CreateDate | date: 'dd-MM-yy'}} </span></p>
|
||||
</ion-label>
|
||||
</ion-item>
|
||||
</ion-list>
|
||||
</div>
|
||||
|
||||
|
||||
<div hidden>
|
||||
<ion-item>
|
||||
<ion-label>Documentos Anexados</ion-label>
|
||||
</ion-item>
|
||||
<ion-list>
|
||||
<ion-item>
|
||||
<ion-label>
|
||||
<h4 class="attach-title-item">Text</h4>
|
||||
<p><span class="span-left">Text</span><span class="span-right"> Text </span></p>
|
||||
</ion-label>
|
||||
</ion-item>
|
||||
</ion-list>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</ion-item-sliding>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -163,4 +163,39 @@
|
||||
padding: 20px;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
.app-name{
|
||||
background: #42b9f2;
|
||||
border-radius: 18px;
|
||||
text-align: center;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 0px 5px;
|
||||
color: white;
|
||||
font-size: 9pt;
|
||||
font-weight: 500;
|
||||
height: 19px;
|
||||
-webkit-border-radius: 18px;
|
||||
-moz-border-radius: 18px;
|
||||
-ms-border-radius: 18px;
|
||||
-o-border-radius: 18px;
|
||||
}
|
||||
|
||||
|
||||
.close-button {
|
||||
display: none;
|
||||
}
|
||||
|
||||
|
||||
.list:hover {
|
||||
|
||||
.app-name {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.close-button {
|
||||
display: block !important;
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,14 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { AlertController, ModalController, NavParams } from '@ionic/angular';
|
||||
import { Attachment } from 'src/app/models/attachment.model';
|
||||
import { EventBody } from 'src/app/models/eventbody.model';
|
||||
import { EventPerson } from 'src/app/models/eventperson.model';
|
||||
import { AlertService } from 'src/app/services/alert.service';
|
||||
import { AttachmentsService } from 'src/app/services/attachments.service';
|
||||
import { EventsService } from 'src/app/services/events.service';
|
||||
import { Event } from '../../../models/event.model';
|
||||
import { AttendeesPage } from '../../events/attendees/attendees.page';
|
||||
import { SearchPage } from '../../search/search.page';
|
||||
|
||||
@Component({
|
||||
selector: 'app-edit-event',
|
||||
@@ -27,6 +30,7 @@ export class EditEventPage implements OnInit {
|
||||
minDate: string;
|
||||
|
||||
|
||||
loadedEventAttachments: Attachment[];
|
||||
taskParticipants: any = [];
|
||||
taskParticipantsCc: any = [];
|
||||
adding: "intervenient" | "CC" = "intervenient";
|
||||
@@ -39,11 +43,17 @@ export class EditEventPage implements OnInit {
|
||||
private navParams: NavParams,
|
||||
private eventsService: EventsService,
|
||||
public alertController: AlertController,
|
||||
private attachmentsService: AttachmentsService,
|
||||
) {
|
||||
this.isEventEdited = false;
|
||||
this.postEvent = this.navParams.get('event');
|
||||
|
||||
if(this.postEvent){
|
||||
this.postEvent.Body.Text = this.postEvent.Body.Text.replace(/<[^>]+>/g, '');
|
||||
if( this.postEvent.Body){
|
||||
if(typeof(this.postEvent.Body.Text) == 'string'){
|
||||
this.postEvent.Body.Text = this.postEvent.Body.Text.replace(/<[^>]+>/g, '');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(this.postEvent.Attendees == null){
|
||||
@@ -67,6 +77,8 @@ export class EditEventPage implements OnInit {
|
||||
this.isRecurring = "Repete";
|
||||
}
|
||||
this.profile = this.navParams.get('profile');
|
||||
|
||||
this.getAttachments(this.postEvent.EventId);
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
@@ -157,4 +169,52 @@ export class EditEventPage implements OnInit {
|
||||
this.taskParticipantsCc = taskParticipantsCc;
|
||||
}
|
||||
|
||||
|
||||
getAttachments(eventId: string){
|
||||
this.attachmentsService.getAttachmentsById(eventId).subscribe(res=>{
|
||||
this.loadedEventAttachments = res;
|
||||
console.log('res', res);
|
||||
});
|
||||
}
|
||||
|
||||
deleteAttachment(attachmentID: string) {
|
||||
|
||||
this.attachmentsService.deleteEventAttachmentById(attachmentID).subscribe(
|
||||
res=>{
|
||||
this.loadedEventAttachments = this.loadedEventAttachments.filter(e=> e.Id.toString() != attachmentID);
|
||||
})
|
||||
}
|
||||
|
||||
async getDoc() {
|
||||
const modal = await this.modalController.create({
|
||||
component: SearchPage,
|
||||
cssClass: 'modal-width-100-width-background modal',
|
||||
componentProps: {
|
||||
type: 'AccoesPresidenciais & ArquivoDespachoElect'
|
||||
}
|
||||
});
|
||||
await modal.present();
|
||||
modal.onDidDismiss().then( async (res)=>{
|
||||
if(res){
|
||||
const data = res.data;
|
||||
//data.selected
|
||||
const DocumentToSave = {
|
||||
SourceTitle: data.selected.Assunto,
|
||||
ParentId: this.postEvent.EventId,
|
||||
Source: '1',
|
||||
SourceId: data.selected.Id,
|
||||
ApplicationId: data.selected.ApplicationType.toString(),
|
||||
Id: '0',
|
||||
Link: '',
|
||||
SerialNumber: '',
|
||||
};
|
||||
|
||||
await this.attachmentsService.setEventAttachmentById(DocumentToSave).subscribe(()=>{
|
||||
this.getAttachments(this.postEvent.EventId);
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@@ -194,30 +194,33 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div hidden class="ion-item-container-no-border">
|
||||
<div class="ion-item-container-no-border" (click)="getDoc()">
|
||||
<ion-label>
|
||||
<div class="attach-icon">
|
||||
<ion-icon src="assets/images/icons-attach-doc.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="attach-document">
|
||||
<ion-label>Anexar Documentos</ion-label>
|
||||
<ion-label>Adicionar documentos</ion-label>
|
||||
</div>
|
||||
</ion-label>
|
||||
</div>
|
||||
|
||||
<div hidden>
|
||||
<ion-item>
|
||||
<ion-label>Documentos Anexados</ion-label>
|
||||
</ion-item>
|
||||
<div class="list " *ngFor="let document of documents; let i = index" >
|
||||
<ion-list>
|
||||
<ion-item>
|
||||
<ion-label>
|
||||
<h4 class="attach-title-item">Text</h4>
|
||||
<p><span class="span-left">Text</span><span class="span-right"> Text </span></p>
|
||||
<p class="d-flex ion-justify-content-between">
|
||||
<span class="attach-title-item">{{document.Assunto}}</span>
|
||||
<span class="app-name">{{document.appName}}</span>
|
||||
<span class="close-button text-black" (click)="removeAttachment(i)" >
|
||||
<ion-icon class="font-20" src="assets/images/icons-delete-25.svg"></ion-icon>
|
||||
</span>
|
||||
</p>
|
||||
<p><span class="span-left">{{document.EntidadeOrganicaNome}}</span><span class="span-right"> {{document.Data | date: 'dd-MM-yy'}} </span></p>
|
||||
</ion-label>
|
||||
</ion-item>
|
||||
</ion-list>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ion-content>
|
||||
<ion-footer class="ion-no-border d-flex justify-center px-20">
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ModalController, NavParams } from '@ionic/angular';
|
||||
import { EventAttachment } from 'src/app/models/attachment.model';
|
||||
import { EventBody } from 'src/app/models/eventbody.model';
|
||||
import { EventPerson } from 'src/app/models/eventperson.model';
|
||||
import { SearchDocument } from 'src/app/models/search-document';
|
||||
import { AttachmentsService } from 'src/app/services/attachments.service';
|
||||
import { EventsService } from 'src/app/services/events.service';
|
||||
import { Event } from '../../../models/event.model';
|
||||
import { AttendeesPage } from '../../events/attendees/attendees.page';
|
||||
@@ -28,10 +31,13 @@ export class NewEventPage implements OnInit {
|
||||
taskParticipants: any = [];
|
||||
taskParticipantsCc: any = [];
|
||||
|
||||
documents:SearchDocument[] = [];
|
||||
|
||||
constructor(
|
||||
private modalController: ModalController,
|
||||
private navParams: NavParams,
|
||||
private eventService: EventsService,
|
||||
private attachmentsService: AttachmentsService
|
||||
) {
|
||||
this.postEvent = new Event();
|
||||
this.eventBody = { BodyType : "1", Text : ""};
|
||||
@@ -105,17 +111,42 @@ export class NewEventPage implements OnInit {
|
||||
close(){
|
||||
this.modalController.dismiss();
|
||||
}
|
||||
save(){
|
||||
async save(){
|
||||
/* console.log(this.postEvent);
|
||||
console.log(this.profile); */
|
||||
|
||||
if(this.documents.length >= 0) {
|
||||
this.postEvent.HasAttachments = true;
|
||||
}
|
||||
|
||||
let eventId: string;
|
||||
|
||||
if(this.profile=='mdgpr'){
|
||||
this.eventService.postEventMd(this.postEvent, this.postEvent.CalendarName).subscribe();
|
||||
eventId = await this.eventService.postEventMd(this.postEvent, this.postEvent.CalendarName).toPromise();
|
||||
}
|
||||
else if(this.profile=='pr'){
|
||||
this.eventService.postEventPr(this.postEvent, this.postEvent.CalendarName).subscribe();
|
||||
eventId = await this.eventService.postEventPr(this.postEvent, this.postEvent.CalendarName).toPromise();
|
||||
}
|
||||
|
||||
const DocumentToSave: EventAttachment[] = this.documents.map((e) => {
|
||||
return {
|
||||
SourceTitle: e.Assunto,
|
||||
ParentId: eventId,
|
||||
Source: '1',
|
||||
SourceId: e.Id,
|
||||
ApplicationId: e.ApplicationType.toString(),
|
||||
Id: '',
|
||||
Link: '',
|
||||
SerialNumber: ''
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
await DocumentToSave.forEach( async (attachments, i) => {
|
||||
this.attachmentsService.setEventAttachmentById(attachments).toPromise();
|
||||
});
|
||||
|
||||
|
||||
this.modalController.dismiss(this.postEvent);
|
||||
}
|
||||
|
||||
@@ -168,4 +199,30 @@ export class NewEventPage implements OnInit {
|
||||
this.openAttendees();
|
||||
}
|
||||
|
||||
|
||||
|
||||
async getDoc(){
|
||||
const modal = await this.modalController.create({
|
||||
component: SearchPage,
|
||||
cssClass: 'modal-width-100-width-background modal',
|
||||
componentProps: {
|
||||
type: 'AccoesPresidenciais & ArquivoDespachoElect'
|
||||
}
|
||||
});
|
||||
await modal.present();
|
||||
modal.onDidDismiss().then((res)=>{
|
||||
if(res){
|
||||
const data = res.data;
|
||||
this.documents.push(data.selected);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
removeAttachment(index: number){
|
||||
|
||||
this.documents = this.documents.filter( (e, i) => index != i);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -9,6 +9,7 @@ import { Event } from '../../../models/event.model';
|
||||
import { EditEventPage } from '../edit-event/edit-event.page';
|
||||
import { InAppBrowser } from '@ionic-native/in-app-browser/ngx';
|
||||
import { ProcessesService } from 'src/app/services/processes.service';
|
||||
import { ExpedientTaskModalPage } from '../../gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page';
|
||||
|
||||
@Component({
|
||||
selector: 'app-view-event',
|
||||
@@ -116,6 +117,20 @@ export class ViewEventPage implements OnInit {
|
||||
profile: this.profile,
|
||||
},
|
||||
cssClass: 'modal modal-desktop',
|
||||
|
||||
});
|
||||
await modal.present();
|
||||
modal.onDidDismiss().then((res) => {
|
||||
console.log(res);
|
||||
|
||||
if(res){
|
||||
setTimeout(() => {
|
||||
/* this.loadEvent(); */
|
||||
this.loadEvent()
|
||||
this.getAttachments();
|
||||
}, 250);
|
||||
this.isEventEdited = true;
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
@@ -162,4 +177,35 @@ export class ViewEventPage implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
async openExpedientActionsModal(taskAction: any, task: any) {
|
||||
//this.modalController.dismiss();
|
||||
let classs;
|
||||
if( window.innerWidth <= 800){
|
||||
classs = 'modal modal-desktop'
|
||||
} else {
|
||||
classs = 'modal modal-desktop showAsideOptions'
|
||||
}
|
||||
const modal = await this.modalController.create({
|
||||
component: ExpedientTaskModalPage,
|
||||
componentProps: {
|
||||
taskAction: taskAction,
|
||||
task: task,
|
||||
profile: this.profile,
|
||||
},
|
||||
cssClass: classs,
|
||||
});
|
||||
await modal.present();
|
||||
modal.onDidDismiss().then(res=>{
|
||||
console.log(res['data']);
|
||||
if(res['data']=='openDiscart'){
|
||||
console.log('open discart');
|
||||
|
||||
// this.distartExpedientModal();
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user