mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 21:06:06 +00:00
Improve search select document from searh
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
<ion-progress-bar type="indeterminate" class="loader" *ngIf="showLoader"></ion-progress-bar>
|
||||
<div class="d-flex ion-justify-content-between">
|
||||
|
||||
<ion-form class="d-md-none">
|
||||
<ion-form [class.d-md-none]="!select">
|
||||
<div class="d-flex search-input-container ion-justify-content-between" >
|
||||
<div class="icon">
|
||||
<button class="btn-no-color" (click)="basicSearch()">
|
||||
@@ -20,7 +20,8 @@
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</ion-form>
|
||||
</ion-form>
|
||||
|
||||
<!-- search -->
|
||||
<div *ngIf="!showAdvanceSearch" class="icon-z icon-most-searched-word-open" (click)="showHideAdvanceSearch(true)">
|
||||
<ion-icon src="assets/images/icons-most-searched-words-open.svg" class="icon" slot="end"></ion-icon>
|
||||
@@ -140,20 +141,20 @@
|
||||
</div>
|
||||
</div>
|
||||
<ul>
|
||||
<li *ngFor="let searchDocument of showSearchDocuments" (click)="viewDetail(searchDocument.Id)" class="d-flex">
|
||||
<li *ngFor="let searchDocument of showSearchDocuments" (click)="viewDetail(searchDocument.Id); selectItem(searchDocument)" class="d-flex">
|
||||
<div class="icon">
|
||||
<ion-icon *ngIf="itemIcons() == '/home/gabinete-digital' "
|
||||
<ion-icon *ngIf="itemIcons() == 'AccoesPresidenciais & ArquivoDespachoElect' "
|
||||
src="assets/images/icons-search-document.svg"></ion-icon>
|
||||
<ion-icon *ngIf="itemIcons() == '/home/agenda' "
|
||||
<ion-icon *ngIf="itemIcons() == 'Agenda' "
|
||||
src="assets/images/icons-default-agenda.svg"></ion-icon>
|
||||
<ion-icon *ngIf="itemIcons() == '/home/publications' "
|
||||
<ion-icon *ngIf="itemIcons() == 'AccoesPresidenciais' "
|
||||
src="assets/images/icons-viagem.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="content ion-align-items-center">
|
||||
|
||||
<div class="d-flex ion-justify-content-between ">
|
||||
<span class="result-name">{{ searchDocument.Assunto}}</span>
|
||||
<span class="app-name" *ngIf="currentPath == '/home/gabinete-digital' ">{{ searchDocument.appName}}</span>
|
||||
<span class="app-name" *ngIf="itemIcons() == 'AccoesPresidenciais & ArquivoDespachoElect' ">{{ searchDocument.appName}}</span>
|
||||
</div>
|
||||
<div class="d-flex ion-justify-content-between ">
|
||||
<span class="organic-entity">{{ searchDocument.EntidadeOrganicaNome }}</span>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ModalController } from '@ionic/angular';
|
||||
import { ModalController, NavParams } from '@ionic/angular';
|
||||
import { SearchService } from "../../services/search.service";
|
||||
import { SearchCategory } from "src/app/models/search-category";
|
||||
import { SearchDocument } from "src/app/models/search-document";
|
||||
@@ -9,8 +9,9 @@ import { OrganicEntityPage } from 'src/app/pages/search/organic-entity/organic-e
|
||||
import WordCloud from 'src/plugin/wordcloud2.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 { ExpedienteDetailPage } from '../gabinete-digital/expediente/expediente-detail/expediente-detail.page';
|
||||
import { DocumentDetailPage } from 'src/app/modals/document-detail/document-detail.page';
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'app-search',
|
||||
templateUrl: './search.page.html',
|
||||
@@ -51,13 +52,47 @@ export class SearchPage implements OnInit {
|
||||
|
||||
windowWidth: number;
|
||||
|
||||
type : "Agenda" | "Correspondencia" | "AccoesPresidenciais" | "ArquivoDespachoElect" | "AccoesPresidenciais & ArquivoDespachoElect" = "Agenda";
|
||||
select = false;
|
||||
|
||||
constructor(private modalController: ModalController,
|
||||
private search: SearchService,
|
||||
private modalCtrl: ModalController,) {
|
||||
private modalCtrl: ModalController,
|
||||
private navParams: NavParams) {
|
||||
this.ordinance = "recent";
|
||||
|
||||
this.currentPath= window.location.pathname;
|
||||
|
||||
this.type = this.navParams.get('type');
|
||||
|
||||
|
||||
if(this.type == null || this.type == undefined) {
|
||||
|
||||
this.select = true;
|
||||
|
||||
if(this.currentPath == '/home/agenda') {
|
||||
this.type = "Agenda"
|
||||
} else if (this.currentPath =='/home/gabinete-digital') {
|
||||
this.type = "AccoesPresidenciais & ArquivoDespachoElect"
|
||||
|
||||
} else if (this.currentPath == '/home/publications') {
|
||||
this.type = "AccoesPresidenciais"
|
||||
} else {
|
||||
this.select = false
|
||||
}
|
||||
} else {
|
||||
this.select = true;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
selectItem(item: SearchDocument) {
|
||||
if(this.select){
|
||||
this.modalController.dismiss({
|
||||
selected: item
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
@@ -172,9 +207,9 @@ export class SearchPage implements OnInit {
|
||||
/**
|
||||
* @description Basic search
|
||||
*/
|
||||
basicSearch(){
|
||||
basicSearch(){
|
||||
|
||||
if(window.location.pathname == '/home/agenda'){
|
||||
if(this.type == "Agenda" ){
|
||||
|
||||
|
||||
this.showLoader = true;
|
||||
@@ -205,7 +240,7 @@ export class SearchPage implements OnInit {
|
||||
this.loadWordCloud();
|
||||
|
||||
});
|
||||
} else if (window.location.pathname =='/home/gabinete-digital'){
|
||||
} else if ( this.type == "AccoesPresidenciais & ArquivoDespachoElect"){
|
||||
|
||||
this.showLoader = true;
|
||||
|
||||
@@ -267,7 +302,7 @@ export class SearchPage implements OnInit {
|
||||
this.loadWordCloud();
|
||||
});
|
||||
|
||||
} else if (window.location.pathname == '/home/publications'){
|
||||
} else if (this.type == "AccoesPresidenciais"){
|
||||
|
||||
this.showLoader = true;
|
||||
|
||||
@@ -297,7 +332,7 @@ export class SearchPage implements OnInit {
|
||||
this.loadWordCloud();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -424,7 +459,7 @@ export class SearchPage implements OnInit {
|
||||
|
||||
|
||||
itemIcons(): string{
|
||||
return window.location.pathname
|
||||
return this.type
|
||||
}
|
||||
|
||||
viewDocument(){
|
||||
@@ -437,27 +472,28 @@ export class SearchPage implements OnInit {
|
||||
async viewDetail(id:any) {
|
||||
console.log(id);
|
||||
|
||||
|
||||
if(window.location.pathname == '/home/agenda'){
|
||||
if(!this.selectItem){
|
||||
if(window.location.pathname == '/home/agenda'){
|
||||
|
||||
const modal = await this.modalCtrl.create({
|
||||
component: ViewEventPage,
|
||||
componentProps:{
|
||||
eventId: id
|
||||
},
|
||||
cssClass: 'modal modal-desktop',
|
||||
});
|
||||
await modal.present();
|
||||
modal.onDidDismiss().then((res)=>{});
|
||||
|
||||
} else if(window.location.pathname == '/home/publications'){
|
||||
const modal = await this.modalCtrl.create({
|
||||
component: ViewEventPage,
|
||||
componentProps:{
|
||||
eventId: id
|
||||
},
|
||||
cssClass: 'modal modal-desktop',
|
||||
});
|
||||
await modal.present();
|
||||
modal.onDidDismiss().then((res)=>{});
|
||||
|
||||
this.viewPublicationDetail(id);
|
||||
}
|
||||
else if(window.location.pathname == '/home/gabinete-digital'){
|
||||
console.log('OPEN DOC');
|
||||
this.viewDocumentDetail(id,'');
|
||||
|
||||
} else if(window.location.pathname == '/home/publications'){
|
||||
|
||||
this.viewPublicationDetail(id);
|
||||
}
|
||||
else if(window.location.pathname == '/home/gabinete-digital'){
|
||||
console.log('OPEN DOC');
|
||||
this.viewDocumentDetail(id,'');
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -480,7 +516,7 @@ export class SearchPage implements OnInit {
|
||||
async viewDocumentDetail(docId:string, applicationId:string) {
|
||||
let classs;
|
||||
if( window.innerWidth <= 800){
|
||||
classs = 'modal'
|
||||
classs = 'modal modal-desktop'
|
||||
} else {
|
||||
classs = 'modal modal-desktop showAsideOptions'
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user