mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 21:06:06 +00:00
merge made with feature/gabinete-search branch
This commit is contained in:
@@ -272,6 +272,10 @@ const routes = [
|
||||
},
|
||||
{
|
||||
path: 'task-list-header',
|
||||
loadChildren: () => import('./shared/gabinete-digital/generic/task-list-header/task-list-header.module').then( m => m.TaskListHeaderPageModule)
|
||||
},
|
||||
{
|
||||
path: 'tiny-mce',
|
||||
loadChildren: () => import('./tiny-mce/tiny-mce.module').then( m => m.TinyMCEPageModule)
|
||||
}
|
||||
|
||||
|
||||
@@ -80,6 +80,7 @@ import { BrowserTracing } from '@sentry/tracing';
|
||||
import { AngularFireModule } from '@angular/fire';
|
||||
import { AngularFireMessagingModule } from '@angular/fire/messaging';
|
||||
import { firebaseConfig } from '../firebase-config';
|
||||
import { EditorModule } from '@tinymce/tinymce-angular';
|
||||
|
||||
// import { ServiceWorkerModule } from '@angular/service-worker';
|
||||
// import { AngularFireModule } from '@angular/fire';
|
||||
@@ -161,6 +162,7 @@ import { FirebaseX } from '@ionic-native/firebase-x/ngx'; */
|
||||
MatButtonModule,
|
||||
AngularFireModule.initializeApp(firebaseConfig),
|
||||
AngularFireMessagingModule,
|
||||
EditorModule
|
||||
|
||||
],
|
||||
providers: [
|
||||
@@ -196,7 +198,7 @@ import { FirebaseX } from '@ionic-native/firebase-x/ngx'; */
|
||||
MultipleDocumentsPicker,
|
||||
NgxExtendedPdfViewerModule,
|
||||
FileOpener,
|
||||
DocumentViewer
|
||||
DocumentViewer,
|
||||
|
||||
],
|
||||
bootstrap: [AppComponent],
|
||||
|
||||
@@ -91,7 +91,8 @@ export class ViewDocumentPage implements OnInit {
|
||||
cssClass: 'model aside-modal search-submodal',
|
||||
componentProps: {
|
||||
fulltask: this.task,
|
||||
task: this.task
|
||||
task: this.task,
|
||||
content: ""
|
||||
}
|
||||
});
|
||||
await modal.present();
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
import { environment } from 'src/environments/environment';
|
||||
import { models } from 'src/plugin/src';
|
||||
const { ArrayField, JsonField} = models.indexedDB.fields;
|
||||
|
||||
export class CalendarEventModel extends models.Model {
|
||||
startTime = models.CharField()
|
||||
endTime = models.CharField()
|
||||
allDay = models.BooleanField()
|
||||
event = JsonField({blank:true})
|
||||
calendarName = models.CharField()
|
||||
profile = models.CharField()
|
||||
id = models.CharField()
|
||||
CalendarId = models.CharField()
|
||||
}
|
||||
|
||||
export class EventForToday extends models.Model {
|
||||
|
||||
}
|
||||
|
||||
|
||||
models.register({
|
||||
databaseName: 'agenda'+environment.version.lastCommitNumber + environment.id,
|
||||
type: 'indexedDB',
|
||||
version: 14,
|
||||
models: [CalendarEventModel, EventForToday]
|
||||
})
|
||||
@@ -0,0 +1,60 @@
|
||||
import { AES, SHA1, enc } from "crypto-js";
|
||||
import { environment } from 'src/environments/environment'
|
||||
|
||||
|
||||
function prefix() {
|
||||
return environment.version.lastCommitNumber + environment.id+"-";
|
||||
}
|
||||
|
||||
export function GET({key, localStorage, instance}) {
|
||||
if(environment.storageProduction) {
|
||||
|
||||
try {
|
||||
const newKey = prefix() + SHA1(key).toString()
|
||||
const cipherText = localStorage.getItem(newKey)
|
||||
const bytes = AES.decrypt(cipherText, newKey)
|
||||
var decryptedData = bytes.toString(enc.Utf8);
|
||||
const restoredData = JSON.parse(decryptedData)
|
||||
|
||||
Object.assign(instance, restoredData);
|
||||
|
||||
return restoredData
|
||||
|
||||
} catch(error) {
|
||||
console.log(error)
|
||||
return {}
|
||||
}
|
||||
|
||||
} else {
|
||||
const restoredData = JSON.parse(localStorage.getItem(prefix() + key))
|
||||
Object.assign(instance, restoredData);
|
||||
|
||||
return restoredData
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export function SAVE({key, localStorage, instance, dataToSave}) {
|
||||
if(environment.storageProduction) {
|
||||
const newKey = prefix() + SHA1(key).toString()
|
||||
const stringifyData = JSON.stringify(dataToSave)
|
||||
|
||||
const cipherText = AES.encrypt(stringifyData, newKey).toString();
|
||||
|
||||
localStorage.setItem(newKey, cipherText)
|
||||
|
||||
} else {
|
||||
const stringifyData = JSON.stringify(dataToSave)
|
||||
localStorage.setItem(prefix() + key, stringifyData)
|
||||
}
|
||||
}
|
||||
|
||||
export function DELETE({key, localStorage, instance}) {
|
||||
if(environment.storageProduction) {
|
||||
const newKey = prefix() + SHA1(key).toString()
|
||||
localStorage.removeItem(newKey)
|
||||
|
||||
} else {
|
||||
localStorage.removeItem(prefix() + key)
|
||||
}
|
||||
}
|
||||
+11
-13
@@ -1,5 +1,6 @@
|
||||
import { models } from 'beast-orm'
|
||||
//import { models } from 'beast-orm'
|
||||
import { environment } from 'src/environments/environment'
|
||||
import { models } from 'src/plugin/src'
|
||||
const { ArrayField, JsonField} = models.indexedDB.fields
|
||||
|
||||
export class MessageModel extends models.Model {
|
||||
@@ -60,7 +61,14 @@ export class ActionModel extends models.Model{
|
||||
ActionType = models.CharField()
|
||||
}
|
||||
|
||||
export class PublicationModel extends models.Model{
|
||||
|
||||
export class PublicationFolderModel extends models.Model{
|
||||
DateBegin = models.CharField()
|
||||
Description = models.CharField()
|
||||
Detail = models.CharField()
|
||||
}
|
||||
|
||||
export class PublicationDetailsModel extends models.Model{
|
||||
DateIndex = models.CharField()
|
||||
DocumentId = models.IntegerField({unique: true})
|
||||
ProcessId = models.CharField()
|
||||
@@ -73,15 +81,6 @@ export class PublicationModel extends models.Model{
|
||||
OrganicEntityId = models.IntegerField()
|
||||
}
|
||||
|
||||
models.register({
|
||||
databaseName: 'actions'+environment.version.lastCommitNumber + environment.id,
|
||||
type: 'indexedDB',
|
||||
version: 14,
|
||||
models: [PublicationModel, ActionModel]
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
export class WebtrixUserModel extends models.Model {
|
||||
FullName = models.CharField()
|
||||
@@ -100,6 +99,5 @@ models.register({
|
||||
databaseName: 'actions'+environment.version.lastCommitNumber + environment.id,
|
||||
type: 'indexedDB',
|
||||
version: 14,
|
||||
models: [PublicationModel, ActionModel]
|
||||
models: [PublicationDetailsModel, ActionModel, PublicationFolderModel]
|
||||
})
|
||||
|
||||
|
||||
@@ -63,6 +63,7 @@ export class fullTask {
|
||||
UserName: string,
|
||||
WorkflowID: string,
|
||||
wxUserID: number,
|
||||
DraftIds: string
|
||||
}
|
||||
Documents: any[]
|
||||
workflowInstanceFolio: string
|
||||
|
||||
@@ -3,6 +3,7 @@ export interface Environment {
|
||||
apiURL: string;
|
||||
apiChatUrl: string;
|
||||
apiWsChatUrl: string;
|
||||
apiPCURL: string;
|
||||
logoLabel: string;
|
||||
production: boolean;
|
||||
domain: string;
|
||||
@@ -19,6 +20,7 @@ export interface Environment {
|
||||
PR: string
|
||||
VP: string
|
||||
dispatchPR: string
|
||||
storageProduction: boolean
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ import { PermissionService } from 'src/app/services/permission.service';
|
||||
import { ViewEventPage } from 'src/app/modals/view-event/view-event.page';
|
||||
import { ChangeProfileService } from 'src/app/services/change-profile.service';
|
||||
import { SessionStore } from 'src/app/store/session.service';
|
||||
import { TaskService } from 'src/app/services/task.service'
|
||||
import { TaskService } from 'src/app/services/task.service';
|
||||
@Component({
|
||||
selector: 'app-events',
|
||||
templateUrl: './events.page.html',
|
||||
|
||||
@@ -66,10 +66,10 @@
|
||||
<div class="bottom-content width-100">
|
||||
<ion-list *ngIf="fulltask.Documents">
|
||||
<h5>Documentos Anexados</h5>
|
||||
<ion-item *ngFor="let attachment of fulltask.Documents"
|
||||
<ion-item *ngFor="let attachment of mergedArray"
|
||||
class="ion-no-margin ion-no-padding cursor-pointer">
|
||||
<ion-label
|
||||
(click)="viewDocument(attachment.DocId, attachment)">
|
||||
(click)="viewDocument(attachment.DocId, attachment, attachment.content)">
|
||||
<p *ngIf="attachment.Assunto" class="attach-title-item">{{ attachment.Assunto }}<span class="span-right color-red btn-size"><ion-icon hidden name="close"></ion-icon></span></p>
|
||||
<p *ngIf="!attachment.Assunto" class="attach-title-item">{{ attachment.DocNumber }}<span class="span-right color-red btn-size"><ion-icon hidden name="close"></ion-icon></span></p>
|
||||
<p><span class="span-left">{{attachment.Sender}}</span><span class="span-right">{{ attachment.DocDate | date: 'dd/MM/yy' }}</span></p>
|
||||
|
||||
@@ -21,6 +21,7 @@ import { RouteService } from 'src/app/services/route.service';
|
||||
import { PermissionService } from 'src/app/services/permission.service';
|
||||
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
|
||||
import { TaskService } from 'src/app/services/task.service'
|
||||
import { TinyMCEPage } from 'src/app/tiny-mce/tiny-mce.page';
|
||||
|
||||
@Component({
|
||||
selector: 'app-despacho-pr',
|
||||
@@ -41,6 +42,7 @@ export class DespachoPrPage implements OnInit {
|
||||
profile: string;
|
||||
intervenientes: any =[]
|
||||
cc: any = [];
|
||||
mergedArray: any = [];
|
||||
|
||||
constructor(
|
||||
private activateRoute: ActivatedRoute,
|
||||
@@ -121,6 +123,15 @@ export class DespachoPrPage implements OnInit {
|
||||
"TaskStartDate": res.taskStartDate
|
||||
}
|
||||
this.fulltask = res;
|
||||
let stringDraft = res.workflowInstanceDataFields.DraftIds;
|
||||
let split_stringDraft = stringDraft?.split(",");
|
||||
|
||||
try {
|
||||
this.getDraft(split_stringDraft);
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
this.getDocumentPdf(this.fulltask.Documents)
|
||||
|
||||
// this.updateProcessOnDB(res);
|
||||
// console.log('this.fulltask', this.fulltask)
|
||||
@@ -177,26 +188,40 @@ export class DespachoPrPage implements OnInit {
|
||||
|
||||
}
|
||||
|
||||
async viewDocument(DocId: string, Document) {
|
||||
async viewDocument(docId: string, Document, content) {
|
||||
|
||||
const modal = await this.modalController.create({
|
||||
component: ViewDocumentPage,
|
||||
componentProps: {
|
||||
trustedUrl: '',
|
||||
file: {
|
||||
title: Document.Assunto,
|
||||
url: '',
|
||||
title_link: '',
|
||||
if (Document.content == "") {
|
||||
const modal = await this.modalController.create({
|
||||
component: ViewDocumentPage,
|
||||
componentProps: {
|
||||
trustedUrl: '',
|
||||
file: {
|
||||
title: Document.Assunto,
|
||||
url: '',
|
||||
title_link: '',
|
||||
},
|
||||
Document,
|
||||
applicationId: Document.ApplicationId,
|
||||
docId: Document.DocId || Document.SourceId,
|
||||
folderId: this.task.FolderId,
|
||||
task: this.fulltask
|
||||
},
|
||||
Document,
|
||||
applicationId: Document.ApplicationId,
|
||||
docId: Document.DocId || Document.SourceId,
|
||||
folderId: this.task.FolderId,
|
||||
task: this.fulltask
|
||||
},
|
||||
cssClass: 'modal modal-desktop'
|
||||
});
|
||||
await modal.present();
|
||||
cssClass: 'modal modal-desktop'
|
||||
});
|
||||
await modal.present();
|
||||
} else {
|
||||
const modal = await this.modalController.create({
|
||||
component: TinyMCEPage,
|
||||
componentProps: {
|
||||
Document,
|
||||
content
|
||||
},
|
||||
cssClass: 'modal modal-desktop'
|
||||
});
|
||||
await modal.present();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -557,5 +582,49 @@ export class DespachoPrPage implements OnInit {
|
||||
|
||||
}
|
||||
|
||||
getDocumentPdf(Documents: any) {
|
||||
Documents.forEach(element => {
|
||||
let docObject = {
|
||||
"ApplicationId": element.ApplicationId,
|
||||
"Assunto": element.Assunto,
|
||||
"DocDate": element.DocDate,
|
||||
"DocId": element.DocId,
|
||||
"DocNumber": element.DocNumber,
|
||||
"FolderId": element.FolderId,
|
||||
"Sender": element.Sender,
|
||||
"SourceDocId": element.SourceDocId,
|
||||
"content": "",
|
||||
"path": "",
|
||||
"ownerId": "",
|
||||
"status": "",
|
||||
}
|
||||
this.mergedArray.push(docObject);
|
||||
});
|
||||
}
|
||||
getDraft(split_stringDraft: string[]) {
|
||||
split_stringDraft.forEach(element => {
|
||||
console.log('List of ids', element)
|
||||
this.processes.GetDraftByID(element).subscribe((resd) => {
|
||||
let object = {
|
||||
"ApplicationId": "",
|
||||
"Assunto": resd.data.description,
|
||||
"DocDate": "",
|
||||
"DocId": resd.data.id,
|
||||
"DocNumber": "",
|
||||
"FolderId": "",
|
||||
"Sender": "",
|
||||
"SourceDocId": "",
|
||||
"content": resd.data.content,
|
||||
"path": resd.data.path,
|
||||
"ownerId": resd.data.ownerId,
|
||||
"status": resd.data.status,
|
||||
}
|
||||
this.mergedArray.push(object)
|
||||
console.log('List of draff', resd)
|
||||
})
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -63,8 +63,8 @@
|
||||
<div class="bottom-content width-100">
|
||||
<ion-list>
|
||||
<h5>Documentos Anexados</h5>
|
||||
<ion-item class="ion-no-margin ion-no-padding cursor-pointer" *ngFor="let Document of fulltask.Documents">
|
||||
<ion-label class="d-block" (click)="viewDocument(Document.DocId, Document)">
|
||||
<ion-item class="ion-no-margin ion-no-padding cursor-pointer" *ngFor="let Document of mergedArray">
|
||||
<ion-label class="d-block" (click)="viewDocument(Document.DocId, Document,Document.content)">
|
||||
<p class="attach-title-item">{{ Document.Assunto || "Sem assunto" }}<span class="span-right color-red btn-size"><ion-icon hidden name="close"></ion-icon></span></p>
|
||||
<p><span class="span-left">{{ Document.Sender}}</span><span class="span-right">{{ Document.DocDate | date: 'dd-MM-yyyy HH:mm' }}</span></p>
|
||||
</ion-label>
|
||||
|
||||
@@ -21,6 +21,7 @@ import { ThemeService } from 'src/app/services/theme.service'
|
||||
import { RouteService } from 'src/app/services/route.service';
|
||||
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
|
||||
import { TaskService } from 'src/app/services/task.service'
|
||||
import { TinyMCEPage } from 'src/app/tiny-mce/tiny-mce.page';
|
||||
|
||||
|
||||
@Component({
|
||||
@@ -39,6 +40,7 @@ export class DespachoPage implements OnInit {
|
||||
|
||||
attachments: any;
|
||||
fulltask: any;
|
||||
mergedArray: any = [];
|
||||
eventsList: Event[] = [];
|
||||
serialnumber: string;
|
||||
caller: string;
|
||||
@@ -47,6 +49,7 @@ export class DespachoPage implements OnInit {
|
||||
cc: any = [];
|
||||
executadoText: string = "Executado";
|
||||
gerarText: string = "Gerar"
|
||||
draftDocumentIds;
|
||||
|
||||
|
||||
constructor(private activateRoute: ActivatedRoute,
|
||||
@@ -106,7 +109,16 @@ export class DespachoPage implements OnInit {
|
||||
async LoadTaskDetail(serial: string) {
|
||||
this.processes.GetTask(serial).subscribe((res: fullTask) => {
|
||||
this.TaskService.loadDiplomas();
|
||||
|
||||
let stringDraft = res.workflowInstanceDataFields.DraftIds;
|
||||
console.log('sring to array', stringDraft)
|
||||
let split_stringDraft = stringDraft?.split(",");
|
||||
|
||||
try {
|
||||
this.getDraft(split_stringDraft);
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
|
||||
this.task = {
|
||||
"SerialNumber": res.serialNumber,
|
||||
"Folio": res.workflowInstanceDataFields.Subject,
|
||||
@@ -123,25 +135,29 @@ export class DespachoPage implements OnInit {
|
||||
"DeadlineType": res.workflowInstanceDataFields.DeadlineType,
|
||||
"activityInstanceName": res.activityInstanceName,
|
||||
"Status": res.workflowInstanceDataFields.Status,
|
||||
"Deadline": res.deadline
|
||||
"Deadline": res.deadline,
|
||||
}
|
||||
|
||||
// this.updateProcessOnDB(res);
|
||||
this.fulltask = res;
|
||||
|
||||
this.getDocumentPdf(this.fulltask.Documents)
|
||||
|
||||
console.log('All', this.mergedArray)
|
||||
|
||||
let thedate = new Date(this.task.CreateDate);
|
||||
this.customDate = this.days[thedate.getDay()] + ", " + thedate.getDate() + " de " + (this.months[thedate.getMonth()]);
|
||||
|
||||
this.processes.GetTaskParticipants(this.task.FolderID).subscribe(users => {
|
||||
// this.updateProcessInterveners(users)
|
||||
|
||||
|
||||
|
||||
this.intervenientes = users.filter(user => {
|
||||
|
||||
|
||||
return user.Type == 'I';
|
||||
});
|
||||
this.cc = users.filter(user => {
|
||||
|
||||
|
||||
return user.Type == 'CC';
|
||||
});
|
||||
});
|
||||
@@ -158,6 +174,49 @@ export class DespachoPage implements OnInit {
|
||||
}
|
||||
});
|
||||
}
|
||||
getDocumentPdf(Documents: any) {
|
||||
Documents.forEach(element => {
|
||||
let docObject = {
|
||||
"ApplicationId": element.ApplicationId,
|
||||
"Assunto": element.Assunto,
|
||||
"DocDate": element.DocDate,
|
||||
"DocId": element.DocId,
|
||||
"DocNumber": element.DocNumber,
|
||||
"FolderId": element.FolderId,
|
||||
"Sender": element.Sender,
|
||||
"SourceDocId": element.SourceDocId,
|
||||
"content": "",
|
||||
"path": "",
|
||||
"ownerId": "",
|
||||
"status": "",
|
||||
}
|
||||
this.mergedArray.push(docObject);
|
||||
});
|
||||
}
|
||||
getDraft(split_stringDraft: string[]) {
|
||||
split_stringDraft.forEach(element => {
|
||||
console.log('List of ids', element)
|
||||
this.processes.GetDraftByID(element).subscribe((resd) => {
|
||||
let object = {
|
||||
"ApplicationId": "",
|
||||
"Assunto": resd.data.description,
|
||||
"DocDate": "",
|
||||
"DocId": resd.data.id,
|
||||
"DocNumber": "",
|
||||
"FolderId": "",
|
||||
"Sender": "",
|
||||
"SourceDocId": "",
|
||||
"content": resd.data.content,
|
||||
"path": resd.data.path,
|
||||
"ownerId": resd.data.ownerId,
|
||||
"status": resd.data.status,
|
||||
}
|
||||
this.mergedArray.push(object)
|
||||
console.log('List of draff', resd)
|
||||
})
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
// updateProcessOnDB(res) {
|
||||
// if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||
@@ -177,26 +236,40 @@ export class DespachoPage implements OnInit {
|
||||
|
||||
// }
|
||||
|
||||
async viewDocument(docId: string, Document) {
|
||||
async viewDocument(docId: string, Document, content) {
|
||||
|
||||
const modal = await this.modalController.create({
|
||||
component: ViewDocumentPage,
|
||||
componentProps: {
|
||||
trustedUrl: '',
|
||||
file: {
|
||||
title: Document.Assunto,
|
||||
url: '',
|
||||
title_link: '',
|
||||
if (Document.content == "") {
|
||||
const modal = await this.modalController.create({
|
||||
component: ViewDocumentPage,
|
||||
componentProps: {
|
||||
trustedUrl: '',
|
||||
file: {
|
||||
title: Document.Assunto,
|
||||
url: '',
|
||||
title_link: '',
|
||||
},
|
||||
Document,
|
||||
applicationId: Document.ApplicationId,
|
||||
docId: Document.DocId || Document.SourceId,
|
||||
folderId: this.task.FolderId,
|
||||
task: this.fulltask
|
||||
},
|
||||
Document,
|
||||
applicationId: Document.ApplicationId,
|
||||
docId: Document.DocId || Document.SourceId,
|
||||
folderId: this.task.FolderId,
|
||||
task: this.fulltask
|
||||
},
|
||||
cssClass: 'modal modal-desktop'
|
||||
});
|
||||
await modal.present();
|
||||
cssClass: 'modal modal-desktop'
|
||||
});
|
||||
await modal.present();
|
||||
} else {
|
||||
const modal = await this.modalController.create({
|
||||
component: TinyMCEPage,
|
||||
componentProps: {
|
||||
Document,
|
||||
content
|
||||
},
|
||||
cssClass: 'modal modal-desktop'
|
||||
});
|
||||
await modal.present();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -257,7 +330,7 @@ export class DespachoPage implements OnInit {
|
||||
await this.processes.CompleteTask(body).toPromise()
|
||||
this.httpErrorHandle.httpsSucessMessagge('Reexecução')
|
||||
this.TaskService.loadDespachos();
|
||||
//this.close();
|
||||
//this.close();
|
||||
|
||||
} catch (error) {
|
||||
this.httpErrorHandle.httpStatusHandle(error)
|
||||
@@ -268,7 +341,7 @@ export class DespachoPage implements OnInit {
|
||||
|
||||
}
|
||||
|
||||
async generateDiploma(note:string, documents:any) {
|
||||
async generateDiploma(note: string, documents: any) {
|
||||
let body = {
|
||||
"serialNumber": this.serialnumber,
|
||||
"action": "Reencaminhar",
|
||||
@@ -276,7 +349,7 @@ export class DespachoPage implements OnInit {
|
||||
"dataFields": {
|
||||
"ReviewUserComment": note,
|
||||
},
|
||||
"AttachmentList" :documents,
|
||||
"AttachmentList": documents,
|
||||
}
|
||||
|
||||
const loader = this.toastService.loading()
|
||||
@@ -288,7 +361,7 @@ export class DespachoPage implements OnInit {
|
||||
// this.close();
|
||||
} catch (error) {
|
||||
this.httpErrorHandle.httpStatusHandle(error);
|
||||
} finally {
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
|
||||
@@ -311,7 +384,7 @@ export class DespachoPage implements OnInit {
|
||||
loader.remove()
|
||||
this.httpErrorHandle.httpStatusHandle(error)
|
||||
});
|
||||
// loader.remove()
|
||||
// loader.remove()
|
||||
}
|
||||
|
||||
tstemethod(value: string) {
|
||||
@@ -319,7 +392,7 @@ export class DespachoPage implements OnInit {
|
||||
}
|
||||
|
||||
async openAddNoteModal(actionName: string) {
|
||||
|
||||
|
||||
let classs;
|
||||
if (window.innerWidth <= 800) {
|
||||
classs = 'modal modal-desktop'
|
||||
@@ -365,7 +438,7 @@ export class DespachoPage implements OnInit {
|
||||
else if (actionName == 'Reexecução') {
|
||||
await this.reexecute(res.data.note, docs);
|
||||
this.goBack();
|
||||
} else if(actionName == 'Gerar Diploma') {
|
||||
} else if (actionName == 'Gerar Diploma') {
|
||||
await this.generateDiploma(res.data.note, docs);
|
||||
this.goBack();
|
||||
}
|
||||
@@ -393,7 +466,7 @@ export class DespachoPage implements OnInit {
|
||||
});
|
||||
await modal.present();
|
||||
modal.onDidDismiss().then(async (res) => {
|
||||
|
||||
|
||||
|
||||
if (res['data'] == 'openDiscart') {
|
||||
await this.distartExpedientModal();
|
||||
@@ -439,9 +512,9 @@ export class DespachoPage implements OnInit {
|
||||
});
|
||||
await modal.present();
|
||||
modal.onDidDismiss().then(res => {
|
||||
if(res){
|
||||
if (res) {
|
||||
const data = res.data;
|
||||
if(data == 'close') {
|
||||
if (data == 'close') {
|
||||
this.goBack();
|
||||
}
|
||||
this.TaskService.loadDespachos();
|
||||
@@ -451,7 +524,7 @@ export class DespachoPage implements OnInit {
|
||||
}
|
||||
|
||||
async distartExpedientModal() {
|
||||
|
||||
|
||||
const modal = await this.modalController.create({
|
||||
component: DiscartExpedientModalPage,
|
||||
componentProps: {
|
||||
@@ -490,16 +563,22 @@ export class DespachoPage implements OnInit {
|
||||
translucent: true
|
||||
});
|
||||
await popover.present();
|
||||
|
||||
popover.onDidDismiss().then((res)=> {
|
||||
|
||||
popover.onDidDismiss().then((res) => {
|
||||
// console.log('res', res.data)
|
||||
if(res.data == 'back') {
|
||||
if (res.data == 'back') {
|
||||
this.goBack();
|
||||
}
|
||||
|
||||
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
function mergeArraysAndTag(array1, array2) {
|
||||
console.log('second', array2)
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -66,11 +66,11 @@
|
||||
<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 mergedArray"
|
||||
class="ion-no-margin ion-no-padding cursor-pointer"
|
||||
>
|
||||
<ion-label
|
||||
(click)="viewDocument(attachment.DocId, attachment)"
|
||||
(click)="viewDocument(attachment.DocId, attachment,attachment.content)"
|
||||
>
|
||||
<p *ngIf="attachment.Assunto" class="attach-title-item">{{ attachment.Assunto }}<span class="span-right color-red btn-size"><ion-icon hidden name="close"></ion-icon></span></p>
|
||||
<p *ngIf="!attachment.Assunto" class="attach-title-item">{{ attachment.DocNumber }}<span class="span-right color-red btn-size"><ion-icon hidden name="close"></ion-icon></span></p>
|
||||
|
||||
+87
-18
@@ -16,6 +16,7 @@ import { AttachmentList } from 'src/app/models/Excludetask';
|
||||
import { CreateProcessPage } from 'src/app/modals/create-process/create-process.page';
|
||||
import { DiscartExpedientModalPage } from '../../discart-expedient-modal/discart-expedient-modal.page';
|
||||
import { TaskService } from 'src/app/services/task.service'
|
||||
import { TinyMCEPage } from 'src/app/tiny-mce/tiny-mce.page';
|
||||
|
||||
@Component({
|
||||
selector: 'app-diploma-assinar',
|
||||
@@ -35,6 +36,7 @@ export class DiplomaAssinarPage implements OnInit {
|
||||
attachments:any;
|
||||
customDate: any;
|
||||
caller:string;
|
||||
mergedArray: any = [];
|
||||
|
||||
constructor(
|
||||
private processes: ProcessesService,
|
||||
@@ -110,6 +112,15 @@ export class DiplomaAssinarPage implements OnInit {
|
||||
}
|
||||
|
||||
this.fulltask = res;
|
||||
let stringDraft = res.workflowInstanceDataFields.DraftIds;
|
||||
let split_stringDraft = stringDraft?.split(",");
|
||||
|
||||
try {
|
||||
this.getDraft(split_stringDraft);
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
this.getDocumentPdf(this.fulltask.Documents)
|
||||
|
||||
let thedate = new Date(this.task.CreateDate);
|
||||
this.customDate = this.days[thedate.getDay()]+ ", " + thedate.getDate() +" de " + ( this.months[thedate.getMonth()]);
|
||||
@@ -139,26 +150,40 @@ export class DiplomaAssinarPage implements OnInit {
|
||||
|
||||
}
|
||||
|
||||
async viewDocument(DocId:string, Document) {
|
||||
async viewDocument(docId: string, Document, content) {
|
||||
|
||||
const modal = await this.modalController.create({
|
||||
component: ViewDocumentPage,
|
||||
componentProps: {
|
||||
trustedUrl: '',
|
||||
file: {
|
||||
title: Document.Assunto,
|
||||
url: '',
|
||||
title_link: '',
|
||||
if (Document.content == "") {
|
||||
const modal = await this.modalController.create({
|
||||
component: ViewDocumentPage,
|
||||
componentProps: {
|
||||
trustedUrl: '',
|
||||
file: {
|
||||
title: Document.Assunto,
|
||||
url: '',
|
||||
title_link: '',
|
||||
},
|
||||
Document,
|
||||
applicationId: Document.ApplicationId,
|
||||
docId: Document.DocId || Document.SourceId,
|
||||
folderId: this.task.FolderId,
|
||||
task: this.fulltask
|
||||
},
|
||||
Document,
|
||||
applicationId: Document.ApplicationId,
|
||||
docId: Document.DocId || Document.SourceId,
|
||||
folderId: this.task.FolderId,
|
||||
task: this.fulltask
|
||||
},
|
||||
cssClass: 'modal modal-desktop'
|
||||
});
|
||||
await modal.present();
|
||||
cssClass: 'modal modal-desktop'
|
||||
});
|
||||
await modal.present();
|
||||
} else {
|
||||
const modal = await this.modalController.create({
|
||||
component: TinyMCEPage,
|
||||
componentProps: {
|
||||
Document,
|
||||
content
|
||||
},
|
||||
cssClass: 'modal modal-desktop'
|
||||
});
|
||||
await modal.present();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -334,4 +359,48 @@ export class DiplomaAssinarPage implements OnInit {
|
||||
this.modalController.dismiss();
|
||||
}
|
||||
|
||||
getDocumentPdf(Documents: any) {
|
||||
Documents.forEach(element => {
|
||||
let docObject = {
|
||||
"ApplicationId": element.ApplicationId,
|
||||
"Assunto": element.Assunto,
|
||||
"DocDate": element.DocDate,
|
||||
"DocId": element.DocId,
|
||||
"DocNumber": element.DocNumber,
|
||||
"FolderId": element.FolderId,
|
||||
"Sender": element.Sender,
|
||||
"SourceDocId": element.SourceDocId,
|
||||
"content": "",
|
||||
"path": "",
|
||||
"ownerId": "",
|
||||
"status": "",
|
||||
}
|
||||
this.mergedArray.push(docObject);
|
||||
});
|
||||
}
|
||||
getDraft(split_stringDraft: string[]) {
|
||||
split_stringDraft.forEach(element => {
|
||||
console.log('List of ids', element)
|
||||
this.processes.GetDraftByID(element).subscribe((resd) => {
|
||||
let object = {
|
||||
"ApplicationId": "",
|
||||
"Assunto": resd.data.description,
|
||||
"DocDate": "",
|
||||
"DocId": resd.data.id,
|
||||
"DocNumber": "",
|
||||
"FolderId": "",
|
||||
"Sender": "",
|
||||
"SourceDocId": "",
|
||||
"content": resd.data.content,
|
||||
"path": resd.data.path,
|
||||
"ownerId": resd.data.ownerId,
|
||||
"status": resd.data.status,
|
||||
}
|
||||
this.mergedArray.push(object)
|
||||
console.log('List of draff', resd)
|
||||
})
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'doneIt' " src="assets/images/theme/doneIt/icons-calendar-arrow-left.svg"></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " slot="end" src='assets/images/theme/gov/icons-calendar-arrow-left.svg'></ion-icon>
|
||||
</div>
|
||||
<div class="middle d-flex align-center flex-grow-1 ">
|
||||
<div class=" d-flex align-center flex-grow-1 ">
|
||||
<ion-label class="title">{{ task.Folio}}</ion-label>
|
||||
</div>
|
||||
<div class="div-icon" (click)="openOptions()">
|
||||
@@ -64,11 +64,11 @@
|
||||
<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 mergedArray"
|
||||
class="ion-no-margin ion-no-padding cursor-pointer"
|
||||
>
|
||||
<ion-label
|
||||
(click)="viewDocument(attachment.DocId, attachment)">
|
||||
(click)="viewDocument(attachment.DocId, attachment, attachment.content)">
|
||||
<p *ngIf="attachment.Assunto" class="attach-title-item">{{ attachment.Assunto }}<span class="span-right color-red btn-size"><ion-icon hidden name="close"></ion-icon></span></p>
|
||||
<p *ngIf="!attachment.Assunto" class="attach-title-item">{{ attachment.DocNumber }}<span class="span-right color-red btn-size"><ion-icon hidden name="close"></ion-icon></span></p>
|
||||
<p><span class="span-left">{{attachment.Sender}}</span><span class="span-right">{{ attachment.DocDate | date: 'dd/MM/yy' }}</span></p>
|
||||
|
||||
@@ -20,6 +20,7 @@ import { DespachoService } from 'src/app/Rules/despacho.service'
|
||||
import { CreateProcessPage } from 'src/app/modals/create-process/create-process.page';
|
||||
import { DiscartExpedientModalPage } from '../../discart-expedient-modal/discart-expedient-modal.page';
|
||||
import { TaskService } from 'src/app/services/task.service'
|
||||
import { TinyMCEPage } from 'src/app/tiny-mce/tiny-mce.page';
|
||||
|
||||
|
||||
@Component({
|
||||
@@ -40,7 +41,8 @@ export class DiplomaPage implements OnInit {
|
||||
intervenientes: any = []
|
||||
cc: any = [];
|
||||
attachments: any;
|
||||
customDate: any
|
||||
customDate: any;
|
||||
mergedArray: any = [];
|
||||
|
||||
constructor(
|
||||
private processes: ProcessesService,
|
||||
@@ -120,7 +122,17 @@ export class DiplomaPage implements OnInit {
|
||||
"activityInstanceName": res.activityInstanceName,
|
||||
}
|
||||
this.fulltask = res;
|
||||
console.log('Diploma anexo',this.fulltask.Documents )
|
||||
// this.updateProcessOnDB(res)
|
||||
let stringDraft = res.workflowInstanceDataFields.DraftIds;
|
||||
let split_stringDraft = stringDraft?.split(",");
|
||||
|
||||
try {
|
||||
this.getDraft(split_stringDraft);
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
this.getDocumentPdf(this.fulltask.Documents)
|
||||
|
||||
let thedate = new Date(this.task.CreateDate);
|
||||
this.customDate = this.days[thedate.getDay()] + ", " + thedate.getDate() + " de " + (this.months[thedate.getMonth()]);
|
||||
@@ -170,8 +182,9 @@ export class DiplomaPage implements OnInit {
|
||||
|
||||
}
|
||||
|
||||
async viewDocument(DocId: string, Document) {
|
||||
async viewDocument(DocId: string, Document, content) {
|
||||
|
||||
if (Document.content == "") {
|
||||
const modal = await this.modalController.create({
|
||||
component: ViewDocumentPage,
|
||||
componentProps: {
|
||||
@@ -190,6 +203,17 @@ export class DiplomaPage implements OnInit {
|
||||
cssClass: 'modal modal-desktop'
|
||||
});
|
||||
await modal.present();
|
||||
} else {
|
||||
const modal = await this.modalController.create({
|
||||
component: TinyMCEPage,
|
||||
componentProps: {
|
||||
Document,
|
||||
content
|
||||
},
|
||||
cssClass: 'modal modal-desktop'
|
||||
});
|
||||
await modal.present();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -446,5 +470,49 @@ export class DiplomaPage implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
getDocumentPdf(Documents: any) {
|
||||
Documents.forEach(element => {
|
||||
let docObject = {
|
||||
"ApplicationId": element.ApplicationId,
|
||||
"Assunto": element.Assunto,
|
||||
"DocDate": element.DocDate,
|
||||
"DocId": element.DocId,
|
||||
"DocNumber": element.DocNumber,
|
||||
"FolderId": element.FolderId,
|
||||
"Sender": element.Sender,
|
||||
"SourceDocId": element.SourceDocId,
|
||||
"content": "",
|
||||
"path": "",
|
||||
"ownerId": "",
|
||||
"status": "",
|
||||
}
|
||||
this.mergedArray.push(docObject);
|
||||
});
|
||||
}
|
||||
getDraft(split_stringDraft: string[]) {
|
||||
split_stringDraft.forEach(element => {
|
||||
console.log('List of ids', element)
|
||||
this.processes.GetDraftByID(element).subscribe((resd) => {
|
||||
let object = {
|
||||
"ApplicationId": "",
|
||||
"Assunto": resd.data.description,
|
||||
"DocDate": "",
|
||||
"DocId": resd.data.id,
|
||||
"DocNumber": "",
|
||||
"FolderId": "",
|
||||
"Sender": "",
|
||||
"SourceDocId": "",
|
||||
"content": resd.data.content,
|
||||
"path": resd.data.path,
|
||||
"ownerId": resd.data.ownerId,
|
||||
"status": resd.data.status,
|
||||
}
|
||||
this.mergedArray.push(object)
|
||||
console.log('List of draff', resd)
|
||||
})
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ProcessesService } from 'src/app/services/processes.service';
|
||||
import { AttachmentsService } from 'src/app/services/attachments.service';
|
||||
import { EventsService } from 'src/app/services/events.service';
|
||||
import { InAppBrowser } from '@ionic-native/in-app-browser/ngx';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { Event } from '../../../../models/event.model';
|
||||
import { ModalController, PopoverController } from '@ionic/angular';
|
||||
@@ -23,9 +21,6 @@ import { PermissionService } from 'src/app/services/permission.service';
|
||||
import { ViewDocumentPage } from 'src/app/modals/view-document/view-document.page';
|
||||
import { ThemeService } from 'src/app/services/theme.service'
|
||||
import { EventTrigger } from 'src/app/services/eventTrigger.service';
|
||||
|
||||
|
||||
import { SqliteService } from 'src/app/services/sqlite.service';
|
||||
import { Platform } from '@ionic/angular';
|
||||
import { BackgroundService } from 'src/app/services/background.service';
|
||||
import { NewGroupPage } from 'src/app/pages/chat/new-group/new-group.page';
|
||||
|
||||
@@ -19,6 +19,7 @@ import { Platform } from '@ionic/angular';
|
||||
import { FirstEnterService } from '../../services/first-enter.service';
|
||||
import { Storage } from '@ionic/storage';
|
||||
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
|
||||
import { CPSession } from 'src/app/store/documentManagement';
|
||||
@Component({
|
||||
selector: 'app-login',
|
||||
templateUrl: './login.page.html',
|
||||
@@ -117,6 +118,8 @@ export class LoginPage implements OnInit {
|
||||
const loader = this.toastService.loading()
|
||||
|
||||
let attempt = await this.authService.login(this.userattempt, {saveSession: false})
|
||||
await this.authService.loginContenteProduction(this.userattempt, {saveSession: true})
|
||||
|
||||
|
||||
loader.remove()
|
||||
|
||||
@@ -150,6 +153,7 @@ export class LoginPage implements OnInit {
|
||||
window.localStorage.clear();
|
||||
await MessageModel.deleteAll();
|
||||
await DeleteMessageModel.deleteAll();
|
||||
CPSession.clear();
|
||||
this.storage.clear();
|
||||
|
||||
await this.authService.SetSession(attempt, this.userattempt);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { Router, NavigationEnd } from '@angular/router';
|
||||
import { ModalController, Platform } from '@ionic/angular';
|
||||
import { ModalController } from '@ionic/angular';
|
||||
import { PublicationFolder } from 'src/app/models/publicationfolder';
|
||||
import { PublicationsService } from 'src/app/services/publications.service';
|
||||
import { NewActionPage } from './new-action/new-action.page';
|
||||
@@ -11,12 +11,9 @@ import { Publication } from 'src/app/models/publication';
|
||||
import { ActionsOptionsPage } from 'src/app/shared/popover/actions-options/actions-options.page';
|
||||
import { EditActionPage } from './edit-action/edit-action.page';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
import { SqliteService } from 'src/app/services/sqlite.service';
|
||||
import { BackgroundService } from 'src/app/services/background.service';
|
||||
import { ThemeService } from 'src/app/services/theme.service'
|
||||
import { Storage } from '@ionic/storage';
|
||||
import { PermissionService } from 'src/app/services/permission.service';
|
||||
import { ActionModel, PublicationModel } from 'src/app/models/beast-orm';
|
||||
import { ActionModel } from 'src/app/models/beast-orm';
|
||||
|
||||
|
||||
@Component({
|
||||
@@ -65,11 +62,7 @@ export class PublicationsPage implements OnInit {
|
||||
private animationController: AnimationController,
|
||||
private publications: PublicationsService,
|
||||
private toastService: ToastService,
|
||||
private sqliteservice: SqliteService,
|
||||
private backgroundservice: BackgroundService,
|
||||
private platform: Platform,
|
||||
public ThemeService: ThemeService,
|
||||
private storage: Storage,
|
||||
public p: PermissionService,
|
||||
|
||||
) {
|
||||
@@ -146,18 +139,29 @@ export class PublicationsPage implements OnInit {
|
||||
this.publications.GetPublicationFolderList().subscribe(async res => {
|
||||
this.showLoader = false;
|
||||
const folders: PublicationFolder[] = this.getPublicationFolderMap(res)
|
||||
|
||||
|
||||
|
||||
this.publicationsEventFolderList = folders.filter((e)=>e.ActionType == 'Evento')
|
||||
this.publicationsTravelFolderList = folders.filter((e)=>e.ActionType != 'Evento')
|
||||
|
||||
ActionModel.create(folders)
|
||||
|
||||
await this.storage.set('actionsEvents', this.publicationsEventFolderList);
|
||||
await this.storage.set('actionsViagens', this.publicationsTravelFolderList);
|
||||
|
||||
|
||||
this.showLoader = false;
|
||||
|
||||
(async ()=> {
|
||||
|
||||
const created = await ActionModel.create(folders)
|
||||
const stored = await ActionModel.all()
|
||||
|
||||
const notPresentOnTheRequest: ActionModel[] = stored.filter(e => {
|
||||
return !folders.find(b => e.ProcessId == b.ProcessId)
|
||||
})
|
||||
|
||||
for (let ActionModelToDelete of notPresentOnTheRequest) {
|
||||
ActionModelToDelete.delete()
|
||||
}
|
||||
|
||||
// console.log({created, stored, folders, toDeletes})
|
||||
|
||||
})()
|
||||
|
||||
|
||||
}, (error) => {
|
||||
this.showLoader = false;
|
||||
this.getFromDB()
|
||||
@@ -165,14 +169,6 @@ export class PublicationsPage implements OnInit {
|
||||
|
||||
}
|
||||
|
||||
// addActionToDB(folder) {
|
||||
// if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||
// } else {
|
||||
// this.sqliteservice.addactions(folder);
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
getPublicationFolderMap(events: any):PublicationFolder[] {
|
||||
return events.map((data) : PublicationFolder => {
|
||||
return {
|
||||
@@ -186,27 +182,12 @@ export class PublicationsPage implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
getFromDB() {
|
||||
this.storage.get('actionsEvents').then((events = []) => {
|
||||
|
||||
if(Array.isArray(events)) {
|
||||
const folders: PublicationFolder[] = this.getPublicationFolderMap(events)
|
||||
async getFromDB() {
|
||||
|
||||
const folders: PublicationFolder[] = await ActionModel.all()
|
||||
this.showLoader = false;
|
||||
this.publicationsEventFolderList = folders
|
||||
|
||||
this.showLoader = false;
|
||||
this.publicationsEventFolderList = folders
|
||||
}
|
||||
|
||||
});
|
||||
this.storage.get('actionsViagens').then((viagens = []) => {
|
||||
|
||||
if(Array.isArray(viagens)) {
|
||||
const folders: PublicationFolder[] = this.getPublicationFolderMap(viagens)
|
||||
|
||||
this.publicationsTravelFolderList = folders
|
||||
this.showLoader = false;
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
async editAction(folderId?: string) {
|
||||
|
||||
@@ -15,8 +15,6 @@ import { ToastService } from 'src/app/services/toast.service';
|
||||
import { PermissionService } from 'src/app/services/permission.service';
|
||||
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
|
||||
import { Storage } from '@ionic/storage';
|
||||
import { PublicationModel } from 'src/app/models/beast-orm';
|
||||
|
||||
@Component({
|
||||
selector: 'app-view-publications',
|
||||
templateUrl: './view-publications.page.html',
|
||||
@@ -44,7 +42,6 @@ export class ViewPublicationsPage implements OnInit {
|
||||
private publications: PublicationsService,
|
||||
private activatedRoute: ActivatedRoute,
|
||||
private router: Router,
|
||||
private sqliteservice: SqliteService,
|
||||
private backgroundservice: BackgroundService,
|
||||
public ThemeService: ThemeService,
|
||||
private toastService: ToastService,
|
||||
|
||||
@@ -10,7 +10,7 @@ export class CustomTaskPipe implements PipeTransform {
|
||||
|
||||
let date = new Date(fullTask.taskStartDate);
|
||||
let month = date.getMonth() + 1;
|
||||
let taskDate = date.getFullYear() + "-" + month +"-"+date.getDate()+" "+date.getHours()+":"+date.getMinutes()+ ":"+date.getSeconds();
|
||||
let taskDate = date.getFullYear() + "-" + month +"-"+date.getDate()+" "+date.getHours()+":"+date.getMinutes()+ ":"+date.getSeconds();
|
||||
|
||||
return {
|
||||
"SerialNumber": fullTask.serialNumber,
|
||||
|
||||
@@ -20,6 +20,7 @@ import { PermissionService } from './permission.service';
|
||||
import { ChatSystemService } from 'src/app/services/chat/chat-system.service';
|
||||
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
|
||||
import { captureException } from '@sentry/angular';
|
||||
import { CPSession } from '../store/documentManagement';
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
@@ -32,7 +33,7 @@ export class AuthService {
|
||||
opts:any;
|
||||
|
||||
tabIsActive = true
|
||||
|
||||
|
||||
constructor(
|
||||
private http: HttpClient,
|
||||
private storageService:StorageService,
|
||||
@@ -77,9 +78,6 @@ export class AuthService {
|
||||
async login(user: UserForm, {saveSession = true}): Promise<LoginUserRespose> {
|
||||
user.BasicAuthKey = 'Basic ' + btoa(user.username + ':' + this.aesencrypt.encrypt(user.password,user.username ));
|
||||
|
||||
// Basic peter.maquiran@equilibrium.co.ao:senha123456
|
||||
// console.log(user.BasicAuthKey)
|
||||
|
||||
this.headers = this.headers.set('Authorization', user.BasicAuthKey);
|
||||
this.opts = {
|
||||
headers: this.headers,
|
||||
@@ -104,6 +102,34 @@ export class AuthService {
|
||||
|
||||
}
|
||||
|
||||
async loginContenteProduction(user: UserForm, {saveSession = true}): Promise<LoginUserRespose> {
|
||||
user.BasicAuthKey = 'Basic ' + btoa(user.username + ':' + this.aesencrypt.encrypt(user.password,user.username ));
|
||||
|
||||
this.headers = this.headers.set('Authorization', user.BasicAuthKey);
|
||||
this.opts = {
|
||||
headers: this.headers,
|
||||
}
|
||||
|
||||
let response: any;
|
||||
|
||||
try {
|
||||
response = await this.http.post<LoginUserRespose>(environment.apiURL + "UserAuthentication/LoginJwt", '', this.opts).toPromise();
|
||||
console.log('JWT',response)
|
||||
|
||||
if(saveSession) {
|
||||
/* this.SetSession(response, user) */
|
||||
console.log('teste', response);
|
||||
CPSession.save(response)
|
||||
|
||||
}
|
||||
} catch (error) {
|
||||
this.httpErroHandle.httpStatusHandle(error)
|
||||
} finally {
|
||||
return response
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// async UpdateLogin() {}
|
||||
|
||||
SetSession(response: LoginUserRespose, user:UserForm) {
|
||||
|
||||
@@ -882,13 +882,13 @@ export class RoomService {
|
||||
|
||||
private async findMessageInDBByData({localReference, _id}) {
|
||||
|
||||
const a = await MessageModel.filter({localReference: localReference})
|
||||
const a = await MessageModel.filter({localReference: localReference}).execute()
|
||||
if(a.length >= 1) {
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
const c = await MessageModel.filter({_id: _id})
|
||||
const c = await MessageModel.filter({_id: _id}).execute()
|
||||
if(c.length >= 1) {
|
||||
|
||||
return true
|
||||
|
||||
@@ -146,6 +146,12 @@ export class HttpErrorHandle {
|
||||
case 'Aprovar exp':
|
||||
this.toastService._successMessage('Expediente enviado!');
|
||||
break;
|
||||
case 'Draft Save':
|
||||
this.toastService._successMessage('Rascunho salvo!');
|
||||
break;
|
||||
case 'Draft Concluído':
|
||||
this.toastService._successMessage('Documento Concluído!');
|
||||
break;
|
||||
|
||||
default:
|
||||
this.toastService._successMessage('Processo efetuado!')
|
||||
|
||||
@@ -10,6 +10,7 @@ import { GetTasksListType } from '../models/GetTasksListType';
|
||||
import { fullTaskList } from '../models/dailyworktask.model';
|
||||
import { ChangeProfileService } from './change-profile.service';
|
||||
import { SessionStore } from '../store/session.service';
|
||||
import { CPSession } from '../store/documentManagement';
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
@@ -18,6 +19,9 @@ export class ProcessesService {
|
||||
authheader = {};
|
||||
loggeduser: LoginUserRespose;
|
||||
headers: HttpHeaders;
|
||||
headers2: HttpHeaders;
|
||||
|
||||
|
||||
|
||||
constructor(
|
||||
private http: HttpClient,
|
||||
@@ -32,13 +36,22 @@ export class ProcessesService {
|
||||
this.setHeader()
|
||||
})
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
setHeader() {
|
||||
|
||||
|
||||
this.headers = new HttpHeaders();
|
||||
|
||||
this.headers = this.headers.set('Authorization', this.loggeduser.BasicAuthKey);
|
||||
|
||||
this.headers2 = new HttpHeaders();
|
||||
|
||||
this.headers2 = this.headers2.set('Authorization',"Bearer "+ CPSession.AuthorizationJwt);
|
||||
|
||||
}
|
||||
|
||||
uploadFile(formData:any){
|
||||
@@ -107,6 +120,7 @@ export class ProcessesService {
|
||||
}
|
||||
|
||||
GetTask(serialnumber:string): Observable<any> {
|
||||
|
||||
const geturl = environment.apiURL + 'Tasks/FindTask';
|
||||
let params = new HttpParams();
|
||||
|
||||
@@ -119,6 +133,32 @@ export class ProcessesService {
|
||||
return this.http.get<any>(`${geturl}`, options);
|
||||
}
|
||||
|
||||
GetDraftByID(id:string): Observable<any> {
|
||||
|
||||
const geturl = environment.apiPCURL + `Documents/${id}`;
|
||||
let params = new HttpParams();
|
||||
|
||||
/* params = params.set("serialNumber", serialnumber); */
|
||||
|
||||
let options = {
|
||||
headers: this.headers2,
|
||||
/* params: params */
|
||||
};
|
||||
return this.http.get<any>(`${geturl}`, options);
|
||||
}
|
||||
|
||||
SaveDraftByID(id:string, object): Observable<any> {
|
||||
const geturl = environment.apiPCURL + `Documents/${id}`;
|
||||
let params = new HttpParams();
|
||||
|
||||
/* params = params.set("serialNumber", serialnumber); */
|
||||
|
||||
let options = {
|
||||
headers: this.headers2,
|
||||
/* params: params */
|
||||
};
|
||||
return this.http.put<any>(`${geturl}`, object, options);
|
||||
}
|
||||
|
||||
SetTaskToPending(serialNumber:string): Observable<any>{
|
||||
const geturl = environment.apiURL + 'Tasks/SetTaskPending';
|
||||
|
||||
+6
-1
@@ -1,5 +1,5 @@
|
||||
<ion-content class="container width-100 ">
|
||||
<div class="buttons">
|
||||
<div *ngIf="content == ''" class="buttons">
|
||||
<button (click)="openExpedientActionsModal('0')" class="btn-cancel" shape="round" >Efetuar Despacho</button>
|
||||
<div class="solid"></div>
|
||||
<button (click)="openExpedientActionsModal('1')" class="btn-cancel" shape="round" >Solicitar Parecer</button>
|
||||
@@ -7,4 +7,9 @@
|
||||
<button (click)="openBookMeetingModal()" class="btn-cancel" shape="round" >Marcar Reunião</button>
|
||||
<button class="btn-cancel" shape="round" (click)="close()">Cancelar</button>
|
||||
</div>
|
||||
<div *ngIf="content != ''" class="buttons">
|
||||
<button (click)="save(Document, content)" class="btn-cancel" shape="round" >Salvar</button>
|
||||
<button (click)="saveDraft(Document, content)" class="btn-cancel" shape="round" >Salvar Rascunho</button>
|
||||
<button class="btn-cancel" shape="round" (click)="close()">Cancelar</button>
|
||||
</div>
|
||||
</ion-content>
|
||||
|
||||
+59
-7
@@ -1,6 +1,9 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ModalController } from '@ionic/angular';
|
||||
import { ModalController, NavParams } from '@ionic/angular';
|
||||
import { error } from 'console';
|
||||
import { PermissionService } from 'src/app/services/permission.service';
|
||||
import { ProcessesService} from 'src/app/services/processes.service';
|
||||
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-event-details-documents-options',
|
||||
@@ -9,12 +12,23 @@ import { PermissionService } from 'src/app/services/permission.service';
|
||||
})
|
||||
export class EventDetailsDocumentsOptionsPage implements OnInit {
|
||||
|
||||
Document: any
|
||||
content: any = "";
|
||||
|
||||
constructor(
|
||||
public p: PermissionService,
|
||||
private modalController: ModalController,
|
||||
) {}
|
||||
private navParams: NavParams,
|
||||
private processService: ProcessesService,
|
||||
private erroHandler: HttpErrorHandle
|
||||
) {
|
||||
this.Document = this.navParams.get('Document')
|
||||
this.content = this.navParams.get('content')
|
||||
}
|
||||
|
||||
ngOnInit() {}
|
||||
ngOnInit() {
|
||||
console.log(this.content)
|
||||
}
|
||||
|
||||
close() {
|
||||
this.modalController.dismiss();
|
||||
@@ -25,13 +39,51 @@ export class EventDetailsDocumentsOptionsPage implements OnInit {
|
||||
}
|
||||
|
||||
async openBookMeetingModal() {
|
||||
this.modalController.dismiss({component:'openBookMeetingModal', taskAction: ''});
|
||||
this.modalController.dismiss({ component: 'openBookMeetingModal', taskAction: '' });
|
||||
}
|
||||
|
||||
async openExpedientActionsModal( taskAction: any) {
|
||||
this.modalController.dismiss({component:'openExpedientActionsModal', taskAction});
|
||||
async openExpedientActionsModal(taskAction: any) {
|
||||
this.modalController.dismiss({ component: 'openExpedientActionsModal', taskAction });
|
||||
}
|
||||
|
||||
async distartExpedientModal(body:any) {}
|
||||
async distartExpedientModal(body: any) { }
|
||||
|
||||
save(document,content) {
|
||||
console.log(document)
|
||||
let objectDraft = {
|
||||
"status": true,
|
||||
"description": document.Assunto,
|
||||
"content": content,
|
||||
"path": document.path,
|
||||
"ownerId": document.ownerId
|
||||
}
|
||||
this.processService.SaveDraftByID(document.DocId, objectDraft).subscribe((res) => [
|
||||
this.erroHandler.httpsSucessMessagge('Draft Save'),
|
||||
this.modalController.dismiss()
|
||||
],(error) => {
|
||||
this.erroHandler.httpStatusHandle(error)
|
||||
})
|
||||
|
||||
this.modalController.dismiss();
|
||||
|
||||
}
|
||||
|
||||
saveDraft(document, content) {
|
||||
console.log(document)
|
||||
let objectDraft = {
|
||||
"status": false,
|
||||
"description": document.Assunto,
|
||||
"content": content,
|
||||
"path": document.path,
|
||||
"ownerId": document.ownerId
|
||||
}
|
||||
this.processService.SaveDraftByID(document.DocId, objectDraft).subscribe((res) => [
|
||||
this.erroHandler.httpsSucessMessagge('Draft Save'),
|
||||
this.modalController.dismiss()
|
||||
],(error) => {
|
||||
this.erroHandler.httpStatusHandle(error)
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ import { EditActionPage } from 'src/app/pages/publications/edit-action/edit-acti
|
||||
import { Storage } from '@ionic/storage';
|
||||
import { PermissionService } from 'src/app/services/permission.service';
|
||||
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
|
||||
import { PublicationModel } from 'src/app/models/beast-orm';
|
||||
import { PublicationDetailsModel } from 'src/app/models/beast-orm';
|
||||
|
||||
@Component({
|
||||
selector: 'app-view-publications',
|
||||
@@ -107,6 +107,8 @@ export class ViewPublicationsPage implements OnInit {
|
||||
getPublicationDetail() {
|
||||
const folderId = this.folderId
|
||||
this.publications.GetPresidentialAction(folderId).subscribe(res=>{
|
||||
|
||||
// PublicationDetailsModel.create(res)
|
||||
this.publicationItem[folderId] = res
|
||||
this.storage.set(folderId+"name", res)
|
||||
}, (error) => {
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
import { models } from 'src/plugin/src';
|
||||
import { DELETE, GET, SAVE } from '../models/beast-orm-function';
|
||||
const { rewriteSave, rewriteGet, rewriteDelete } = models.core.localStorage.rewrite;
|
||||
|
||||
export class CPSession extends models.LocalStorage {
|
||||
static UserId: number = models.preset()
|
||||
static Email: string = models.preset()
|
||||
static UserName: string = models.preset()
|
||||
static FullName: string = models.preset()
|
||||
static RoleID: number = models.preset()
|
||||
static RoleDescription: string = models.preset()
|
||||
static OrganicEntityID: number = models.preset()
|
||||
static OrganicEntityName: string = models.preset()
|
||||
static Status: string = models.preset()
|
||||
static Authorization: string = models.preset()
|
||||
static AuthorizationJwt: string = models.preset()
|
||||
}
|
||||
|
||||
// content production
|
||||
models.migrate({
|
||||
databaseName:'content-production',
|
||||
type: 'localStorage',
|
||||
version: 1,
|
||||
models: [CPSession],
|
||||
})
|
||||
// rewrite
|
||||
rewriteGet.connect(GET, [CPSession])
|
||||
rewriteSave.connect(SAVE, [CPSession])
|
||||
rewriteDelete.connect(DELETE, [CPSession])
|
||||
// get function
|
||||
CPSession.get()
|
||||
@@ -0,0 +1,17 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { Routes, RouterModule } from '@angular/router';
|
||||
|
||||
import { TinyMCEPage } from './tiny-mce.page';
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
component: TinyMCEPage
|
||||
}
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [RouterModule.forChild(routes)],
|
||||
exports: [RouterModule],
|
||||
})
|
||||
export class TinyMCEPageRoutingModule {}
|
||||
@@ -0,0 +1,25 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
|
||||
import { IonicModule } from '@ionic/angular';
|
||||
|
||||
import { TinyMCEPageRoutingModule } from './tiny-mce-routing.module';
|
||||
|
||||
import { TinyMCEPage } from './tiny-mce.page';
|
||||
import {Editor} from 'tinymce';
|
||||
import { EditorModule } from '@tinymce/tinymce-angular';
|
||||
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
FormsModule,
|
||||
IonicModule,
|
||||
TinyMCEPageRoutingModule,
|
||||
EditorModule,
|
||||
FontAwesomeModule
|
||||
],
|
||||
declarations: [TinyMCEPage]
|
||||
})
|
||||
export class TinyMCEPageModule {}
|
||||
@@ -0,0 +1,38 @@
|
||||
<div >
|
||||
<ion-toolbar class="d-flex">
|
||||
<div class="d-flex align-items-center px-20 pt-20 font-25">
|
||||
<div class="left cursor-pointer" (click)="close()">
|
||||
<fa-icon icon="chevron-left" class="menu-icon font-awesome-1"></fa-icon>
|
||||
</div>
|
||||
|
||||
<div class="middle add-ellipsis">
|
||||
{{Document.Assunto}}
|
||||
</div>
|
||||
|
||||
<div class="right cursor-pointer" (click)="openOptions()">
|
||||
<fa-icon icon="ellipsis-v" class="menu-icon font-awesome-1"></fa-icon>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</ion-toolbar>
|
||||
</div>
|
||||
|
||||
<editor
|
||||
apiKey="wr5dk69kive0qr9ig6y5spqvlj3a0tsiwnzdsexnz241k69p"
|
||||
[(ngModel)]="editorContent"
|
||||
[init]="{
|
||||
height: 500,
|
||||
menubar: false,
|
||||
plugins: [
|
||||
'advlist autolink lists link image charmap print preview anchor',
|
||||
'searchreplace visualblocks code fullscreen',
|
||||
'insertdatetime media table paste code help wordcount print'
|
||||
],
|
||||
toolbar:
|
||||
'undo redo | formatselect | bold italic backcolor | \
|
||||
alignleft aligncenter alignright alignjustify | \
|
||||
bullist numlist outdent indent | removeformat | print | help' }"
|
||||
initialValue='{{content}}'
|
||||
[(ngModel)]="content"
|
||||
(onSaveContent)="somefunction()"
|
||||
></editor>
|
||||
@@ -0,0 +1,27 @@
|
||||
.left{
|
||||
float: left;
|
||||
}
|
||||
.middle{
|
||||
float: left;
|
||||
padding-left: 5px !important;
|
||||
}
|
||||
.right{
|
||||
float: right;
|
||||
margin-left: auto;
|
||||
}
|
||||
|
||||
|
||||
.container-img {
|
||||
background-image: url(/assets/gif/theme/gov/Blocks-loader.svg);
|
||||
background-repeat: no-repeat;
|
||||
background-position-x: center;
|
||||
background-position-y: center;
|
||||
}
|
||||
|
||||
|
||||
@media only screen and (max-width: 650px) {
|
||||
|
||||
.container-img {
|
||||
background-size: 25%;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
||||
import { IonicModule } from '@ionic/angular';
|
||||
|
||||
import { TinyMCEPage } from './tiny-mce.page';
|
||||
|
||||
describe('TinyMCEPage', () => {
|
||||
let component: TinyMCEPage;
|
||||
let fixture: ComponentFixture<TinyMCEPage>;
|
||||
|
||||
beforeEach(waitForAsync(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ TinyMCEPage ],
|
||||
imports: [IonicModule.forRoot()]
|
||||
}).compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(TinyMCEPage);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
}));
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,61 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { NavParams } from '@ionic/angular';
|
||||
import { EventDetailsDocumentsOptionsPage } from '../shared/popover/event-details-documents-options/event-details-documents-options.page';
|
||||
import { AlertController, ModalController } from '@ionic/angular';
|
||||
@Component({
|
||||
selector: 'app-tiny-mce',
|
||||
templateUrl: './tiny-mce.page.html',
|
||||
styleUrls: ['./tiny-mce.page.scss'],
|
||||
})
|
||||
export class TinyMCEPage implements OnInit {
|
||||
|
||||
|
||||
|
||||
title = '<p><img style="display: block; margin-left: auto; margin-right: auto;" src="assets/TempImgs/TCROUND.png" alt="" width="102" height="104" />Just Testing with an image yoOH.</p>';
|
||||
Document: any
|
||||
content: string
|
||||
editorContent: string;
|
||||
value: string;
|
||||
|
||||
|
||||
|
||||
constructor(
|
||||
private navParams: NavParams,
|
||||
private modalController: ModalController,
|
||||
|
||||
) {
|
||||
this.Document = this.navParams.get('Document')
|
||||
this.content = this.navParams.get('content')
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.value = ""
|
||||
}
|
||||
|
||||
close() {
|
||||
this.modalController.dismiss()
|
||||
}
|
||||
|
||||
somefunction() {
|
||||
console.log(this.content)
|
||||
}
|
||||
|
||||
async openOptions() {
|
||||
const modal = await this.modalController.create({
|
||||
component: EventDetailsDocumentsOptionsPage,
|
||||
cssClass: 'model aside-modal search-submodal',
|
||||
componentProps: {
|
||||
Document: this.Document,
|
||||
content: this.content
|
||||
}
|
||||
});
|
||||
await modal.present();
|
||||
|
||||
modal.onDidDismiss().then((res)=>{
|
||||
|
||||
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user