This commit is contained in:
tiago.kayaya
2021-01-22 15:40:59 +01:00
50 changed files with 1292 additions and 217 deletions
+1 -5
View File
@@ -24,14 +24,10 @@
<ion-icon class="nav-icon" src="assets/images/icons-nav-actions.svg"></ion-icon>
<ion-label>Acções</ion-label>
</ion-tab-button>
<ion-tab-button tab="search">
<ion-icon name="search"></ion-icon>
<ion-label>Pesquisa</ion-label>
</ion-tab-button>
<ion-tab-button tab="chat">
<ion-icon class="nav-icon" src="assets/images/icons-nav-chat-inactive.svg"></ion-icon>
<ion-label>Chat</ion-label>
</ion-tab-button>
</ion-tab-bar>
</ion-tab-bar>
</ion-tabs>
+7
View File
@@ -0,0 +1,7 @@
import { EventSearch } from './event-search';
describe('EventSearch', () => {
it('should create an instance', () => {
expect(new EventSearch()).toBeTruthy();
});
});
+19
View File
@@ -0,0 +1,19 @@
export class EventSearch {
Categories: {
Id: number;
Name: string;
Qtd: 6;
}[] = [];
Documents: {
ApplicationType: number;
Assunto: string;
Data: string;
DocTypeDesc: string;
EntidadeOrganicaId: number;
EntidadeOrganicaNome: string
Id: string
}[] = [];
}
@@ -0,0 +1,7 @@
import { OrganicEntity } from './organic-entity.model';
describe('OrganicEntity', () => {
it('should create an instance', () => {
expect(new OrganicEntity()).toBeTruthy();
});
});
+4
View File
@@ -0,0 +1,4 @@
export class OrganicEntity {
Code: number;
Description: string;
}
+7
View File
@@ -0,0 +1,7 @@
import { SearchCategory } from './search-category';
describe('SearchCategory', () => {
it('should create an instance', () => {
expect(new SearchCategory()).toBeTruthy();
});
});
+5
View File
@@ -0,0 +1,5 @@
export class SearchCategory {
Id: number;
Name: string;
Qtd: 6;
}
+7
View File
@@ -0,0 +1,7 @@
import { SearchDocument } from './search-document';
describe('SearchDocument', () => {
it('should create an instance', () => {
expect(new SearchDocument()).toBeTruthy();
});
});
+10
View File
@@ -0,0 +1,10 @@
export class SearchDocument {
ApplicationType: number;
Assunto: string;
Data: string;
DocTypeDesc: string;
EntidadeOrganicaId: number;
EntidadeOrganicaNome: string
Id: string
}
+7
View File
@@ -0,0 +1,7 @@
export class Search {
subject: string;
date: string;
sender: string;
organicEntity: string;
docTypeId: string;
}
+82 -76
View File
@@ -2,90 +2,96 @@
<app-header></app-header>
</ion-header>
<ion-content class="main bg-blue">
<ion-progress-bar type="indeterminate" *ngIf="showLoader"></ion-progress-bar>
<!-- Default Refresher -->
<ion-content class="main bg-blue" ng-controller="AppController">
<ion-refresher slot="fixed" (ionRefresh)="doRefresh($event)">
<ion-refresher-content>
</ion-refresher-content>
</ion-refresher>
<ion-label>
<p class="time ion-text-center">{{customDate}}</p>
</ion-label>
<ion-label>
<p class="event-number p-small ion-text-center"> <strong>{{totalEvent}}</strong> eventos agendados para hoje</p>
</ion-label>
<ion-progress-bar type="indeterminate" *ngIf="showLoader"></ion-progress-bar>
<ion-label>
<p class="time ion-text-center">{{customDate}}</p>
</ion-label>
<ion-label>
<p class="event-number p-small ion-text-center"> <strong>{{totalEvent}}</strong> eventos agendados para hoje</p>
</ion-label>
<div class="next-meeting">
<div class="meeting-time">{{hoursMinutes}}</div>
<div class="meeting-description"> "{{currentEvent}}"</div>
</div>
<div class="next-meeting">
<div class="meeting-time">{{hoursMinutes}}</div>
<div class="meeting-description"> "{{currentEvent}}"</div>
</div>
<div class="conteiner-box">
<div class="schedule">
<div class="schedule-header">
<div class="title">
<ion-icon class="icon" slot="end" src="assets/images/icons-default-agenda.svg" ></ion-icon>
<div class="text">A sua Agenda</div>
</div>
<ion-icon class="icon-next" slot="end" src="assets/images/icons-arrow-circle-arrow-right.svg" ></ion-icon>
</div>
<div class="content">
<ul>
<li *ngFor="let event of eventsList"
[routerLink]="['/home/events', event.EventId, 'events']">
<div class="d-flex content-{{profile}}-{{event.CalendarName}}">
<div class="schedule-time">
<div class="time-start">{{event.StartDate | date: 'hh:mm'}}</div>
<div class="time-end">{{event.EndDate | date: 'hh:mm'}}</div>
</div>
<div class="schedule-details">
<div class="location">{{event.Location}}</div>
<div class="description">{{event.Subject}}</div>
</div>
</div>
</li>
</ul>
<!--
<div class="resume">
<div class="conteiner-box" ng-swipe-up="swipe($event)">
<div class="schedule">
<div class="schedule-header">
<div class="title">
Resumo para Amnahã
<ion-icon class="icon" slot="end" src="assets/images/icons-default-agenda.svg" ></ion-icon>
<div class="text">A sua Agenda</div>
</div>
<div class="event-num">4 eventos ageandados para amanhã</div>
<div class="first-event-time">08:30 "Reunião Staff" no Palácio Presidencial</div>
<ion-icon class="icon-next" slot="end" src="assets/images/icons-arrow-circle-arrow-right.svg" ></ion-icon>
</div>
<div class="content">
<ul>
<li *ngFor="let event of eventsList"
[routerLink]="['/home/events', event.EventId, 'events']">
<div class="d-flex content-{{profile}}-{{event.CalendarName}}">
<div class="schedule-time">
<div class="time-start">{{event.StartDate | date: 'hh:mm'}}</div>
<div class="time-end">{{event.EndDate | date: 'hh:mm'}}</div>
</div>
<div class="schedule-details">
<div class="location">{{event.Location}}</div>
<div class="description">{{event.Subject}}</div>
</div>
</div>
</li>
</ul>
<!--
<div class="resume">
<div class="title">
Resumo para Amnahã
</div>
<div class="event-num">4 eventos ageandados para amanhã</div>
<div class="first-event-time">08:30 "Reunião Staff" no Palácio Presidencial</div>
</div>
-->
</div>
</div>
<div class="schedule">
<div class="schedule-header">
<div class="title">
<ion-icon class="icon" slot="end" src="assets/images/icons-correspondencias.svg"></ion-icon>
<div class="text">Correspondência por ler</div>
</div>
<ion-icon class="icon-next" slot="end" src="assets/images/icons-arrow-circle-arrow-right.svg" ></ion-icon>
</div>
<div class="content">
<ul>
<li *ngFor = "let task of taskslist"
[routerLink]="['/home/gabinete-digital/expediente',task.SerialNumber]">
<div class="d-flex">
<div class="schedule-date">
<div class="time-end">{{task.CreateDate | date: 'd/M/yy'}}</div>
<div class="time-start">{{task.CreateDate | date: 'hh:mm'}}</div>
</div>
<div class="schedule-details pointer">
<div class="description">{{ task.Remetente }}</div>
<div class="location">{{ task.Folio }}</div>
</div>
</div>
</li>
</ul>
</div>
-->
</div>
</div>
<div class="schedule">
<div class="schedule-header">
<div class="title">
<ion-icon class="icon" slot="end" src="assets/images/icons-correspondencias.svg"></ion-icon>
<div class="text">Correspondência por ler</div>
</div>
<ion-icon class="icon-next" slot="end" src="assets/images/icons-arrow-circle-arrow-right.svg" ></ion-icon>
</div>
<div class="content">
<ul>
<li *ngFor = "let task of taskslist"
[routerLink]="['/home/gabinete-digital/expediente',task.SerialNumber]">
<div class="d-flex">
<div class="schedule-date">
<div class="time-end">{{task.CreateDate | date: 'd/M/yy'}}</div>
<div class="time-start">{{task.CreateDate | date: 'hh:mm'}}</div>
</div>
<div class="schedule-details pointer">
<div class="description">{{ task.Remetente }}</div>
<div class="location">{{ task.Folio }}</div>
</div>
</div>
</li>
</ul>
</div>
</div>
</div>
</ion-content>
+1
View File
@@ -394,6 +394,7 @@ ion-toolbar{
}
}
.schedule-date{
margin-right: 10px;
width: 22%;
color: #797979 !important;
font-size: 13px;
+32 -2
View File
@@ -76,6 +76,11 @@ export class EventsPage implements OnInit {
}
swipe(){
console.log('!!!!');
}
ngOnInit() {
//Inicializar segment
this.segment = "Combinada";
@@ -136,9 +141,11 @@ export class EventsPage implements OnInit {
if(this.profile == "mdgpr"){
this.eventService.getAllMdEvents(formatDate(new Date(), 'yyyy-MM-dd HH:mm:ss', 'pt') /* + ' 00:00:00' */, formatDate(new Date(), 'yyyy-MM-dd', 'pt') + ' 23:59:59').subscribe(res => {
this.eventsList = res;
if(res.length > 0){
this.currentEvent = res[0].Subject;
}
this.totalEvent = this.eventsList.length;
this.showLoader = false;
});
@@ -146,6 +153,8 @@ export class EventsPage implements OnInit {
this.eventService.getAllPrEvents(formatDate(new Date(), 'yyyy-MM-dd', 'pt') + ' 00:00:00', formatDate(new Date(), 'yyyy-MM-dd', 'pt') + ' 23:59:59').subscribe(res => {
this.eventsList = res;
console.log(this.eventsList);
console.log(res)
console.log(res[0])
this.currentEvent = res[0].Subject;
this.totalEvent = this.eventsList.length;
this.showLoader = false;
@@ -257,7 +266,9 @@ export class EventsPage implements OnInit {
LoadList()
{
this.processes.GetTasksList("Expediente", false).subscribe(result => {
this.taskslist = new Array();
const AllResult = new Array();
result.forEach(element => {
let task: DailyWorkTask = {
"SerialNumber": element.serialNumber,
@@ -267,9 +278,28 @@ export class EventsPage implements OnInit {
"DocumentURL": element.formURL,
"Remetente": element.workflowInstanceDataFields.Remetente
}
this.taskslist.push(task);
// CreateDate
AllResult.push(task);
});
console.log(AllResult);
this.taskslist = this.sortArrayISODate(AllResult).reverse()
});
}
sortArrayISODate(myArray: any){
return myArray.sort(function(a, b) {
return (a.CreateDate < b.CreateDate) ? -1 : ((a.CreateDate > b.CreateDate) ? 1 : 0);
});
}
}
@@ -0,0 +1,17 @@
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { FilterPage } from './filter.page';
const routes: Routes = [
{
path: '',
component: FilterPage
}
];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule],
})
export class FilterPageRoutingModule {}
@@ -0,0 +1,20 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { IonicModule } from '@ionic/angular';
import { FilterPageRoutingModule } from './filter-routing.module';
import { FilterPage } from './filter.page';
@NgModule({
imports: [
CommonModule,
FormsModule,
IonicModule,
FilterPageRoutingModule
],
declarations: [FilterPage]
})
export class FilterPageModule {}
@@ -0,0 +1,7 @@
<ion-list>
<ion-list-header>Ionic</ion-list-header>
<button ion-item (click)="close()">Learn Ionic</button>
<button ion-item (click)="close()">Documentation</button>
<button ion-item (click)="close()">Showcase</button>
<button ion-item (click)="close()">GitHub Repo</button>
</ion-list>
@@ -0,0 +1,24 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { IonicModule } from '@ionic/angular';
import { FilterPage } from './filter.page';
describe('FilterPage', () => {
let component: FilterPage;
let fixture: ComponentFixture<FilterPage>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ FilterPage ],
imports: [IonicModule.forRoot()]
}).compileComponents();
fixture = TestBed.createComponent(FilterPage);
component = fixture.componentInstance;
fixture.detectChanges();
}));
it('should create', () => {
expect(component).toBeTruthy();
});
});
@@ -0,0 +1,15 @@
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-filter',
templateUrl: './filter.page.html',
styleUrls: ['./filter.page.scss'],
})
export class FilterPage implements OnInit {
constructor() { }
ngOnInit() {
}
}
@@ -0,0 +1,17 @@
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { OrganicEntityPage } from './organic-entity.page';
const routes: Routes = [
{
path: '',
component: OrganicEntityPage
}
];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule],
})
export class OrganicEntityPageRoutingModule {}
@@ -0,0 +1,20 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { IonicModule } from '@ionic/angular';
import { OrganicEntityPageRoutingModule } from './organic-entity-routing.module';
import { OrganicEntityPage } from './organic-entity.page';
@NgModule({
imports: [
CommonModule,
FormsModule,
IonicModule,
OrganicEntityPageRoutingModule
],
declarations: [OrganicEntityPage]
})
export class OrganicEntityPageModule {}
@@ -0,0 +1,23 @@
<ion-header class="main-header">
<div class="icon" (click)="close()">
<ion-icon name="chevron-back" slot="start"></ion-icon>
</div>
<ion-toolbar>
<ion-title>Remetentes</ion-title>
</ion-toolbar>
</ion-header>
<ion-content>
<div class="main-container">
<div class="input-text d-flex ion-align-items-center">
<ion-input [(ngModel)]='findEntity' class="search-input" type="search" placeholder="Pesquisar" (ngModelChange)="filterContact($event)" ></ion-input>
</div>
<ul>
<li *ngFor="let organicEntity of showOrganicEntities" (click)="selectOrganicEntidy(organicEntity.Description)">
{{ organicEntity.Description }}
</li>
</ul>
</div>
</ion-content>
@@ -0,0 +1,39 @@
.main-header{
display: flex;
align-items: center;
}
.icon{
color: #797979;
width: 45px;
height: 45px;
display: flex;
justify-content: center;
font-size: 25px;
align-items: center;
}
.main-container{
padding: 0px 20px;
.input-text {
margin-top: 20px;
width: 100%;
height: 45px;
border-radius: 5px;
border: 1px solid #ebebeb;
}
ul{
padding: 0px;
margin: 0px;
padding-top: 10px;
li{
padding-top: 5px;
padding-bottom: 10px;
margin: 0px;
padding-bottom: 10px;
border-bottom: 1px solid #ebebeb;
list-style: none;
font-family: Roboto;
font-size: 15px;
}
}
}
@@ -0,0 +1,24 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { IonicModule } from '@ionic/angular';
import { OrganicEntityPage } from './organic-entity.page';
describe('OrganicEntityPage', () => {
let component: OrganicEntityPage;
let fixture: ComponentFixture<OrganicEntityPage>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ OrganicEntityPage ],
imports: [IonicModule.forRoot()]
}).compileComponents();
fixture = TestBed.createComponent(OrganicEntityPage);
component = fixture.componentInstance;
fixture.detectChanges();
}));
it('should create', () => {
expect(component).toBeTruthy();
});
});
@@ -0,0 +1,58 @@
import { Component, OnInit } from '@angular/core';
import { ModalController } from '@ionic/angular';
import { from } from 'rxjs';
import { OrganicEntityService } from 'src/app/services/organic-entity.service';
import { OrganicEntity } from 'src/app/models/organic-entity.model';
@Component({
selector: 'app-organic-entity',
templateUrl: './organic-entity.page.html',
styleUrls: ['./organic-entity.page.scss'],
})
export class OrganicEntityPage implements OnInit {
organicEntities: OrganicEntity[];
showOrganicEntities: OrganicEntity[];
findEntity: string;
constructor(private modalController:ModalController,
private OrganicEntityService: OrganicEntityService) {
}
ngOnInit() {
this.getOrganicEntity();
}
getOrganicEntity(){
this.OrganicEntityService.getOrganicEntity().subscribe(res=>{
console.log(res)
this.organicEntities = res;
});
}
filterContact(){
const findEntity = this.findEntity.toLowerCase();
const entities = this.organicEntities.filter((Entity) => {
if (Entity.Description.toLowerCase().indexOf(findEntity) == 0){
return true;
}
});
this.showOrganicEntities = entities;
}
selectOrganicEntidy(selectedOraganicEntit: string){
this.close(selectedOraganicEntit)
}
close(username: string){
this.modalController.dismiss(username);
}
}
@@ -7,6 +7,18 @@ const routes: Routes = [
{
path: '',
component: SearchPage
},
{
path: 'sender',
loadChildren: () => import('./sender/sender.module').then( m => m.SenderPageModule)
},
{
path: 'filter',
loadChildren: () => import('./filter/filter.module').then( m => m.FilterPageModule)
},
{
path: 'organic-entity',
loadChildren: () => import('./organic-entity/organic-entity.module').then( m => m.OrganicEntityPageModule)
}
];
+2
View File
@@ -8,12 +8,14 @@ import { SearchPageRoutingModule } from './search-routing.module';
import { SearchPage } from './search.page';
/* import { ComponentsModule } from 'src/app/components/components.module'; */
import { TagCloudModule } from 'angular-tag-cloud-module';
@NgModule({
imports: [
CommonModule,
FormsModule,
IonicModule,
TagCloudModule,
/* ComponentsModule, */
SearchPageRoutingModule
],
+85 -97
View File
@@ -2,140 +2,128 @@
<!-- HEADER-->
<ion-header class="ion-no-border header-main d-flex ion-justify-content-between">
<ion-form>
<div class="d-flex search-input-container">
<div class="icon">
<div class="d-flex search-input-container ion-justify-content-between" >
<div class="icon" (click)="basicSearch()">
<ion-icon class="icon-z" slot="end" name="search"></ion-icon>
</div>
<div class="input-text d-flex ion-align-items-center">
<ion-input class="search-input" type="search" placeholder="Pesquisar"></ion-input>
<ion-input [(ngModel)]='searchSubject' class="search-input" type="search" placeholder="Pesquisar"></ion-input>
</div>
<div class="icon">
<div class="icon" (click)="clearSearchInput()">
<ion-icon name="restaurant-outline" src="assets/images/icons-search-close.svg"></ion-icon>
</div>
</div>
</ion-form>
<div class="icon-z icon-most-searched-word-open">
<!-- 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>
</div>
<div *ngIf="showAdvanceSearch" class="icon-z icon-most-searched-word-open" (click)="showHideAdvanceSearch(false)" >
<ion-icon src="assets/images/advance-search-show-modal.svg" class="icon" slot="end"></ion-icon>
</div>
<div class="profile">
<ion-icon class="icon" src="assets/images/icons-profile.svg"></ion-icon>
</div>
</ion-header>
<ion-content class="content">
<ion-content class="main-content">
<!-- search result type-->
<div class="options">
<div class="container ion-justify-content-between ion-align-items-center">
<div class="d-flex ion-justify-content-center ion-text-center">
<div class="button">
<p>Relatório</p>
<ion-label class="label">10</ion-label>
</div>
<div class="button">
<p>Relatório</p>
<ion-label class="label">10</ion-label>
</div>
<div class="button">
<p>Relatório</p>
<ion-label class="label">10</ion-label>
</div>
<div class="button">
<p>Relatório</p>
<ion-label class="label">10</ion-label>
</div>
<div class="button">
<p>Relatório</p>
<ion-label class="label">10</ion-label>
</div>
<div class="button">
<p>Relatório</p>
<ion-label class="label">10</ion-label>
<!-- Search drop down -->
<div class="advance-search" *ngIf="showAdvanceSearch">
<!-- -->
<li class="d-flex date-container ion-justify-content-between">
<div class="icon-mer icon">
<ion-icon name="restaurant-outline" src="assets/images/icons-advance-search-document.svg"></ion-icon>
</div>
<div class="input-container d-flex ion-align-items-center">
<ion-datetime [(ngModel)]='searchDocumentDate' display-timezone="utc"></ion-datetime>
<div class="icon" (click)="clearInputDocumentDate()">
<ion-icon name="restaurant-outline" src="assets/images/icons-search-close.svg"></ion-icon>
</div>
</div>
<div class="icon-z icon-most-searched-word-open">
<ion-icon src="assets/images/icons-most-searched-words-open.svg" class="icon" slot="end"></ion-icon>
</li>
<!-- Sender -->
<li class="d-flex date-container ion-justify-content-between">
<div class="icon-mer icon">
<ion-icon name="restaurant-outline" src="assets/images/icons-advance-search-sender.svg"></ion-icon>
</div>
</div>
<div class="input-container d-flex ion-align-items-center">
<ion-input [(ngModel)]='searchSender' class="search-input" (click)="openAdvanceSearchSelection()" type="search" placeholder="Remetentes"></ion-input>
<div class="icon" (click)="clearInputRemetente()" >
<ion-icon name="restaurant-outline" src="assets/images/icons-search-close.svg"></ion-icon>
</div>
</div>
</li>
<!-- Organic entity -->
<li class="d-flex date-container ion-justify-content-between">
<div class="icon-mer icon">
<ion-icon name="restaurant-outline" src="assets/images/icons-arrow-arrow-down-25-copy.svg"></ion-icon>
</div>
<div class="input-container d-flex ion-align-items-center">
<ion-input [(ngModel)]='searchOrganicEntiry' class="search-input" type="search" placeholder="Entidade Orgânica" (click)="openOrganicEntitySelection()"></ion-input>
<div class="icon" (click)="clearInputOrganicEntity()" >
<ion-icon name="restaurant-outline" src="assets/images/icons-search-close.svg"></ion-icon>
</div>
</div>
</li>
</div>
<div class="d-flex">
<!-- search result categories-->
<div class="options" *ngIf="showDocuments">
<div class="container ion-justify-content-between ion-align-items-center">
<div class="d-flex ion-justify-content-center ion-text-center">
<!-- SLIDE -->
<ion-slides class="slide" pager="false" [options]="slideOpts">
<ion-slide *ngFor="let category of searchCategories; index as i;">
<div class="button" (click)="filterDocList(category.Name)" (click)="activeCategoty(i)"[ngClass]="{'active-category': category.Active}">
<p>{{ category.Name }}</p>
<ion-label class="label">{{ category.Qtd }}</ion-label>
</div>
</ion-slide>
</ion-slides>
</div>
<button class="icon-z icon-most-searched-word-open" ion-button icon-only >
<ion-icon src="assets/images/icons-most-searched-words-open.svg" class="icon" slot="end"></ion-icon>
</button>
</div>
</div>
<div class="d-flex ion-wrap word-searh-result-container">
<!-- most searched word-->
<div class="most-searched-words">
<p>Palavas mais pesquisdas</p>
<div class="most-searched-words" *ngIf="!showDocuments">
<p class="title ion-text-center">Palavras mais pesquisadas</p>
</div>
<!-- search result-->
<div class="search-result">
<!-- search result document-->
<div class="search-result" *ngIf="showDocuments">
<div class="header">
<div class="d-flex ion-justify-content-between ion-align-items-center">
<div class="d-flex sort-by ion-justify-content-center">
<p><span class="order">Order por:</span><span class="order-labal">Mais Recente</span></p>
<p>
<span class="order">Order por:</span>
<span *ngIf="ordinance == 'recent'" class="order-labal">Mais Recente</span>
<span *ngIf="ordinance == 'old'" class="order-labal">Mais Antigo</span>
</p>
</div>
<div>
<ion-icon src="assets/images/icons-arrow-arrow-down-25.svg"></ion-icon>
<ion-icon *ngIf="ordinance == 'old'" (click)="reorderList('recent')" src="assets/images/icons-arrow-arrow-up.svg"></ion-icon>
<ion-icon *ngIf="ordinance == 'recent'" (click)="reorderList('old')" src="assets/images/icons-arrow-arrow-down-25.svg"></ion-icon>
</div>
</div>
</div>
<ul>
<li class="d-flex">
<li *ngFor="let searchDocument of showSearchDocuments" class="d-flex">
<div class="icon">
<ion-icon src="assets/images/icons-search-document.svg"></ion-icon>
</div>
<div class="content ion-align-items-center">
<p class="result-name">title</p>
<p class="result-name">{{ searchDocument.Assunto}}</p>
<div class="d-flex ion-justify-content-between ">
<span>MINEC, MINFIN</span>
<span>13/04/2020</span>
</div>
</div>
</li>
<li class="d-flex">
<div class="icon">
<ion-icon src="assets/images/icons-search-document.svg"></ion-icon>
</div>
<div class="content">
<p class="result-name">title</p>
<div class="d-flex ion-justify-content-between">
<span>MINEC, MINFIN</span>
<span>13/04/2020</span>
</div>
</div>
</li>
<li class="d-flex">
<div class="icon">
<ion-icon src="assets/images/icons-search-document.svg"></ion-icon>
</div>
<div class="content">
<p class="result-name">title</p>
<div class="d-flex ion-justify-content-between">
<span>MINEC, MINFIN</span>
<span>13/04/2020</span>
</div>
</div>
</li>
<li class="d-flex">
<div class="icon">
<ion-icon src="assets/images/icons-search-document.svg"></ion-icon>
</div>
<div class="content">
<p class="result-name">title</p>
<div class="d-flex ion-justify-content-between">
<span>MINEC, MINFIN</span>
<span>13/04/2020</span>
</div>
</div>
</li>
<li class="d-flex">
<div class="icon">
<ion-icon src="assets/images/icons-search-document.svg"></ion-icon>
</div>
<div class="content">
<p class="result-name">title</p>
<div class="d-flex ion-justify-content-between">
<span>MINEC, MINFIN</span>
<span>13/04/2020</span>
<span class="organic-entity">{{ searchDocument.EntidadeOrganicaNome }}</span>
<span class="documente-date">{{ formateIsoDate(searchDocument.Data) }}</span>
</div>
</div>
</li>
@@ -144,4 +132,4 @@
</div>
</ion-content>
</ion-content>
+106 -33
View File
@@ -2,8 +2,11 @@
padding: 5px 18px;
padding-bottom: 2px;
padding-top: 25px;
ion-form{
width: 100%;
padding-right: 10px;
}
.search-input-container{
max-width: 309px;
background-color: white;
border-radius: 27.5px;
border: solid 1px #ebebeb;
@@ -16,8 +19,11 @@
font-size: 25px;
align-items: center;
}
.input-text{
width: 100%;
}
.icon-z{
width: 15px;
width: 20px;
}
}
.icon-z{
@@ -33,6 +39,10 @@
}
ion-slide{
padding-top: 5px
}
// search result type
.options{
margin-top: 10px;
@@ -44,19 +54,27 @@
width: 100%;
flex-wrap: wrap;
.button{
width: 116px;
min-width: 116px;
border: solid 1px #e9e9e9;
margin: 0px 5px;
margin-bottom: 10px;
padding: 5px 20px;
height: 100%;
box-sizing: 100%;
display: flex;
flex-wrap: wrap;
justify-content: center;
align-items: center;
p{
padding: 0px;
margin: 0px;
font-family: Roboto;
color: #0d89d1;
font-size: 15px;
width: 100%;
}
.label{
width: 100%;
font-family: Roboto;
font-size: 13px;
font-weight: 300;
@@ -65,7 +83,7 @@
border-radius: 15px;
}
.button:hover{
.active-category{
background-color: #42b9fe;
color: white;
p{
@@ -92,9 +110,14 @@
}
.d-flex{
display: flex;
}
// document
.word-searh-result-container{
display: flex;
flex-wrap: wrap;
// search result
.search-result{
width: 100%;
@@ -148,21 +171,26 @@
line-height: 1.67;
}
span{
height: 15px;
font-family: Roboto;
font-size: 13px;
font-weight: 300;
color: #797979;
}
span.documente-date{
}
span.organic-entity{
width: 100%;
}
}
}
}
}
// most searched word
.most-searched-words{
width: 400px;
display: none;
p{
width: 100%;
p.title{
width: 100%;
height: 24px;
font-family: Roboto;
font-size: 20px;
@@ -177,34 +205,79 @@
@media only screen and (min-width: 1024px) {
.header-main {
background-color: #0782c9;
.profile{
display: inline-block;
}
.icon-most-searched-word-open{
display: none !important;
}
}
.options{
.container{
border-bottom: 1px solid #ebebeb;
.icon{
display: flex;
}
}
padding: 0px 20px;
}
// .header-main {
// background-color: #0782c9;
// .profile{
// display: inline-block;
// }
// .icon-most-searched-word-open{
// display: none !important;
// }
// }
// .options{
// .container{
// border-bottom: 1px solid #ebebeb;
// .icon{
// display: flex;
// }
// }
// padding: 0px 20px;
// }
.most-searched-words{
display: inline-block !important;
// .search-result{
// border-left: 1px solid #d8d8d8;
// .header{
// border-top: unset !important;
// }
// }
// .most-searched-words{
// width: 400px !important;
// }
// .word-searh-result-container{
// flex-wrap: wrap;
// }
}
/* Advance search */
.advance-search{
padding: 20px 20px;
padding-top: 14px;
.icon{
color: #797979;
width: 45px;
height: 45px;
display: flex;
justify-content: center;
font-size: 25px;
align-items: center;
}
.search-result{
border-left: 1px solid #d8d8d8;
.header{
border-top: unset !important;
.input-container{
margin-bottom: 15px;
width: 100%;
border-radius: 5px;
border: solid 1px #ebebeb;
}
.date-container{
.icon-mer{
margin-right: 10px;
}
}
ion-datetime{
width: 100%;
}
.subject-container{
}
}
+195 -2
View File
@@ -1,6 +1,15 @@
import { Component, OnInit } from '@angular/core';
import { ModalController } from '@ionic/angular';
import { ProcessesService } from 'src/app/services/processes.service';
import { SearchService } from "../../services/search.service";
import { SearchCategory } from "src/app/models/search-category";
import { SearchDocument } from "src/app/models/search-document";
import { formatDate } from '@angular/common';
import { CloudData, CloudOptions } from 'angular-tag-cloud-module';
import { SenderPage } from 'src/app/pages/search/sender/sender.page';
import { OrganicEntityPage } from 'src/app/pages/search/organic-entity/organic-entity.page';
import { NgModel } from '@angular/forms';
@Component({
selector: 'app-search',
templateUrl: './search.page.html',
@@ -8,12 +17,196 @@ import { ModalController } from '@ionic/angular';
})
export class SearchPage implements OnInit {
constructor(private modalController: ModalController) { }
// https params
private searchSubject: string;
private searchDocumentDate: string;
private searchSender: string;
private searchOrganicEntiry: string;
private searchDocTypeId: string;
private ordinance: string;
searchCategories: SearchCategory[];
showSearchDocuments: SearchDocument[];
showCategory: string;
searchDocuments: SearchDocument[];
showDocuments = false;
showAdvanceSearch = false;
options: CloudOptions = {
// if width is between 0 and 1 it will be set to the width of the upper element multiplied by the value
width: 1000,
// if height is between 0 and 1 it will be set to the height of the upper element multiplied by the value
height: 400,
overflow: false,
};
data: CloudData[] = [
{text: 'Weight-8-link-color', weight: 8, link: 'https://google.com', color: '#ffaaee'},
{text: 'Weight-10-link', weight: 10, link: 'https://google.com', tooltip: 'display a tooltip'},
// ...
];
// See http://idangero.us/swiper/api/ for valid options.
slideOpts = {
slidesPerView: 3,
initialSlide: 0,
speed: 400,
}
constructor(private modalController: ModalController,
private search: SearchService) {
this.ordinance = "recent";
}
ngOnInit() {
}
close(){
this.modalController.dismiss();
}
}
reorderList(orderBy: string){
this.ordinance = orderBy;
if(this.ordinance == 'recent'){
this.showSearchDocuments = this.sortArrayISODate(this.searchDocuments).reverse();
} else {
this.showSearchDocuments = this.sortArrayISODate(this.searchDocuments)
}
}
sortArrayISODate(myArray: any){
return myArray.sort(function(a, b) {
return (a.Data < b.Data) ? -1 : ((a.Data > b.Data) ? 1 : 0);
});
}
/**
* @description Basic search
*/
basicSearch(){
this.search.basicSearch(this.searchSubject, this.searchDocumentDate, this.searchSender
,this.searchOrganicEntiry, this.searchDocTypeId).subscribe(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
}
});
}
/**
* @description set empty value to searchSubject
*/
clearSearchInput(){
this.searchSubject = ""
}
/**
* @param isoDate String Iso date
* @returns date in format dd/MM/yyyy
* @description convert Iso date to dd/MM/yyyy
*/
formateIsoDate(isoDate:string): string{
const date = new Date(isoDate);
return formatDate(date, 'dd/MM/yyyy', 'pt');
}
activeCategoty(i){
this.searchCategories.forEach((e) => {
e['Active'] = false;
})
this.searchCategories[i]['Active'] = true;
}
clearInputRemetente(){
this.searchSender = "";
}
clearInputDocumentDate(){
this.searchDocumentDate = "";
}
clearInputOrganicEntity(){
this.searchOrganicEntiry = "";
}
/**
* @description Clean inputs
*/
showHideAdvanceSearch(show:boolean) {
this.showAdvanceSearch = show;
}
async openAdvanceSearchSelection() {
const modal = await this.modalController.create({
component: SenderPage,
cssClass: 'sender',
componentProps: {
}
});
await modal.present();
modal.onDidDismiss().then((data) => {
this.searchSender = data.data;
});
}
async openOrganicEntitySelection(){
const modal = await this.modalController.create({
component: OrganicEntityPage,
cssClass: 'organicEnity',
componentProps: {
}
});
await modal.present();
modal.onDidDismiss().then((data) => {
this.searchOrganicEntiry = data.data;
});
}
async filterDocList(categoryName:string){
// show all category
if(this. showCategory == categoryName ){
this.showSearchDocuments = this.searchDocuments;
} else { // filter category
this.showSearchDocuments = this.searchDocuments.filter((e) => e.DocTypeDesc == categoryName);
}
this.showCategory = categoryName;
}
}
@@ -0,0 +1,17 @@
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { SenderPage } from './sender.page';
const routes: Routes = [
{
path: '',
component: SenderPage
}
];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule],
})
export class SenderPageRoutingModule {}
@@ -0,0 +1,20 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { IonicModule } from '@ionic/angular';
import { SenderPageRoutingModule } from './sender-routing.module';
import { SenderPage } from './sender.page';
@NgModule({
imports: [
CommonModule,
FormsModule,
IonicModule,
SenderPageRoutingModule
],
declarations: [SenderPage]
})
export class SenderPageModule {}
@@ -0,0 +1,23 @@
<ion-header class="main-header">
<div class="icon" (click)="close()">
<ion-icon name="chevron-back" slot="start"></ion-icon>
</div>
<ion-toolbar>
<ion-title>Remetentes</ion-title>
</ion-toolbar>
</ion-header>
<ion-content>
<div class="main-container">
<div class="input-text d-flex ion-align-items-center">
<ion-input [(ngModel)]='sender' class="search-input" type="search" placeholder="Pesquisar" (ngModelChange)="filterContact($event)" ></ion-input>
</div>
<ul>
<li *ngFor="let contact of showContacts" (click)="selectUser(contact.Name)">
{{ contact.Name }}
</li>
</ul>
</div>
</ion-content>
@@ -0,0 +1,40 @@
.main-header{
display: flex;
align-items: center;
}
.icon{
color: #797979;
width: 45px;
height: 45px;
display: flex;
justify-content: center;
font-size: 25px;
align-items: center;
}
.main-container{
padding: 0px 20px;
.input-text {
margin-top: 20px;
width: 100%;
height: 45px;
border-radius: 5px;
border: 1px solid #ebebeb;
}
ul{
padding: 0px;
margin: 0px;
padding-top: 10px;
li{
padding-top: 5px;
padding-bottom: 10px;
margin: 0px;
padding-bottom: 10px;
border-bottom: 1px solid #ebebeb;
list-style: none;
font-family: Roboto;
font-size: 15px;
}
}
}
@@ -0,0 +1,24 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { IonicModule } from '@ionic/angular';
import { SenderPage } from './sender.page';
describe('SenderPage', () => {
let component: SenderPage;
let fixture: ComponentFixture<SenderPage>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ SenderPage ],
imports: [IonicModule.forRoot()]
}).compileComponents();
fixture = TestBed.createComponent(SenderPage);
component = fixture.componentInstance;
fixture.detectChanges();
}));
it('should create', () => {
expect(component).toBeTruthy();
});
});
@@ -0,0 +1,58 @@
import { Component, OnInit } from '@angular/core';
import { ModalController } from '@ionic/angular';
import { ContactsService } from 'src/app/services/contacts.service';
import { EventPerson } from 'src/app/models/eventperson.model';
@Component({
selector: 'app-sender',
templateUrl: './sender.page.html',
styleUrls:
['./sender.page.scss'],
})
export class SenderPage implements OnInit {
contacts: EventPerson[];
showContacts: EventPerson[];
sender: string;
selectedUser: string;
constructor(private modalController:ModalController,
private ContactsService: ContactsService) {
}
ngOnInit() {
this.getSender();
}
getSender(){
this.ContactsService.getContacts("").subscribe(res=>{
this.contacts = res;
});
}
filterContact(){
const findPerson = this.sender.toLowerCase();
const persons = this.contacts.filter((person) => {
if (person.Name.toLowerCase().indexOf(findPerson) == 0){
return true;
}
});
this.showContacts = persons;
}
selectUser(username:string){
console.log(username);
this.selectedUser = username;
this.close(this.selectedUser);
}
close(username: string){
this.modalController.dismiss(username);
}
}
@@ -0,0 +1,16 @@
import { TestBed } from '@angular/core/testing';
import { OrganicEntityService } from './organic-entity.service';
describe('OrganicEntityService', () => {
let service: OrganicEntityService;
beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(OrganicEntityService);
});
it('should be created', () => {
expect(service).toBeTruthy();
});
});
@@ -0,0 +1,35 @@
import { Injectable } from '@angular/core';
import { EventPerson } from '../models/eventperson.model';
import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http';
import { Observable } from 'rxjs';
import { environment } from 'src/environments/environment';
import { AuthService } from '../services/auth.service';
import { User } from '../models/user.model';
import { OrganicEntity } from 'src/app/models/organic-entity.model';
@Injectable({
providedIn: 'root'
})
export class OrganicEntityService {
authheader = {};
loggeduser: User;
headers: HttpHeaders;
constructor(private http: HttpClient, user: AuthService) {
this.loggeduser = user.ValidatedUser;
this.headers = new HttpHeaders();
this.headers = this.headers.set('Authorization', this.loggeduser.BasicAuthKey);
}
getOrganicEntity(): Observable<OrganicEntity[]>{
const geturl = environment.apiURL + 'ecm/organic';
let options = {
headers: this.headers,
};
return this.http.get<OrganicEntity[]>(`${geturl}`, options);
}
}
+16
View File
@@ -0,0 +1,16 @@
import { TestBed } from '@angular/core/testing';
import { SearchService } from './search.service';
describe('SearchService', () => {
let service: SearchService;
beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(SearchService);
});
it('should be created', () => {
expect(service).toBeTruthy();
});
});
+54
View File
@@ -0,0 +1,54 @@
import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Event } from '../models/event.model';
import { Observable } from 'rxjs';
import { environment } from 'src/environments/environment';
import { AuthService } from '../services/auth.service';
import { User } from '../models/user.model';
import { EventSearch } from "src/app/models/event-search";
@Injectable({
providedIn: 'root'
})
export class SearchService {
// state
authheader = {};
loggeduser: User;
headers: HttpHeaders;
categories= Array;
// setup
constructor(private http: HttpClient, user: AuthService) {
this.loggeduser = user.ValidatedUser;
this.headers = new HttpHeaders();
this.headers = this.headers.set('Authorization', this.loggeduser.BasicAuthKey);
}
basicSearch(subject:string, date:string, sender:string, organicEntity:string, docTypeId:string): Observable<EventSearch>{
// Endpoint
const geturl = environment.apiURL + 'search';
// store params
let params = new HttpParams();
// set https params
console.log(subject);
params = params.set("assunto", subject);
params = params.set("data", date);
params = params.set("remetente", sender);
params = params.set("entidadeOrganica", organicEntity);
params = params.set("docTypeId", docTypeId);
const options = {
headers: this.headers,
params: params
};
return this.http.get<EventSearch>(`${geturl}`, options);
}
}
+16
View File
@@ -0,0 +1,16 @@
import { TestBed } from '@angular/core/testing';
import { SenderService } from './sender.service';
describe('SenderService', () => {
let service: SenderService;
beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(SenderService);
});
it('should be created', () => {
expect(service).toBeTruthy();
});
});
+9
View File
@@ -0,0 +1,9 @@
import { Injectable } from '@angular/core';
@Injectable({
providedIn: 'root'
})
export class SenderService {
constructor() { }
}
-2
View File
@@ -24,6 +24,4 @@ export class HeaderPage implements OnInit {
return await modal.present();
}
}
@@ -0,0 +1,19 @@
<svg xmlns="http://www.w3.org/2000/svg" width="45" height="45" viewBox="0 0 45 45">
<g fill="none" fill-rule="evenodd">
<g>
<g transform="translate(-337 -26) translate(337 26)">
<circle cx="22.5" cy="22.5" r="22.5" fill="#FFB703"/>
<g>
<g stroke="#061B52" stroke-width="2" transform="translate(11 11) translate(6)">
<circle cx="7.714" cy="7.714" r="6.714"/>
<path stroke-linecap="round" d="M12.857 12.857L17.357 17.357"/>
</g>
<g fill="#061B52" transform="translate(11 11) translate(.857 15.857)">
<rect width="2" height="8" x="3" rx="1"/>
<rect width="8" height="2" y="3" rx="1"/>
</g>
</g>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 886 B

@@ -0,0 +1,21 @@
<svg xmlns="http://www.w3.org/2000/svg" width="25" height="25" viewBox="0 0 25 25">
<defs>
<filter id="up2p1o8sza">
<feColorMatrix in="SourceGraphic" values="0 0 0 0 0.476308 0 0 0 0 0.476308 0 0 0 0 0.476308 0 0 0 1.000000 0"/>
</filter>
</defs>
<g fill="none" fill-rule="evenodd">
<g>
<g>
<g filter="url(#up2p1o8sza)" transform="translate(-46 -105) translate(16 64) translate(20 31)">
<g>
<g stroke="#42B9FE" stroke-width="2" transform="translate(10 10) translate(5 5)">
<rect width="14" height="15" rx="2"/>
<path d="M1 5H14V6H1zM10 8H11V9H10zM7 8H8V9H7zM7 11H8V12H7zM10 11H11V12H10zM4 8H5V9H4zM4 11H5V12H4z"/>
</g>
</g>
</g>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 911 B

@@ -0,0 +1,18 @@
<svg xmlns="http://www.w3.org/2000/svg" width="25" height="25" viewBox="0 0 25 25">
<defs>
<filter id="pug9jz8f1a">
<feColorMatrix in="SourceGraphic" values="0 0 0 0 0.476308 0 0 0 0 0.476308 0 0 0 0 0.476308 0 0 0 1.000000 0"/>
</filter>
</defs>
<g fill="none" fill-rule="evenodd" stroke-linejoin="round">
<g>
<g>
<g filter="url(#pug9jz8f1a)" transform="translate(-46 -225) translate(16 64) translate(20 151)">
<g>
<path stroke="#42B9FE" stroke-width="2" d="M12.5 4C14.985 4 17 6.015 17 8.5c0 1.42-.658 2.687-1.685 3.511 2.903 1.13 4.963 3.952 4.963 7.257 0 4.296-15.556 4.296-15.556 0 0-3.305 2.06-6.128 4.967-7.255C8.658 11.187 8 9.92 8 8.5 8 6.015 10.015 4 12.5 4z" transform="translate(10 10)"/>
</g>
</g>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 913 B

@@ -0,0 +1,19 @@
<svg xmlns="http://www.w3.org/2000/svg" width="25" height="25" viewBox="0 0 25 25">
<defs>
<filter id="mwy495cifa">
<feColorMatrix in="SourceGraphic" values="0 0 0 0 0.476308 0 0 0 0 0.476308 0 0 0 0 0.476308 0 0 0 1.000000 0"/>
</filter>
</defs>
<g fill="none" fill-rule="evenodd" stroke-linejoin="round">
<g>
<g>
<g filter="url(#mwy495cifa)" transform="translate(-46 -285) translate(16 64) translate(20 211)">
<g stroke="#42B9FE" stroke-width="2">
<path d="M13 10c-1.657 0-3 1.343-3 3 0 .88.379 1.671.982 2.22C8.683 15.895 7 18.074 7 20.657c0 3.124 11 3.124 11 0 0-2.32-1.358-4.314-3.3-5.186.785-.54 1.3-1.445 1.3-2.471 0-1.657-1.343-3-3-3z" transform="translate(10 10)"/>
<path stroke-linecap="round" d="M11 3.563C10.426 2.624 9.407 2 8.246 2 6.453 2 5 3.487 5 5.322v.064c0 1.06.743 2.506 1.5 3.114M5.622 15C4.094 14.632 3 13.983 3 13.053c0-2.31 1.346-3.707 3.5-4.553M14 3.563C14.574 2.624 15.593 2 16.754 2 18.547 2 20 3.487 20 5.322v.064c0 1.06-.743 2.506-1.5 3.114m.878 6.5C20.906 14.632 22 13.983 22 13.053c0-2.31-1.346-3.707-3.5-4.553" transform="translate(10 10)"/>
</g>
</g>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

@@ -0,0 +1,11 @@
<svg xmlns="http://www.w3.org/2000/svg" width="25" height="25" viewBox="0 0 25 25">
<g fill="none" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round">
<g stroke="#42B9FE" stroke-width="2">
<g>
<g>
<path d="M15.5 7.5L9.5 13 15.5 18.5" transform="translate(-345 -413) translate(20 403) translate(325 10) rotate(90 12.5 13)"/>
</g>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 467 B