mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
Fix store and improve search
This commit is contained in:
@@ -51,19 +51,16 @@
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
{{ LoadedDocument | json }}
|
||||
|
||||
<div *ngIf="LoadedDocument" class="aside-right flex-column height-100">
|
||||
<div class="buttons">
|
||||
<button (click)="notImplemented()" class="btn-ok" shape="round" >Efectuar Despacho</button>
|
||||
<button (click)="notImplemented()" class="btn-cancel" shape="round" >Descartar</button>
|
||||
<button (click)="openExpedientActionsModal('0')" class="btn-ok" shape="round" >Efectuar Despacho</button>
|
||||
<div class="solid"></div>
|
||||
<button (click)="notImplemented()" class="btn-cancel" shape="round" >Solicitar Parecer</button>
|
||||
<button (click)="notImplemented()" class="btn-cancel" shape="round" >Pedido de Deferimento</button>
|
||||
<button (click)="notImplemented()" class="btn-cancel" shape="round" >Marcar Reunião</button>
|
||||
<button (click)="notImplemented()" *ngIf="LoadedDocument.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
|
||||
<div class="solid"></div>
|
||||
<button (click)="notImplemented()" class="btn-cancel" shape="round" >Executar</button>
|
||||
<button (click)="notImplemented()" class="btn-cancel" shape="round" >Delegar</button>
|
||||
<button (click)="notImplemented()" class="btn-cancel" shape="round" >Arquivar</button>
|
||||
<button (click)="openExpedientActionsModal('0')" class="btn-cancel" shape="round" >Solicitar Parecer</button>
|
||||
<button (click)="openExpedientActionsModal('2')" class="btn-cancel" shape="round" >Pedido de Deferimento</button>
|
||||
<button (click)="openBookMeetingModal()" class="btn-cancel" shape="round" >Marcar Reunião</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -3,6 +3,8 @@ import { MenuController, ModalController, NavParams } from '@ionic/angular';
|
||||
import { AlertService } from 'src/app/services/alert.service';
|
||||
import { ProcessesService } from 'src/app/services/processes.service';
|
||||
import { InAppBrowser } from '@ionic-native/in-app-browser/ngx';
|
||||
import { ExpedientTaskModalPage } from 'src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page';
|
||||
import { BookMeetingModalPage } from 'src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page';
|
||||
|
||||
@Component({
|
||||
selector: 'app-document-detail',
|
||||
@@ -63,11 +65,112 @@ export class DocumentDetailPage implements OnInit {
|
||||
this.menu.open();
|
||||
this.modalController.dismiss();
|
||||
}
|
||||
close(){
|
||||
close() {
|
||||
this.modalController.dismiss();
|
||||
}
|
||||
notImplemented(){
|
||||
notImplemented() {
|
||||
this.alertService.presentAlert('Funcionalidade em desenvolvimento');
|
||||
}
|
||||
|
||||
// efetuar despacho
|
||||
async openExpedientActionsModal( taskAction: any) {
|
||||
|
||||
let task;
|
||||
|
||||
if(this.LoadedDocument.ApplicationID == 361) {
|
||||
task = {
|
||||
serialNumber: this.LoadedDocument.DispatchNumber,
|
||||
taskStartDate: this.LoadedDocument.DateDispatch,
|
||||
isEvent: true,
|
||||
workflowInstanceDataFields: {
|
||||
FsId: this.LoadedDocument.ApplicationID,
|
||||
FolderID: null,
|
||||
DocId: this.LoadedDocument.DispatchNumber,
|
||||
Subject: this.LoadedDocument.Assunto
|
||||
},
|
||||
}
|
||||
} else if (this.LoadedDocument.ApplicationID == 8) {
|
||||
task = {
|
||||
serialNumber: this.LoadedDocument.SourceId,
|
||||
taskStartDate: this.LoadedDocument.CreateDate,
|
||||
isEvent: true,
|
||||
workflowInstanceDataFields: {
|
||||
FsId: this.LoadedDocument.ApplicationID,
|
||||
FolderID: null,
|
||||
DocId: this.LoadedDocument.SourceId,
|
||||
Subject: this.LoadedDocument.SourceName
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let classs;
|
||||
if( window.innerWidth <= 800) {
|
||||
classs = 'modal modal-desktop'
|
||||
} else {
|
||||
classs = 'modal modal-desktop showAsideOptions'
|
||||
}
|
||||
const modal = await this.modalController.create({
|
||||
component: ExpedientTaskModalPage,
|
||||
componentProps: {
|
||||
taskAction: taskAction,
|
||||
task: task,
|
||||
},
|
||||
cssClass: classs,
|
||||
});
|
||||
await modal.present();
|
||||
modal.onDidDismiss().then( async(res)=>{});
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
async openBookMeetingModal() {
|
||||
|
||||
let task;
|
||||
|
||||
if(this.LoadedDocument.ApplicationID == 361) {
|
||||
task = {
|
||||
serialNumber: this.LoadedDocument.DispatchNumber,
|
||||
taskStartDate: this.LoadedDocument.DateDispatch,
|
||||
isEvent: true,
|
||||
workflowInstanceDataFields: {
|
||||
FsId: this.LoadedDocument.ApplicationID,
|
||||
FolderID: null,
|
||||
DocId: this.LoadedDocument.DispatchNumber,
|
||||
Subject: this.LoadedDocument.Assunto
|
||||
},
|
||||
}
|
||||
} else if (this.LoadedDocument.ApplicationID == 8) {
|
||||
task = {
|
||||
serialNumber: this.LoadedDocument.SourceId,
|
||||
taskStartDate: this.LoadedDocument.CreateDate,
|
||||
isEvent: true,
|
||||
workflowInstanceDataFields: {
|
||||
FsId: this.LoadedDocument.ApplicationID,
|
||||
FolderID: null,
|
||||
DocId: this.LoadedDocument.SourceId,
|
||||
Subject: this.LoadedDocument.SourceName
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let classs;
|
||||
if( window.innerWidth <= 800) {
|
||||
classs = 'book-meeting-modal modal modal-desktop'
|
||||
} else {
|
||||
classs = 'modal modal-desktop showAsideOptions'
|
||||
}
|
||||
const modal = await this.modalController.create({
|
||||
component: BookMeetingModalPage,
|
||||
componentProps: {
|
||||
task: task,
|
||||
},
|
||||
cssClass: classs,
|
||||
backdropDismiss: false
|
||||
});
|
||||
await modal.present();
|
||||
modal.onDidDismiss();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -350,7 +350,6 @@ export class ExpedienteDetailPage implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
async openOptions(taskAction?: any) {
|
||||
const popover = await this.popoverController.create({
|
||||
component: OptsExpedientePage,
|
||||
@@ -365,6 +364,4 @@ export class ExpedienteDetailPage implements OnInit {
|
||||
return await popover.present();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -158,7 +158,7 @@
|
||||
<div class="content ion-align-items-center">
|
||||
|
||||
<div class="d-flex ion-justify-content-between ">
|
||||
<span class="result-name">{{ searchDocument.Assunto}}</span>
|
||||
<span class="result-name">{{ searchDocument.Assunto}} -- {{ searchDocument.ApplicationType}} </span>
|
||||
<span class="app-name" *ngIf="itemIcons() == 'AccoesPresidenciais & ArquivoDespachoElect' ">{{ searchDocument.appName}}</span>
|
||||
</div>
|
||||
<div class="d-flex ion-justify-content-between ">
|
||||
|
||||
@@ -11,6 +11,9 @@ import { slugify } from 'src/plugin/javascript-remove-accents.js';
|
||||
import { ViewEventPage } from 'src/app/pages/agenda/view-event/view-event.page';
|
||||
import { PublicationDetailPage } from '../publications/view-publications/publication-detail/publication-detail.page';
|
||||
import { DocumentDetailPage } from 'src/app/modals/document-detail/document-detail.page';
|
||||
import { ExpedientTaskModalPage } from '../gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page';
|
||||
import { OptsExpedientePage } from 'src/app/shared/popover/opts-expediente/opts-expediente.page';
|
||||
import { CreateProcessPage } from 'src/app/modals/create-process/create-process.page';
|
||||
|
||||
|
||||
@Component({
|
||||
@@ -561,7 +564,6 @@ export class SearchPage implements OnInit {
|
||||
|
||||
const ApplicationType = searchDocument.ApplicationType.toString()
|
||||
const Id = searchDocument.Id
|
||||
|
||||
if(this.select == false){
|
||||
if(this.type == "Agenda") {
|
||||
|
||||
@@ -580,13 +582,13 @@ export class SearchPage implements OnInit {
|
||||
this.viewPublicationDetail(Id);
|
||||
}
|
||||
else if(this.type == "AccoesPresidenciais & ArquivoDespachoElect"){
|
||||
console.log('OPEN DOC');
|
||||
|
||||
if(ApplicationType == '8' || ApplicationType == '361') {
|
||||
this.viewDocumentDetail(Id, ApplicationType);
|
||||
|
||||
// this.openExpedientActionsModal(searchDocument)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
async viewPublicationDetail(publicationId:string) {
|
||||
@@ -606,7 +608,8 @@ export class SearchPage implements OnInit {
|
||||
|
||||
async viewDocumentDetail(docId:string, applicationId:string) {
|
||||
let classs;
|
||||
if( window.innerWidth <= 800){
|
||||
|
||||
if( window.innerWidth <= 800) {
|
||||
classs = 'modal modal-desktop'
|
||||
} else {
|
||||
classs = 'modal modal-desktop showAsideOptions'
|
||||
@@ -621,8 +624,36 @@ export class SearchPage implements OnInit {
|
||||
cssClass: classs,
|
||||
});
|
||||
await modal.present();
|
||||
modal.onDidDismiss().then((res)=>{
|
||||
modal.onDidDismiss().then((res)=>{});
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
async openExpedientActionsModal(doc: any) {
|
||||
|
||||
let customTask = {
|
||||
serialNumber: doc.SourceId,
|
||||
taskStartDate: doc.CreateDate,
|
||||
isEvent: true,
|
||||
workflowInstanceDataFields: {
|
||||
FsId: doc.ApplicationId,
|
||||
FolderID: null,
|
||||
DocId: doc.SourceId,
|
||||
Subject: doc.SourceName
|
||||
},
|
||||
}
|
||||
|
||||
const popover = await this.modalController.create({
|
||||
component: OptsExpedientePage,
|
||||
cssClass: 'model aside-modal search-submodal',
|
||||
componentProps: {
|
||||
fulltask: customTask,
|
||||
task: customTask
|
||||
},
|
||||
//translucent: true
|
||||
});
|
||||
return await popover.present();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -8,9 +8,7 @@ import { Event } from 'src/app/models/event.model';
|
||||
import { InAppBrowser } from '@ionic-native/in-app-browser/ngx';
|
||||
import { ProcessesService } from 'src/app/services/processes.service';
|
||||
import { ExpedientTaskModalPage } from 'src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page';
|
||||
import { momentG } from 'src/plugin/momentG';
|
||||
import { BookMeetingModalPage } from 'src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page';
|
||||
import { ChatPopoverPage } from '../../popover/chat-popover/chat-popover.page';
|
||||
import { OptsExpedientePage } from '../../popover/opts-expediente/opts-expediente.page';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
import { EliminateEventPage } from 'src/app/modals/eliminate-event/eliminate-event.page';
|
||||
|
||||
@@ -24,9 +24,10 @@ export class EventoaprovacaoStoreService {
|
||||
setTimeout(()=>{
|
||||
let restoremd = localstoreService.get(this.keyNamemd, {})
|
||||
let restorepr = localstoreService.get(this.keyNamepr, {})
|
||||
|
||||
this._listpr = restorepr.eventsListpr || []
|
||||
this._listmd = restoremd.eventsListmd || []
|
||||
this._count = restorepr.count.length + restoremd.count.length || 0
|
||||
this._count = this._listpr.length + this._listmd.length || 0
|
||||
}, 10)
|
||||
|
||||
}
|
||||
@@ -37,10 +38,12 @@ export class EventoaprovacaoStoreService {
|
||||
|
||||
get listmd() {
|
||||
return this._listmd
|
||||
}
|
||||
}
|
||||
|
||||
get count() {
|
||||
return this._count
|
||||
}
|
||||
|
||||
set count(value: number) {
|
||||
this._count = value
|
||||
}
|
||||
@@ -57,12 +60,12 @@ export class EventoaprovacaoStoreService {
|
||||
|
||||
this.count = this._listmd.length + this.listpr.length
|
||||
this.savemd(this._listmd)
|
||||
}
|
||||
}
|
||||
|
||||
private savemd(eventsListmd: any) {
|
||||
setTimeout(()=>{
|
||||
localstoreService.set(this.keyNamemd,{
|
||||
eventsListmd,
|
||||
count: this._listmd,
|
||||
})
|
||||
}, 10)
|
||||
|
||||
@@ -72,11 +75,10 @@ export class EventoaprovacaoStoreService {
|
||||
setTimeout(()=>{
|
||||
localstoreService.set(this.keyNamepr,{
|
||||
eventsListpr,
|
||||
count: this._listpr,
|
||||
})
|
||||
}, 10)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -7,43 +7,42 @@ import { AES, enc, SHA1 } from 'crypto-js'
|
||||
})
|
||||
export class ExpedientegdStoreService {
|
||||
|
||||
// main data
|
||||
private _list: Event[]
|
||||
// local storage keyName
|
||||
private keyName: string;
|
||||
private _count = 0
|
||||
// main data
|
||||
private _list: Event[]
|
||||
// local storage keyName
|
||||
private keyName: string;
|
||||
private _count = 0
|
||||
|
||||
constructor() {
|
||||
constructor() {
|
||||
|
||||
this.keyName = (SHA1(this.constructor.name)).toString()
|
||||
|
||||
|
||||
setTimeout(()=>{
|
||||
let restore = localstoreService.get(this.keyName, {})
|
||||
this._list = restore.eventsList || []
|
||||
this._count = restore.count || 0
|
||||
}, 10)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
get list() {
|
||||
get list() {
|
||||
return this._list
|
||||
}
|
||||
get count() {
|
||||
}
|
||||
get count() {
|
||||
return this._count
|
||||
}
|
||||
set count(value: number) {
|
||||
}
|
||||
set count(value: number) {
|
||||
this._count = value
|
||||
}
|
||||
}
|
||||
|
||||
reset(eventsList: any) {
|
||||
reset(eventsList: any) {
|
||||
this._list = eventsList
|
||||
|
||||
this.count = this._list.length
|
||||
this.save(this._list)
|
||||
}
|
||||
}
|
||||
|
||||
private save(eventsList: any) {
|
||||
private save(eventsList: any) {
|
||||
setTimeout(()=>{
|
||||
localstoreService.set(this.keyName,{
|
||||
eventsList,
|
||||
@@ -51,7 +50,7 @@ private save(eventsList: any) {
|
||||
})
|
||||
}, 10)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
|
||||
export const environment = {
|
||||
production: false,
|
||||
apiURL: 'https://equilibrium.dyndns.info/GabineteDigital.Services/V4/api/',
|
||||
/* apiURL: 'http://gpr-dev-01.gabinetedigital.local/GabineteDigital.Services/V4/api/', */
|
||||
//apiURL: 'https://equilibrium.dyndns.info/GabineteDigital.Services/V4/api/',
|
||||
apiURL: 'http://gpr-dev-01.gabinetedigital.local/GabineteDigital.Services/V4/api/',
|
||||
apiChatUrl: 'https://www.tabularium.pt/api/v1/',
|
||||
/* apiChatUrl: 'http://chat.gabinetedigital.local:3000/api/v1/', */
|
||||
domain: 'gabinetedigital.local', //gabinetedigital.local
|
||||
|
||||
@@ -56,8 +56,6 @@ describe('Puppeteer tests', () => {
|
||||
// wait for component
|
||||
await page.waitForSelector('app-new-event')
|
||||
|
||||
|
||||
|
||||
// subject
|
||||
await page.type('app-new-event .ion-item-container input', faker.commerce.productDescription() )
|
||||
// Location
|
||||
|
||||
Reference in New Issue
Block a user