This commit is contained in:
tiago.kayaya
2021-04-30 14:45:08 +01:00
18 changed files with 237 additions and 84 deletions
+1 -1
View File
@@ -323,7 +323,7 @@
<ion-row class="filter ion-align-items-center">
<div class="filter-name">{{timelineFilterState}}</div>
<!-- Icon -->
<button (click)="showTimelineFilterState=true" class="arrow-down btn-no-color">
<button (click)="showTimelineFilterState=!showTimelineFilterState" class="arrow-down btn-no-color">
<ion-icon src="assets/images/icons-arrow-arrow-down.svg"></ion-icon>
</button>
@@ -190,7 +190,8 @@ export class EditEventPage implements OnInit {
component: SearchPage,
cssClass: 'modal-width-100-width-background modal',
componentProps: {
type: 'AccoesPresidenciais & ArquivoDespachoElect'
type: 'AccoesPresidenciais & ArquivoDespachoElect',
select: true
}
});
await modal.present();
@@ -111,10 +111,10 @@ export class NewEventPage implements OnInit {
close(){
this.modalController.dismiss();
}
async save(){
/* console.log(this.postEvent);
async save() {
/* console.log(this.postEvent);
console.log(this.profile); */
if(this.documents.length >= 0) {
this.postEvent.HasAttachments = true;
}
@@ -207,7 +207,8 @@ export class NewEventPage implements OnInit {
cssClass: 'modal-width-100-width-background modal',
componentProps: {
type: 'AccoesPresidenciais & ArquivoDespachoElect',
showSearchInput: true
showSearchInput: true,
select: true
}
});
await modal.present();
@@ -166,19 +166,23 @@
</ion-label>
</div>
<div *ngIf="loadedAttachments">
<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 *ngFor="let attachment of loadedAttachments">
<ion-item>
<ion-label>
<h4 class="attach-title-item">{{attachment.Description}}</h4>
<p><span class="span-left">{{attachment.Stakeholders}}</span><span class="span-right"> {{ attachment.CreateDate | date: 'dd/MM/yyyy' }}</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>
@@ -167,4 +167,43 @@
text-align: right;
float: right;
font-size: 13px;
}
}
.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;
}
}
@@ -11,6 +11,7 @@ import { EventsService } from 'src/app/services/events.service';
import { DiscartExpedientModalPage } from '../../discart-expedient-modal/discart-expedient-modal.page';
import { AttachmentsService } from 'src/app/services/attachments.service';
import { SearchPage } from 'src/app/pages/search/search.page';
import { SearchDocument } from 'src/app/models/search-document';
@Component({
selector: 'app-book-meeting-modal',
@@ -27,6 +28,7 @@ export class BookMeetingModalPage implements OnInit {
taskDocId:string;
loadedAttachments:any;
documents:SearchDocument[] = [];
adding: "intervenient" | "CC" = "intervenient";
@@ -234,25 +236,19 @@ export class BookMeetingModalPage implements OnInit {
});
await modal.present();
modal.onDidDismiss().then((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: '',
};
this.attachmentsService.setEventAttachmentById(DocumentToSave).subscribe( ()=>{
this.getAttachments();
});
if(res){
const data = res.data;
this.documents.push(data.selected);
}
});
}
removeAttachment(index: number){
this.documents = this.documents.filter( (e, i) => index != i);
}
validateFormInputs(){
let formLocation = this.postData.Location.trim();
@@ -100,19 +100,23 @@
</ion-label>
</div>
<div *ngIf="loadedAttachments">
<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 *ngFor="let attachment of loadedAttachments">
<ion-item>
<ion-label>
<h4 class="attach-title-item">{{attachment.Description}}</h4>
<p><span class="span-left">{{attachment.Stakeholders}}</span><span class="span-right"> {{ attachment.CreateDate | date: 'dd/MM/yyyy' }}</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>
@@ -148,4 +148,78 @@
text-align: right;
float: right;
font-size: 13px;
}
.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;
}
}
.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;
}
}
@@ -15,6 +15,9 @@ import { AttachmentsService } from 'src/app/services/attachments.service';
import { ExpedienteDetailPage } from '../expediente-detail/expediente-detail.page';
import { AlertService } from 'src/app/services/alert.service';
import { SearchPage } from 'src/app/pages/search/search.page';
import { SearchDocument } from 'src/app/models/search-document';
import { EventAttachment } from 'src/app/models/attachment.model';
import { User } from 'src/app/models/user.model';
@Component({
selector: 'app-expedient-task-modal',
@@ -37,7 +40,10 @@ export class ExpedientTaskModalPage implements OnInit {
taskDate: Date;
taskDescription: string;
user: string;
loadedAttachments:any;
documents:SearchDocument[] = [];
subjectTypes:any;
postData: Despacho;
@@ -56,6 +62,8 @@ export class ExpedientTaskModalPage implements OnInit {
taskResult: any = {}
loggeduser: User;
constructor(
private modalController: ModalController,
private router:Router,
@@ -63,7 +71,12 @@ export class ExpedientTaskModalPage implements OnInit {
private attachmentsService: AttachmentsService,
private navParams: NavParams,
private alertController: AlertService,
private authService: AuthService) {
private authService: AuthService,
private userAuth: AuthService) {
this.loggeduser = userAuth.ValidatedUser;
this.user = environment.defaultuser +'@'+ environment.domain;
this.task = this.navParams.get('task');
@@ -144,6 +157,7 @@ export class ExpedientTaskModalPage implements OnInit {
}
let attendees = this.taskParticipants.concat(this.taskParticipantsCc);
attendees = attendees.map(function(val) {
return {
UserEmail: val.EmailAddress,
@@ -151,6 +165,16 @@ export class ExpedientTaskModalPage implements OnInit {
};
})
const DocumentToSave = this.documents.map((e) => {
return {
ProcessInstanceID: '',
"Source": "webTRIX",
"UserId": this.loggeduser.UserId.toString(),
"Attachment": `${e.ApplicationType}@DOC@${e.Id}`
};
});
if(this.taskParticipants.length > 0) {
switch (this.taskType) {
case '0':
@@ -162,6 +186,7 @@ export class ExpedientTaskModalPage implements OnInit {
SubjectTypeId: this.postData.SubjectTypeId,
UsersSelected: attendees,
DispatchFolder: this.dispatchFolder,
AttachmentList: DocumentToSave
}
console.log('this.postData', this.postData, this.taskType);
this.taskResult = await this.processes.postDespatcho(this.postData);
@@ -175,6 +200,7 @@ export class ExpedientTaskModalPage implements OnInit {
SubjectTypeId: this.postData.SubjectTypeId,
UsersSelected: attendees,
DispatchFolder: this.dispatchFolder,
AttachmentList: DocumentToSave
}
console.log(this.postData);
this.taskResult = await this.processes.postParecer(this.postData);
@@ -188,6 +214,7 @@ export class ExpedientTaskModalPage implements OnInit {
SubjectTypeId: this.postData.SubjectTypeId,
UsersSelected: attendees,
DispatchFolder: this.dispatchFolder,
AttachmentList: DocumentToSave
}
console.log(this.postData);
this.taskResult = await this.processes.postDeferimento(this.postData);
@@ -378,24 +405,17 @@ export class ExpedientTaskModalPage implements OnInit {
});
await modal.present();
modal.onDidDismiss().then((res)=>{
const data = res.data;
//data.selected
const DocumentToSave = {
SourceTitle: data.selected.Assunto,
ParentId: 'this.postEvent.EventId', // instance
Source: '1',
SourceId: data.selected.Id,
ApplicationId: data.selected.ApplicationType.toString(),
Id: '0',
Link: '',
SerialNumber: '',
};
this.attachmentsService.setEventAttachmentById(DocumentToSave).subscribe( ()=>{
this.getAttachments();
});
if(res){
const data = res.data;
this.documents.push(data.selected);
}
});
}
removeAttachment(index: number){
this.documents = this.documents.filter( (e, i) => index != i);
}
}
+1 -1
View File
@@ -141,7 +141,7 @@
</div>
</div>
<ul>
<li *ngFor="let searchDocument of showSearchDocuments" (click)="viewDetail(searchDocument.Id); selectItem(searchDocument)" class="d-flex">
<li *ngFor="let searchDocument of showSearchDocuments" (click)="viewDetail( searchDocument); selectItem(searchDocument)" class="d-flex">
<div class="icon">
<ion-icon *ngIf="itemIcons() == 'AccoesPresidenciais & ArquivoDespachoElect' "
src="assets/images/icons-search-document.svg"></ion-icon>
+18 -15
View File
@@ -67,14 +67,13 @@ export class SearchPage implements OnInit {
this.type = this.navParams.get('type');
this.type = this.navParams.get('type');
this.select = this.navParams.get('select');
this.showSearchInput = this.navParams.get('showSearchInput');
if(this.type == null || this.type == undefined) {
this.select = false;
if(this.currentPath == '/home/agenda') {
this.type = "Agenda"
} else if (this.currentPath =='/home/gabinete-digital') {
@@ -83,13 +82,10 @@ export class SearchPage implements OnInit {
} else if (this.currentPath == '/home/publications') {
this.type = "AccoesPresidenciais"
} else {
this.select = false
console.log('search bug!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!')
}
} else {
this.select = true;
}
}
@@ -99,6 +95,8 @@ export class SearchPage implements OnInit {
selected: item
});
}
return this.select;
}
ngOnInit() {
@@ -476,31 +474,36 @@ export class SearchPage implements OnInit {
}
async viewDetail(id:any) {
console.log(id);
async viewDetail(searchDocument: SearchDocument) {
const ApplicationType = searchDocument.ApplicationType.toString()
const Id = searchDocument.Id
if(!this.selectItem){
if(window.location.pathname == '/home/agenda'){
if(this.select == false){
if(this.type == "Agenda") {
const modal = await this.modalCtrl.create({
component: ViewEventPage,
componentProps:{
eventId: id
eventId: Id
},
cssClass: 'modal modal-desktop',
});
await modal.present();
modal.onDidDismiss().then((res)=>{});
} else if(window.location.pathname == '/home/publications'){
} else if(this.type == "AccoesPresidenciais"){
this.viewPublicationDetail(id);
this.viewPublicationDetail(Id);
}
else if(window.location.pathname == '/home/gabinete-digital'){
else if(this.type == "AccoesPresidenciais & ArquivoDespachoElect"){
console.log('OPEN DOC');
this.viewDocumentDetail(id,'');
this.viewDocumentDetail(Id, ApplicationType);
}
} else {
console.log('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!', this.select)
}
}