mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 12:37:53 +00:00
Improve search select document from searh
This commit is contained in:
@@ -220,8 +220,8 @@
|
||||
</div>
|
||||
</div>
|
||||
</ion-content>
|
||||
<ion-footer class="ion-no-border d-flex justify-center">
|
||||
<ion-toolbar class="btn-div ">
|
||||
<ion-footer class="ion-no-border d-flex justify-center px-20">
|
||||
<ion-toolbar class=" ">
|
||||
<ion-buttons slot="start">
|
||||
<ion-button class="btn-cancel" fill="clear" color="#061b52" (click)="close()">
|
||||
<ion-label>Cancelar</ion-label>
|
||||
|
||||
@@ -18,7 +18,6 @@ ion-content{
|
||||
transform: translate3d(0, 1px, 0);
|
||||
|
||||
.title-content{
|
||||
padding: 0px 20px;
|
||||
margin: 0px auto;
|
||||
overflow: auto;
|
||||
background: #fff;
|
||||
|
||||
@@ -5,6 +5,7 @@ import { EventPerson } from 'src/app/models/eventperson.model';
|
||||
import { EventsService } from 'src/app/services/events.service';
|
||||
import { Event } from '../../../models/event.model';
|
||||
import { AttendeesPage } from '../../events/attendees/attendees.page';
|
||||
import { SearchPage } from '../../search/search.page';
|
||||
|
||||
@Component({
|
||||
selector: 'app-new-event',
|
||||
@@ -43,7 +44,7 @@ export class NewEventPage implements OnInit {
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
console.log(this.profile);
|
||||
/* console.log(this.profile); */
|
||||
|
||||
let selectedStartdDate = this.selectedDate;
|
||||
let selectedEndDate = new Date(this.selectedDate);
|
||||
@@ -118,6 +119,8 @@ export class NewEventPage implements OnInit {
|
||||
this.modalController.dismiss(this.postEvent);
|
||||
}
|
||||
|
||||
|
||||
|
||||
async openAttendees() {
|
||||
const modal = await this.modalController.create({
|
||||
component: AttendeesPage,
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<ion-item-group>
|
||||
<ion-list>
|
||||
<ion-item-sliding>
|
||||
<ion-item *ngFor="let attendee of contacts">
|
||||
<ion-item lines="none" *ngFor="let attendee of contacts">
|
||||
<ion-checkbox slot="end" (ionChange)="selectContact(attendee)"></ion-checkbox><!-- [disabled]="isCheckboxDisabled" -->
|
||||
<ion-label>
|
||||
<h3>{{ attendee.Name }}</h3>
|
||||
|
||||
@@ -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'
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import { EventsService } from 'src/app/services/events.service';
|
||||
import { Event } from 'src/app/models/event.model';
|
||||
import { AlertController } from '@ionic/angular';
|
||||
import { removeDuplicate } from 'src/plugin/removeDuplicate.js'
|
||||
import { SearchPage } from 'src/app/pages/search/search.page';
|
||||
@Component({
|
||||
selector: 'app-edit-event',
|
||||
templateUrl: './edit-event.component.html',
|
||||
@@ -90,6 +91,9 @@ export class EditEventComponent implements OnInit {
|
||||
this.deleteTemporaryData();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
async save(){
|
||||
|
||||
this.postEvent.Attendees = this.taskParticipants.concat(this.taskParticipantsCc);
|
||||
@@ -120,6 +124,7 @@ export class EditEventComponent implements OnInit {
|
||||
this.clearContact.emit();
|
||||
}
|
||||
|
||||
|
||||
async addParticipantsCc() {
|
||||
|
||||
this.saveTemporaryData();
|
||||
|
||||
@@ -44,11 +44,11 @@ export class EventListComponent implements OnInit {
|
||||
this.profile = 'PR'
|
||||
}
|
||||
|
||||
this.LoadToApproveEvents();
|
||||
// this.LoadToApproveEvents();
|
||||
|
||||
this.router.events.forEach((event) => {
|
||||
if(event instanceof NavigationEnd && event.url == this.router.url) {
|
||||
this.LoadToApproveEvents();
|
||||
// this.LoadToApproveEvents();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -183,26 +183,26 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div hidden class="ion-item-container-no-border">
|
||||
<div class="ion-item-container-no-border" (click)="getDoc()">
|
||||
<ion-label>
|
||||
<div class="attach-icon">
|
||||
<ion-icon src="assets/images/icons-attach-doc.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="attach-document">
|
||||
<ion-label>Anexar Documentos</ion-label>
|
||||
<ion-label>Adicionar documentos</ion-label>
|
||||
</div>
|
||||
</ion-label>
|
||||
</div>
|
||||
|
||||
<div hidden>
|
||||
<ion-item>
|
||||
<ion-label>Documentos Anexados</ion-label>
|
||||
</ion-item>
|
||||
<div *ngFor="let document of documents" >
|
||||
<ion-list>
|
||||
<ion-item>
|
||||
<ion-label>
|
||||
<h4 class="attach-title-item">Text</h4>
|
||||
<p><span class="span-left">Text</span><span class="span-right"> Text </span></p>
|
||||
<p class="d-flex ion-justify-content-between">
|
||||
<span class="attach-title-item">{{document.Assunto}}</span>
|
||||
<span class="app-name">{{document.appName}}</span>
|
||||
</p>
|
||||
<p><span class="span-left">{{document.EntidadeOrganicaNome}}</span><span class="span-right"> {{document.Data}} </span></p>
|
||||
</ion-label>
|
||||
</ion-item>
|
||||
</ion-list>
|
||||
|
||||
@@ -176,4 +176,22 @@ ion-content{
|
||||
ion-textarea{
|
||||
height: 81px;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.app-name{
|
||||
background: #42b9f2;
|
||||
border-radius: 18px;
|
||||
text-align: center;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 0px 5px;
|
||||
color: white;
|
||||
font-size: 9pt;
|
||||
font-weight: 500;
|
||||
height: 19px;
|
||||
-webkit-border-radius: 18px;
|
||||
-moz-border-radius: 18px;
|
||||
-ms-border-radius: 18px;
|
||||
-o-border-radius: 18px;
|
||||
}
|
||||
@@ -5,6 +5,8 @@ import { EventsService } from 'src/app/services/events.service';
|
||||
import { Event } from 'src/app/models/event.model';
|
||||
import { ModalController } from '@ionic/angular';
|
||||
import { removeDuplicate } from 'src/plugin/removeDuplicate.js'
|
||||
import { SearchPage } from 'src/app/pages/search/search.page';
|
||||
import { SearchDocument } from "src/app/models/search-document";
|
||||
@Component({
|
||||
selector: 'app-new-event',
|
||||
templateUrl: './new-event.component.html',
|
||||
@@ -33,6 +35,8 @@ export class NewEventPage implements OnInit {
|
||||
@Output() GoBackEditOrAdd = new EventEmitter<any>();
|
||||
@Output() cloneAllmobileComponent = new EventEmitter<any>();
|
||||
|
||||
documents:SearchDocument[] = [];
|
||||
|
||||
minDate: string;
|
||||
|
||||
constructor(
|
||||
@@ -121,6 +125,23 @@ export class NewEventPage implements OnInit {
|
||||
|
||||
}
|
||||
|
||||
async getDoc(){
|
||||
const modal = await this.modalController.create({
|
||||
component: SearchPage,
|
||||
cssClass: 'group-messages modal-desktop search-modal search-modal-to-desktop',
|
||||
componentProps: {
|
||||
type: 'AccoesPresidenciais & ArquivoDespachoElect'
|
||||
}
|
||||
});
|
||||
await modal.present();
|
||||
modal.onDidDismiss().then((res)=>{
|
||||
if(res){
|
||||
const data = res.data;
|
||||
this.documents.push(data.selected);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
close(){
|
||||
|
||||
this.deleteTemporaryData();
|
||||
@@ -131,6 +152,8 @@ export class NewEventPage implements OnInit {
|
||||
this.setIntervenientCC.emit([]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
save(){
|
||||
|
||||
this.postEvent.Attendees = this.taskParticipants.concat(this.taskParticipantsCc);
|
||||
|
||||
Reference in New Issue
Block a user