- -
-
-
-
-

Relatório

- 10 -
-
-

Relatório

- 10 -
-
-

Relatório

- 10 -
-
-

Relatório

- 10 -
-
-

Relatório

- 10 -
-
-

Relatório

- 10 + + - +
+ +
+ +
+
+ + +
  • +
    + +
    +
    + +
    + +
    +
    +
  • -
    + +
    +
    +
    + + + +
    +

    {{ category.Name }}

    + {{ category.Qtd }} +
    +
    +
    +
    + + +
    +
    + +
    -
    -

    Palavas mais pesquisdas

    +
    +

    Palavras mais pesquisadas

    +
    - -
    + +
    -

    Order por:Mais Recente

    +

    + Order por: + Mais Recente + Mais Antigo +

    - + +
      -
    • +
    • -

      title

      +

      {{ searchDocument.Assunto}}

      - MINEC, MINFIN - 13/04/2020 -
      -
      -
    • -
    • -
      - -
      -
      -

      title

      -
      - MINEC, MINFIN - 13/04/2020 -
      -
      -
    • -
    • -
      - -
      -
      -

      title

      -
      - MINEC, MINFIN - 13/04/2020 -
      -
      -
    • -
    • -
      - -
      -
      -

      title

      -
      - MINEC, MINFIN - 13/04/2020 -
      -
      -
    • -
    • -
      - -
      -
      -

      title

      -
      - MINEC, MINFIN - 13/04/2020 + {{ searchDocument.EntidadeOrganicaNome }} + {{ formateIsoDate(searchDocument.Data) }}
    • @@ -144,4 +132,4 @@
    - + \ No newline at end of file diff --git a/src/app/pages/search/search.page.scss b/src/app/pages/search/search.page.scss index df087037b..3262d2a75 100644 --- a/src/app/pages/search/search.page.scss +++ b/src/app/pages/search/search.page.scss @@ -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{ + + } } diff --git a/src/app/pages/search/search.page.ts b/src/app/pages/search/search.page.ts index a20587ad8..ba7165846 100644 --- a/src/app/pages/search/search.page.ts +++ b/src/app/pages/search/search.page.ts @@ -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; + } +} \ No newline at end of file diff --git a/src/app/pages/search/sender/sender-routing.module.ts b/src/app/pages/search/sender/sender-routing.module.ts new file mode 100644 index 000000000..07ce353dd --- /dev/null +++ b/src/app/pages/search/sender/sender-routing.module.ts @@ -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 {} diff --git a/src/app/pages/search/sender/sender.module.ts b/src/app/pages/search/sender/sender.module.ts new file mode 100644 index 000000000..d20c632b0 --- /dev/null +++ b/src/app/pages/search/sender/sender.module.ts @@ -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 {} diff --git a/src/app/pages/search/sender/sender.page.html b/src/app/pages/search/sender/sender.page.html new file mode 100644 index 000000000..928716704 --- /dev/null +++ b/src/app/pages/search/sender/sender.page.html @@ -0,0 +1,23 @@ + + +
    + +
    + + + Remetentes + +
    + + +
    +
    + +
    +
      +
    • + {{ contact.Name }} +
    • +
    +
    +
    diff --git a/src/app/pages/search/sender/sender.page.scss b/src/app/pages/search/sender/sender.page.scss new file mode 100644 index 000000000..abda67839 --- /dev/null +++ b/src/app/pages/search/sender/sender.page.scss @@ -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; + } + } +} \ No newline at end of file diff --git a/src/app/pages/search/sender/sender.page.spec.ts b/src/app/pages/search/sender/sender.page.spec.ts new file mode 100644 index 000000000..763d17dc8 --- /dev/null +++ b/src/app/pages/search/sender/sender.page.spec.ts @@ -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; + + 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(); + }); +}); diff --git a/src/app/pages/search/sender/sender.page.ts b/src/app/pages/search/sender/sender.page.ts new file mode 100644 index 000000000..be9e73763 --- /dev/null +++ b/src/app/pages/search/sender/sender.page.ts @@ -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); + } + +} diff --git a/src/app/services/organic-entity.service.spec.ts b/src/app/services/organic-entity.service.spec.ts new file mode 100644 index 000000000..29bef2e16 --- /dev/null +++ b/src/app/services/organic-entity.service.spec.ts @@ -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(); + }); +}); diff --git a/src/app/services/organic-entity.service.ts b/src/app/services/organic-entity.service.ts new file mode 100644 index 000000000..42f036475 --- /dev/null +++ b/src/app/services/organic-entity.service.ts @@ -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{ + + const geturl = environment.apiURL + 'ecm/organic'; + + let options = { + headers: this.headers, + }; + + return this.http.get(`${geturl}`, options); + } +} diff --git a/src/app/services/search.service.spec.ts b/src/app/services/search.service.spec.ts new file mode 100644 index 000000000..23c42c7bb --- /dev/null +++ b/src/app/services/search.service.spec.ts @@ -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(); + }); +}); diff --git a/src/app/services/search.service.ts b/src/app/services/search.service.ts new file mode 100644 index 000000000..63b5312e6 --- /dev/null +++ b/src/app/services/search.service.ts @@ -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{ + // 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(`${geturl}`, options); + } + +} diff --git a/src/app/services/sender.service.spec.ts b/src/app/services/sender.service.spec.ts new file mode 100644 index 000000000..383816b4c --- /dev/null +++ b/src/app/services/sender.service.spec.ts @@ -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(); + }); +}); diff --git a/src/app/services/sender.service.ts b/src/app/services/sender.service.ts new file mode 100644 index 000000000..cf50b23db --- /dev/null +++ b/src/app/services/sender.service.ts @@ -0,0 +1,9 @@ +import { Injectable } from '@angular/core'; + +@Injectable({ + providedIn: 'root' +}) +export class SenderService { + + constructor() { } +} diff --git a/src/app/shared/header/header.page.ts b/src/app/shared/header/header.page.ts index 4a94f20ca..6ad2ac28a 100644 --- a/src/app/shared/header/header.page.ts +++ b/src/app/shared/header/header.page.ts @@ -24,6 +24,4 @@ export class HeaderPage implements OnInit { return await modal.present(); } - - } diff --git a/src/assets/images/advance-search-show-modal.svg b/src/assets/images/advance-search-show-modal.svg new file mode 100644 index 000000000..3a60de7ff --- /dev/null +++ b/src/assets/images/advance-search-show-modal.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/src/assets/images/icons-advance-search-document.svg b/src/assets/images/icons-advance-search-document.svg new file mode 100644 index 000000000..820bc7412 --- /dev/null +++ b/src/assets/images/icons-advance-search-document.svg @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/src/assets/images/icons-advance-search-sender.svg b/src/assets/images/icons-advance-search-sender.svg new file mode 100644 index 000000000..f3ae89ced --- /dev/null +++ b/src/assets/images/icons-advance-search-sender.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/src/assets/images/icons-arrow-arrow-down-25-copy.svg b/src/assets/images/icons-arrow-arrow-down-25-copy.svg new file mode 100644 index 000000000..ce99378c5 --- /dev/null +++ b/src/assets/images/icons-arrow-arrow-down-25-copy.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/src/assets/images/icons-arrow-arrow-up.svg b/src/assets/images/icons-arrow-arrow-up.svg new file mode 100644 index 000000000..cce793713 --- /dev/null +++ b/src/assets/images/icons-arrow-arrow-up.svg @@ -0,0 +1,11 @@ + + + + + + + + + + +