mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-21 13:55:51 +00:00
Improve modal search
This commit is contained in:
@@ -138,6 +138,17 @@ export class AgendaPage implements OnInit {
|
|||||||
},5000)
|
},5000)
|
||||||
|
|
||||||
// console.log(setHours(setMinutes(new Date(), 0), 12))
|
// console.log(setHours(setMinutes(new Date(), 0), 12))
|
||||||
|
|
||||||
|
function setCookie(cname, cvalue, exdays) {
|
||||||
|
var d = new Date();
|
||||||
|
d.setTime(d.getTime() + (exdays*24*60*60*1000));
|
||||||
|
var expires = "expires="+ d.toUTCString();
|
||||||
|
document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/";
|
||||||
|
}
|
||||||
|
|
||||||
|
// AccoesPresidenciais = Correspondencia = 0
|
||||||
|
setCookie('searchModalAPPType','0', 99999999);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
|||||||
@@ -19,7 +19,17 @@ export class GabineteDigitalPage implements OnInit {
|
|||||||
private processesbackend:ProcessesService,
|
private processesbackend:ProcessesService,
|
||||||
private modalController: ModalController,
|
private modalController: ModalController,
|
||||||
private eventService: EventsService,
|
private eventService: EventsService,
|
||||||
private alertService: AlertService) { }
|
private alertService: AlertService) {
|
||||||
|
function setCookie(cname, cvalue, exdays) {
|
||||||
|
var d = new Date();
|
||||||
|
d.setTime(d.getTime() + (exdays*24*60*60*1000));
|
||||||
|
var expires = "expires="+ d.toUTCString();
|
||||||
|
document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/";
|
||||||
|
}
|
||||||
|
|
||||||
|
// AccoesPresidenciais = Correspondencia = 8
|
||||||
|
setCookie('searchModalAPPType','8,361', 99999999);
|
||||||
|
}
|
||||||
|
|
||||||
count_exp_dailywork=0;
|
count_exp_dailywork=0;
|
||||||
count_exp_pp : string;
|
count_exp_pp : string;
|
||||||
|
|||||||
@@ -39,9 +39,19 @@ export class PublicationsPage implements OnInit {
|
|||||||
private animationController: AnimationController,
|
private animationController: AnimationController,
|
||||||
private loading: LoadingService,
|
private loading: LoadingService,
|
||||||
private publications: PublicationsService,
|
private publications: PublicationsService,
|
||||||
) {
|
) {
|
||||||
this.months = ["Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"];
|
this.months = ["Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"];
|
||||||
this.days = ["Domingo", "Segunda-feira", "Terça-feira", "Quarta-feira", "Quinta-feira", "Sexta-feira", "Sábado"];
|
this.days = ["Domingo", "Segunda-feira", "Terça-feira", "Quarta-feira", "Quinta-feira", "Sexta-feira", "Sábado"];
|
||||||
|
|
||||||
|
function setCookie(cname, cvalue, exdays) {
|
||||||
|
var d = new Date();
|
||||||
|
d.setTime(d.getTime() + (exdays*24*60*60*1000));
|
||||||
|
var expires = "expires="+ d.toUTCString();
|
||||||
|
document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/";
|
||||||
|
}
|
||||||
|
|
||||||
|
// AccoesPresidenciais = AccoesPresidenciais = 386,,
|
||||||
|
setCookie('searchModalAPPType','386', 99999999);
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
|||||||
@@ -88,6 +88,106 @@ export class SearchPage implements OnInit {
|
|||||||
*/
|
*/
|
||||||
basicSearch(){
|
basicSearch(){
|
||||||
|
|
||||||
|
function getCookie(cname) {
|
||||||
|
var name = cname + "=";
|
||||||
|
var decodedCookie = decodeURIComponent(document.cookie);
|
||||||
|
var ca = decodedCookie.split(';');
|
||||||
|
for(var i = 0; i <ca.length; i++) {
|
||||||
|
var c = ca[i];
|
||||||
|
while (c.charAt(0) == ' ') {
|
||||||
|
c = c.substring(1);
|
||||||
|
}
|
||||||
|
if (c.indexOf(name) == 0) {
|
||||||
|
return c.substring(name.length, c.length);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
const APPType = getCookie('searchModalAPPType');
|
||||||
|
|
||||||
|
if(APPType == '0'){
|
||||||
|
|
||||||
|
console.log('aplication type 0');
|
||||||
|
|
||||||
|
this.search.basicSearch(this.searchSubject, this.searchDocumentDate, this.searchSender
|
||||||
|
,this.searchOrganicEntiry, this.searchDocTypeId, '0').subscribe(res=>{
|
||||||
|
console.log(res);
|
||||||
|
|
||||||
|
res.Categories.forEach( e => {
|
||||||
|
e['Active'] = false;
|
||||||
|
});
|
||||||
|
|
||||||
|
// bind respose
|
||||||
|
this.searchCategories = res.Categories;
|
||||||
|
|
||||||
|
this.searchDocuments = this.sortArrayISODate(res.Documents);
|
||||||
|
|
||||||
|
this.reorderList(this.ordinance);
|
||||||
|
|
||||||
|
// hide show document
|
||||||
|
if(this.searchDocuments.length >= 1){
|
||||||
|
this.showDocuments = true;
|
||||||
|
} else {
|
||||||
|
this.showDocuments = false
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
} else if (APPType == '8,361'){
|
||||||
|
|
||||||
|
console.log('aplication type 8,361');
|
||||||
|
|
||||||
|
this.search.basicSearch(this.searchSubject, this.searchDocumentDate, this.searchSender
|
||||||
|
,this.searchOrganicEntiry, this.searchDocTypeId, '8').subscribe(res=>{
|
||||||
|
console.log(res);
|
||||||
|
|
||||||
|
res.Categories.forEach( e => {
|
||||||
|
e['Active'] = false;
|
||||||
|
});
|
||||||
|
|
||||||
|
// bind respose
|
||||||
|
this.searchCategories = res.Categories;
|
||||||
|
|
||||||
|
this.searchDocuments = this.sortArrayISODate(res.Documents);
|
||||||
|
|
||||||
|
this.reorderList(this.ordinance);
|
||||||
|
|
||||||
|
// hide show document
|
||||||
|
if(this.searchDocuments.length >= 1){
|
||||||
|
this.showDocuments = true;
|
||||||
|
} else {
|
||||||
|
this.showDocuments = false
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
this.search.basicSearch(this.searchSubject, this.searchDocumentDate, this.searchSender
|
||||||
|
,this.searchOrganicEntiry, this.searchDocTypeId, '361').subscribe(res=>{
|
||||||
|
console.log(res);
|
||||||
|
|
||||||
|
res.Categories.forEach( e => {
|
||||||
|
e['Active'] = false;
|
||||||
|
});
|
||||||
|
|
||||||
|
// bind respose
|
||||||
|
this.searchCategories = res.Categories;
|
||||||
|
|
||||||
|
this.searchDocuments = this.sortArrayISODate(res.Documents);
|
||||||
|
|
||||||
|
this.reorderList(this.ordinance);
|
||||||
|
|
||||||
|
// hide show document
|
||||||
|
if(this.searchDocuments.length >= 1){
|
||||||
|
this.showDocuments = true;
|
||||||
|
} else {
|
||||||
|
this.showDocuments = false
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
} else if (APPType == '386'){
|
||||||
|
|
||||||
|
console.log('aplication type 386');
|
||||||
|
|
||||||
this.search.basicSearch(this.searchSubject, this.searchDocumentDate, this.searchSender
|
this.search.basicSearch(this.searchSubject, this.searchDocumentDate, this.searchSender
|
||||||
,this.searchOrganicEntiry, this.searchDocTypeId, '386').subscribe(res=>{
|
,this.searchOrganicEntiry, this.searchDocTypeId, '386').subscribe(res=>{
|
||||||
console.log(res);
|
console.log(res);
|
||||||
@@ -111,6 +211,9 @@ export class SearchPage implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user