Merge branch 'developer' of bitbucket.org:equilibriumito/gabinete-digital into developer

This commit is contained in:
Peter Maquiran
2021-10-09 18:19:00 +01:00
20 changed files with 245 additions and 81 deletions
@@ -62,17 +62,9 @@
<ion-checkbox [checked]="SessionStore.user.LoginPreference=='Pin' " class="checkBox" ></ion-checkbox>
PIN
</div>
</ion-col>
<ion-col hidden class="align-center d-flex">
<div (click)="addFingerprint()" class="d-flex align-center">
<ion-checkbox class="checkBox" [checked]="false"></ion-checkbox>
Impressão Digital
</div>
</ion-col>
</ion-row>
</div>
</div>
</div>
</ion-content>
View File
+2 -2
View File
@@ -65,7 +65,7 @@
</div>
<div class="item-date" [class.item-date-active]="dm._id == idSelected">{{showDateDuration(dm._updatedAt)}}</div>
</div>
<div class="item-description" [class.item-description-active]="dm._id == idSelected">
<div *ngIf="dm.lastMessage" class="item-description" [class.item-description-active]="dm._id == idSelected">
<ion-label *ngIf="dm.lastMessage">{{dm.lastMessage.msg}}</ion-label>
<ion-label *ngIf="dm.lastMessage.file">
<fa-icon icon="file-alt" class="file-icon" [class.set-active-item-font-to-white]="dm._id == idSelected"></fa-icon>
@@ -98,7 +98,7 @@
</div>
<div class="item-date" [class.item-date-active]="group._id ==idSelected" *ngIf="group.lastMessage">{{showDateDuration(group._updatedAt)}}</div>
</div>
<div class="item-description d-flex align-items-center" [class.item-description-active]="group._id ==idSelected" *ngIf="group.lastMessage">
<div *ngIf="group.lastMessage" class="item-description d-flex align-items-center" [class.item-description-active]="group._id ==idSelected">
<div class="item-message">{{group.lastMessage.u.name}}: {{group.lastMessage.msg}} </div>
<div class="item-files" *ngIf="group.lastMessage.file">
<fa-icon icon="file-alt" class="file-icon" [class.set-active-item-font-to-white]="group._id == idSelected"></fa-icon>
+1
View File
@@ -382,6 +382,7 @@ hideRefreshButton(){
async getDirectMessages(event?){
this.chatService.getAllDirectMessages().subscribe(async (res:any)=>{
console.log(res.ims);
if(res != 200){
//console.log(res.ims);
@@ -40,11 +40,11 @@
<ion-content>
<ion-refresher name="refresher" slot="fixed" (ionRefresh)="doRefresh($event)">
<!-- <ion-refresher name="refresher" slot="fixed" (ionRefresh)="doRefresh($event)">
<ion-progress-bar type="indeterminate" *ngIf="showLoader"></ion-progress-bar>
<ion-refresher-content>
</ion-refresher-content>
</ion-refresher>
</ion-refresher> -->
<div (click)="handleClick()" class="messages overflow-y-auto" #scrollMe>
<div class="welcome-text">
@@ -41,11 +41,11 @@
<ion-content>
<ion-refresher name="refresher" slot="fixed" (ionRefresh)="doRefresh($event)">
<!-- <ion-refresher name="refresher" slot="fixed" (ionRefresh)="doRefresh($event)">
<ion-progress-bar type="indeterminate" *ngIf="showLoader"></ion-progress-bar>
<ion-refresher-content>
</ion-refresher-content>
</ion-refresher>
</ion-refresher> -->
<div (click)="handleClick()" class="messages" #scrollMe>
<div class="messages-list-item-wrapper container-width-100" *ngFor="let msg of chatMessageStore.message[roomId]; let last = last"
@@ -58,13 +58,13 @@
<div>
<ion-label>{{msg.msg}}</ion-label>
<div *ngIf="msg.attachments" class="message-attachments">
<div *ngFor="let file of msg.attachments">
<div *ngFor="let file of msg.attachments let i = index">
<img *ngIf="file.image_url" src="{{file.image_url}}" alt="image">
<div>
<div>
<div class="file">
<!-- <canvas id="pdf_canvas"></canvas> -->
<div (click)="viewDocument(file)" class="file-details add-ellipsis cursor-pointer" *ngIf="msg.file">
<div (click)="docIndex(i); viewDocument(msg.file)" class="file-details add-ellipsis cursor-pointer" *ngIf="msg.file">
<span *ngIf="msg.file.type">
<fa-icon *ngIf="msg.file.type == 'application/pdf'" icon="file-pdf" class="pdf-icon"></fa-icon>
<fa-icon *ngIf="msg.file.type == 'application/word'" icon="file-word" class="word-icon"></fa-icon>
+97 -23
View File
@@ -4,11 +4,14 @@ import { GestureController, Gesture, ModalController, NavParams, PopoverControll
import { map } from 'rxjs/operators';
import { ViewDocumentPage } from 'src/app/modals/view-document/view-document.page';
import { EventPerson } from 'src/app/models/eventperson.model';
import { ExpedientTaskModalPageNavParamsTask } from 'src/app/models/ExpedientTaskModalPage';
import { SearchDocumentDetails, SearchFolderDetails } from 'src/app/models/search-document';
import { ContactsPage } from 'src/app/pages/chat/messages/contacts/contacts.page';
import { AlertService } from 'src/app/services/alert.service';
import { AuthService } from 'src/app/services/auth.service';
import { ChatService } from 'src/app/services/chat.service';
import { FileService } from 'src/app/services/functions/file.service';
import { ProcessesService } from 'src/app/services/processes.service';
import { synchro } from 'src/app/services/socket/synchro.service';
import { ToastService } from 'src/app/services/toast.service';
import { NewEventPage } from 'src/app/shared/agenda/new-event/new-event.page';
@@ -55,6 +58,10 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
showMessageOptions = false;
selectedMsgId:string;
dicIndex = 0;
task: ExpedientTaskModalPageNavParamsTask;
LoadedDocument:any = null;
constructor(
public popoverController: PopoverController,
private modalController: ModalController,
@@ -67,6 +74,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
private activatedRoute: ActivatedRoute,
private fileService: FileService,
private gestureController: GestureController,
private processes: ProcessesService,
) {
/* this.activatedRoute.paramMap.subscribe(params => {
if(params["params"].SerialNumber) {
@@ -111,19 +119,19 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
this.scrollChangeCallback = () => this.onContentScrolled(event);
window.addEventListener('scroll', this.scrollChangeCallback, true);
const gesture = this.gestureController.create({
el: this.rectangle.nativeElement,
gestureName:'long-press',
onStart: () => { alert('OP') },
/* onMove () => {
console.log('Move');
}, */
onEnd: () => {
console.log('ENNNNNDS');
},
})
// const gesture = this.gestureController.create({
// el: this.rectangle.nativeElement,
// gestureName:'long-press',
// onStart: () => { alert('OP') },
// /* onMove () => {
// console.log('Move');
// }, */
// onEnd: () => {
// console.log('ENNNNNDS');
// },
// })
gesture.enable();
// gesture.enable();
}
handlePress(id?:string){
@@ -275,6 +283,8 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
}
viewDocument(file:any){
console.log(file);
if(file.type == "file"){
let fullUrl = "https://www.tabularium.pt" + file.title_link;
this.fileService.viewDocumentByUrl(fullUrl);
@@ -285,17 +295,80 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
}
}
docIndex(index: number){
this.dicIndex = index
}
async openViewDocumentModal(file:any){
const modal = await this.modalController.create({
component: ViewDocumentPage,
componentProps: {
file: file,
},
cssClass: 'modal modal-desktop',
backdropDismiss: false
console.log(file);
const docId = file.DocId;
const applicationId: any = file.ApplicationId;
this.processes.GetDocumentDetails(docId, applicationId).subscribe( async(res)=> {
this.LoadedDocument = res;
this.LoadedDocument.Subject = this.LoadedDocument.Assunto
let thedate = new Date(this.LoadedDocument.DateDispatch || this.LoadedDocument.DocDate);
//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')
}
const modal = await this.modalController.create({
component: ViewDocumentPage,
componentProps: {
trustedUrl: '',
file: {
title: task.workflowInstanceDataFields.Subject,
url: '',
title_link: '',
},
Document: this.LoadedDocument,
applicationId: document.ApplicationID || document.ApplicationId,
docId: document.ApplicationID || document.ApplicationId,
folderId: folder['FolderId'] || folder['FolderID'] || folder.folderId
},
cssClass: 'modal modal-desktop'
});
await modal.present();
});
await modal.present();
modal.onDidDismiss();
}
getChatMembers() {
@@ -401,6 +474,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
}
async openChatOptions(ev?: any) {
const roomId = this.roomId
console.log(this.members);
const popover = await this.popoverController.create({
@@ -421,11 +495,11 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
this.bookMeeting();
}
else if(res['data'] == 'take-picture'){
this.fileService.addCameraPictureToChat(this.roomId);
this.fileService.addCameraPictureToChat(roomId);
//this.loadPicture();
}
else if(res['data'] == 'add-picture'){
this.fileService.addPictureToChat(this.roomId);
this.fileService.addPictureToChatMobile(roomId);
//this.loadPicture();
}
else if(res['data'] == 'add-document'){
@@ -74,13 +74,11 @@
<ion-buttons class="flex-grow-1" slot="start">
<button class="btn-cancel" fill="clear" color="#061b52" (click)="close()">
<ion-label>Cancelar</ion-label>
<ion-icon name="close" slot="start"></ion-icon>
</button>
</ion-buttons>
<ion-buttons class="flex-grow-1" slot="end">
<button class="btn-ok" fill="clear" color="#fff" (click)="save()">
<ion-label>Gravar</ion-label>
<ion-icon name="checkmark" slot="start"></ion-icon>
</button>
</ion-buttons>
</ion-toolbar>
@@ -26,13 +26,13 @@
refreshingText="A actualizar...">
</ion-refresher-content>
</ion-refresher>
<div class="main-content width-100 overflow-y-auto height-100">
<ion-progress-bar type="indeterminate" *ngIf="skeletonLoader"></ion-progress-bar>
<div >
<ion-list>
<div
class="expediente ion-no-padding ion-no-margin cursor-pointer"
class="expediente ion-no-padding ion-no-margin cursor-pointer"
*ngFor = "let task of despachoprstore.list; let i = index"
(click)="goToDespachoPr(task.SerialNumber)"
>
@@ -63,17 +63,17 @@
</div>
</div>
</ion-list>
</div>
<div
*ngIf="!skeletonLoader && despachoprstore.list.length == 0"
<div
*ngIf="!skeletonLoader && despachoprstore.list.length == 0"
class="empty-list d-flex height-100 align-center justify-content-center"
>
<span>Lista vazia</span>
</div>
<div *ngIf="skeletonLoader && despachoprstore.list.length == 0">
<!-- <div *ngIf="skeletonLoader && despachoprstore.list.length == 0">
<ion-list>
<ion-item>
<ion-thumbnail slot="end">
@@ -96,7 +96,7 @@
</ion-label>
</ion-item>
</ion-list>
</div>
</div> -->
</div>
@@ -59,7 +59,7 @@
<div class="bottom-content width-100">
<ion-list>
<h5>Documentos Anexados</h5>
<ion-item *ngFor="let attachment of attachments"
<ion-item *ngFor="let attachment of attachments"
class="ion-no-margin ion-no-padding cursor-pointer"
>
<ion-label
@@ -126,7 +126,7 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
) {
this.loggeduser = authService.ValidatedUser;
window.onresize = (event) => {
// if not mobile remove all component
@@ -143,7 +143,7 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
// this.eventoaprovacaostore.resetmd([])
// this.eventoaprovacaostore.resetpr([])
}
ngDoCheck(): void {
@@ -183,6 +183,7 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
callback: ()=> {
this.checkRoutes();
this.LoadCounts();
this.loadAllProcesses();
}
})
}
@@ -303,12 +304,12 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
goToProcess(serialNumber:string, workflowName:string, activityName:string){
if(workflowName == 'Despacho') {
if(activityName == 'Tarefa de Despacho'){
if(activityName == 'Tarefa de Despacho' || activityName == 'Concluir Despacho'){
this.router.navigate(['/home/gabinete-digital/despachos',serialNumber,'gabinete-digital']);
}
}
else if(workflowName == 'Despacho do Presidente da República') {
if(activityName == 'Tarefa de Despacho'){
if(activityName == 'Tarefa de Despacho' || activityName == 'Concluir Despacho'){
this.router.navigate(['/home/gabinete-digital/despachos-pr',serialNumber,'gabinete-digital']);
}
else if(activityName == 'Revisar Diploma' || activityName == 'Assinar Diploma'){
@@ -565,6 +566,7 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
break;
} */
this.LoadCounts();
this.loadAllProcesses();
//this.refreshExpedientes();
if(event){
@@ -13,7 +13,7 @@
</div>
</div>
<ion-toolbar>
<ion-segment [(ngModel)]="segment" (ionChange)="segmentChanged($event)">
<ion-segment [(ngModel)]="segment" (ionChange)="segmentChanged($event)" >
<ion-segment-button value="parecer">
Parecer
</ion-segment-button>
@@ -27,7 +27,7 @@
<ion-content>
<div class="main-content width-100 overflow-y-auto height-100">
<ion-refresher name="refresher" slot="fixed" (ionRefresh)="segmentChanged($event)">
<ion-refresher name="refresher" slot="fixed" (ionRefresh)="doRefresh($event)">
<ion-refresher-content
pullingIcon="chevron-down-circle-outline"
pullingText="deslize para actualizar"
+5 -3
View File
@@ -17,21 +17,23 @@ export class FileLoaderService {
createInput({accept, type = 'file'}:createInput): HTMLInputElement {
let input = document.createElement('input');
input.type = type || 'file';
input.accept = accept.join(', ')
// input.onchange = () => {
// // you can use this method to get file and perform respective operations
// let files = Array.from(input.files);
// console.log(files);
// };
input.click();
return input
}
getFirstFile(input: HTMLInputElement) {
+96 -10
View File
@@ -86,38 +86,114 @@ export class FileService {
}
addCameraPictureToChat(roomId){
let data = this.takePicture();
if(data.name != null){
const options: CameraOptions = {
quality: 50,
destinationType: this.camera.DestinationType.DATA_URL,
encodingType: this.camera.EncodingType.JPEG,
mediaType: this.camera.MediaType.PICTURE,
targetWidth: 720,
targetHeight: 720,
}
this.camera.getPicture(options).then((imageData) => {
this.capturedImage = 'data:image/png;base64,'+imageData;
this.capturedImageTitle = new Date().getTime() + '.jpeg';
let body = {
"message":
{
"rid": roomId,
"msg": "",
"attachments": [{
"title": data.name,
"title": this.capturedImageTitle,
"title_link_download": false,
"image_url": data.image,
"image_url": this.capturedImage,
}]
}
}
const loader = this.toastService.loading();
this.chatService.sendMessage(body).subscribe(res=> {
console.log(res);
loader.remove();
},(error) => {
loader.remove();
this.toastService.badRequest("Não foi possível adicionar a fotografia!");
});
}
else{
}, (err) => {
this.toastService.badRequest("Não foi possível adicionar a fotografia!");
}
});
}
addPictureToChat(roomId:string) {
addPictureToChatMobile(roomId) {
alert('Here')
const options: CameraOptions = {
quality: 90,
sourceType: this.camera.PictureSourceType.PHOTOLIBRARY,
destinationType: this.camera.DestinationType.DATA_URL,
encodingType: this.camera.EncodingType.JPEG,
mediaType: this.camera.MediaType.PICTURE,
targetWidth: 720,
targetHeight: 720,
correctOrientation: true
}
this.camera.getPicture(options).then((imageData) => {
let base64Image = 'data:image/jpeg;base64,' + imageData;
this.capturedImage = imageData;
this.capturedImageTitle = new Date().getTime() + '.jpeg';
//const loader = this.toastService.loading();
let body = {
"message":
{
"rid": roomId,
"msg": "",
"attachments": [{
//"title": this.capturedImageTitle ,
//"text": "description",
"title_link_download": false,
"image_url": this.capturedImage,
}]
}
}
console.log(this.capturedImage)
this.chatService.sendMessage(body).subscribe(res=> {
//loader.remove();
//console.log(res);
},(error) => {
//loader.remove();
});
}, (err) => {
//console.log(err);
});
}
addPictureToChat(roomId) {
const input = this.fileLoaderService.createInput({
accept: ['image/apng', 'image/jpeg', 'image/png']
})
setInterval(()=>{
console.log(input.value)
}, 550)
input.onchange = async () => {
alert('Onchange AQUI')
const file = this.fileLoaderService.getFirstFile(input)
console.log(file);
@@ -141,6 +217,8 @@ export class FileService {
}
}
console.log(this.capturedImage)
this.chatService.sendMessage(body).subscribe(res=> {
loader.remove();
//console.log(res);
@@ -189,6 +267,8 @@ export class FileService {
modal.onDidDismiss().then(async res=>{
const data = res.data;
alert('HERE')
if(data.selected){
const loader = this.toastService.loading();
@@ -197,6 +277,10 @@ export class FileService {
console.log(res.data.selected.Id);
console.log(res.data.selected.ApplicationType);
console.log('AQUIIIII');
alert('HERE 2')
let url = await this.processesService.GetDocumentUrl(res.data.selected.Id, res.data.selected.ApplicationType).toPromise();
let url_no_options: string = url.replace("webTRIX.Viewer","webTRIX.Viewer.Branch1");
console.log(url_no_options);
@@ -218,7 +302,9 @@ export class FileService {
}],
"file":{
"name": res.data.selected.Assunto,
"type": "application/webtrix"
"type": "application/webtrix",
"ApplicationId": res.data.selected.ApplicationType,
"DocId": res.data.selected.Id,
}
}
}
@@ -138,9 +138,6 @@
<ion-fab-button (click)="bookMeeting()" color="light">
<ion-icon name="calendar"></ion-icon>
</ion-fab-button>
<ion-fab-button (click)="addFileWebtrix()" color="light">
<ion-icon src="assets/icon/webtrix.svg"></ion-icon>
</ion-fab-button>
<ion-fab-button (click)="addFile()" color="light">
<ion-icon name="document"></ion-icon>
</ion-fab-button>
@@ -150,6 +147,9 @@
<ion-fab-button class="hide-desktop" (click)="takePicture()" color="light">
<ion-icon name="camera"></ion-icon>
</ion-fab-button>
<ion-fab-button (click)="addFileWebtrix()" color="light">
<ion-icon src="assets/icon/webtrix.svg"></ion-icon>
</ion-fab-button>
</ion-fab-list>
</ion-fab>
</div>
@@ -111,9 +111,6 @@
<ion-fab-button (click)="bookMeeting()" color="light">
<ion-icon name="calendar"></ion-icon>
</ion-fab-button>
<ion-fab-button (click)="addFileWebtrix()" color="light">
<ion-icon src="assets/icon/webtrix.svg"></ion-icon>
</ion-fab-button>
<ion-fab-button (click)="addFile()" color="light">
<ion-icon name="document"></ion-icon>
</ion-fab-button>
@@ -123,6 +120,9 @@
<ion-fab-button class="hide-desktop" (click)="takePicture()" color="light">
<ion-icon name="camera"></ion-icon>
</ion-fab-button>
<ion-fab-button (click)="addFileWebtrix()" color="light">
<ion-icon src="assets/icon/webtrix.svg"></ion-icon>
</ion-fab-button>
</ion-fab-list>
</ion-fab>
@@ -380,10 +380,12 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
takePicture(){
this.fileService.addCameraPictureToChat(this.roomId);
const roomId = this.roomId
this.fileService.addCameraPictureToChat(roomId);
}
addImage(){
this.fileService.addPictureToChat(this.roomId);
const roomId = this.roomId
this.fileService.addPictureToChat(roomId);
}
addFile(){
this.fileService.addDocumentToChat(this.roomId);
@@ -75,13 +75,11 @@
<ion-buttons slot="start">
<button class="btn-cancel" fill="clear" color="#061b52" (click)="close()">
<ion-label>Cancelar</ion-label>
<ion-icon name="close" slot="start"></ion-icon>
</button>
</ion-buttons>
<ion-buttons slot="end">
<button class="btn-ok" fill="clear" color="#fff" (click)="save()">
<ion-label>Gravar</ion-label>
<ion-icon name="checkmark" slot="start"></ion-icon>
</button>
</ion-buttons>
</ion-toolbar>
@@ -6,9 +6,9 @@
</div>
<div class="buttons">
<button (click)="takePicture()" full class="btn-ok" shape="round" >Tirar Fotografia</button>
<button hidden (click)="notImplemented()" class="btn-ok" shape="round" >Digitalizar Documento</button>
<button (click)="anexarFoto()" full class="btn-ok" shape="round" >Anexar Fotografia</button>
<button (click)="addDocGestaoDocumental()" class="btn-ok" shape="round" >Anexar Documento (G.D.)</button>
<button (click)="addFile()" class="btn-ok" shape="round" >Anexar Documento</button>
<button hidden (click)="anexarFoto()" full class="btn-ok" shape="round" >Anexar Fotografia</button>
<button (click)="addDocGestaoDocumental()" class="btn-ok" shape="round" >Gestão Documental</button>
<div class="solid"></div>
<button (click)="bookMeeting()" class="btn-ok" shape="round" >Novo Evento</button>
<button (click)="close()" full class="btn-cancel" shape="round" >Cancelar</button>
@@ -54,6 +54,15 @@ export class ChatOptionsPopoverPage implements OnInit {
}
}
addFile(){
if( window.innerWidth < 701){
this.popoverController.dismiss('add-document');
}
else{
this.modalController.dismiss('add-document');
}
}
anexarFoto(){
if( window.innerWidth < 701){
this.popoverController.dismiss('add-picture');