Skip to content

Commit

Permalink
update ntvi
Browse files Browse the repository at this point in the history
  • Loading branch information
tharlestsa committed Oct 22, 2024
1 parent 31161d5 commit 099d9a8
Show file tree
Hide file tree
Showing 18 changed files with 35,242 additions and 605 deletions.
114 changes: 72 additions & 42 deletions src/client/src/app/@theme/components/filters/filters.componet.ts
Original file line number Diff line number Diff line change
@@ -1,55 +1,85 @@
import {Component} from '@angular/core';
import {NbWindowRef} from '@nebular/theme';
import { Component } from '@angular/core';
import { FormBuilder, FormGroup } from '@angular/forms';
import { NbWindowRef } from '@nebular/theme';
import {FilterService} from '../../../modules/campaign/service/filter.service';

@Component({
template: `
<div class="container-filter">
<nb-tabset fullWidth>
<nb-tab tabTitle="Ponto">
<div class="form-group">
<input type="number" ngModel="" nbInput fullWidth shape="rectangle" placeholder="Informe o número do ponto ...">
</div>
<button nbButton status="warning" hero> buscar ponto </button>
</nb-tab>
<nb-tab tabTitle="Filtros">
<nb-card>
<nb-card-header>Biomas</nb-card-header>
<nb-card-body>
<nb-select fullWidth selected="1">
<nb-option value="1">Option 1</nb-option>
<nb-option value="2">Option 2</nb-option>
</nb-select>
</nb-card-body>
</nb-card>
<nb-card>
<nb-card-header>Classes</nb-card-header>
<nb-card-body>
<nb-select fullWidth selected="1">
<nb-option value="1">Option 1</nb-option>
<nb-option value="2">Option 2</nb-option>
</nb-select>
</nb-card-body>
</nb-card>
<nb-card>
<nb-card-header>Estados</nb-card-header>
<nb-card-body>
<nb-select fullWidth selected="1">
<nb-option value="1">Option 1</nb-option>
<nb-option value="2">Option 2</nb-option>
</nb-select>
</nb-card-body>
</nb-card>
</nb-tab>
</nb-tabset>
<form fullWidth [formGroup]="form" (ngSubmit)="onSubmit()">
<nb-tabset fullWidth>
<nb-tab tabTitle="Ponto">
<div class="form-group">
<input
type="number"
nbInput
formControlName="pointId"
fullWidth
shape="rectangle"
placeholder="Informe o número do ponto ..."
/>
</div>
<button nbButton status="warning" hero type="submit">
Buscar Ponto
</button>
</nb-tab>
<nb-tab tabTitle="Filtros">
<nb-card>
<nb-card-header>Biomas</nb-card-header>
<nb-card-body>
<nb-select formControlName="selectedBiome" fullWidth>
<nb-option value="1">Biome 1</nb-option>
<nb-option value="2">Biome 2</nb-option>
</nb-select>
</nb-card-body>
</nb-card>
<nb-card>
<nb-card-header>Classes</nb-card-header>
<nb-card-body>
<nb-select formControlName="selectedClass" fullWidth>
<nb-option value="1">Class 1</nb-option>
<nb-option value="2">Class 2</nb-option>
</nb-select>
</nb-card-body>
</nb-card>
<nb-card>
<nb-card-header>Estados</nb-card-header>
<nb-card-body>
<nb-select formControlName="selectedState" fullWidth>
<nb-option value="1">State 1</nb-option>
<nb-option value="2">State 2</nb-option>
</nb-select>
</nb-card-body>
</nb-card>
</nb-tab>
</nb-tabset>
</form>
</div>
`,
styleUrls: ['filters.component.scss'],
})
export class FiltersComponent {
export class FiltersFormComponent {
form: FormGroup;

constructor(public windowRef: NbWindowRef) {
constructor(private fb: FormBuilder, public windowRef: NbWindowRef, private filterService: FilterService) {
// Inicializando o formulário com os campos para filtros
this.form = fb.group({
pointId: null,
selectedBiome: null,
selectedClass: null,
selectedState: null,
});
}

// Submissão do formulário, fechando a janela com os dados
onSubmit() {
if (this.form.valid) {
this.filterService.updateFilterData(this.form.value);
this.windowRef.close();
}
}
close() {
this.windowRef.close();
}
Expand Down
16 changes: 12 additions & 4 deletions src/client/src/app/@theme/theme.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
NbTooltipModule,
NbCheckboxModule,
NbCardModule,
NbTabsetModule, NbSpinnerModule,
NbTabsetModule, NbSpinnerModule, NbWindowModule,
} from '@nebular/theme';
import {NbEvaIconsModule} from '@nebular/eva-icons';
import {NbSecurityModule} from '@nebular/security';
Expand All @@ -29,7 +29,7 @@ import {
TinyMCEComponent,
DialogComponent,
StatusCardComponent,
FiltersComponent,
FiltersFormComponent,
BestImagesComponent,
MapLeafletComponent,
} from './components';
Expand All @@ -51,6 +51,7 @@ import {COSMIC_THEME} from './styles/theme.cosmic';
import {CORPORATE_THEME} from './styles/theme.corporate';
import {DARK_THEME} from './styles/theme.dark';
import {TranslateModule} from '@ngx-translate/core';
import {FormsModule, ReactiveFormsModule} from '@angular/forms';

const NB_MODULES = [
NbLayoutModule,
Expand Down Expand Up @@ -81,7 +82,7 @@ const COMPONENTS = [
TwoColumnsLayoutComponent,
DialogComponent,
StatusCardComponent,
FiltersComponent,
FiltersFormComponent,
BestImagesComponent,
MapLeafletComponent,
];
Expand All @@ -95,7 +96,14 @@ const PIPES = [
];

@NgModule({
imports: [CommonModule, ...NB_MODULES, NbCardModule, NbTabsetModule, NbSpinnerModule],
imports: [CommonModule,
...NB_MODULES,
NbCardModule,
NbTabsetModule,
NbSpinnerModule,
FormsModule,
ReactiveFormsModule,
],
entryComponents: [DialogComponent],
exports: [CommonModule, ...PIPES, ...COMPONENTS],
declarations: [...COMPONENTS, ...PIPES],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div class="row">
<div class="col-xxxl-3 col-xxl-4 col-lg-5 col-md-6">
<div class="header-point">
<h6 class="title-point" *ngIf="isDataAvailable"> {{'campaign_inspection_point_title' | translate:{current: info.id, total: info.total} }}</h6>
<h6 class="title-point" *ngIf="isDataAvailable"> {{'campaign_inspection_point_title' | translate:{current: point.id, total: point.total} }}</h6>
<span class="mt-1 mb-1 location">{{'campaign_inspection_location_title' | translate}}</span>
</div>
<!-- <ngx-ol-map *ngIf="isDataAvailable" [showBaseMapGoogle]="true" [showBaseMapsEsri]="false" [height]="'140px'"-->
Expand All @@ -14,11 +14,11 @@ <h6 class="title-point" *ngIf="isDataAvailable"> {{'campaign_inspection_point_ti
<div class="">
<label for="municipality" class="label">{{'campaign_inspection_field_municipality' | translate}}</label>
<input id="municipality" disabled fieldSize="tiny" type="text"
[value]="info.info | uppercase" nbInput fullWidth>
[value]="point.info | uppercase" nbInput fullWidth>
</div>
<div class="">
<label for="coordinate" class="label">{{'campaign_inspection_field_coordinate' | translate}}</label>
<input id="coordinate" disabled [value]="info.latitude + ' ' + info.longitude" fieldSize="tiny" type="text"
<input id="coordinate" disabled [value]="point.latitude + ' ' + point.longitude" fieldSize="tiny" type="text"
nbInput fullWidth>
</div>
</div>
Expand All @@ -29,13 +29,13 @@ <h6 class="title-point" *ngIf="isDataAvailable"> {{'campaign_inspection_point_ti
<button type="button" size="medium" status="danger" nbButton [disabled]="answers.length == 1" (click)="formSubtraction()">
<nb-icon icon="trash-2-outline"></nb-icon>
</button>
<button type="button" size="medium" status="success" nbButton [disabled]="answers[answers.length - 1].finalYear != login.campaign.finalYear" (click)="submitForm()">
<button type="button" size="medium" status="success" nbButton [disabled]="answers[answers.length - 1].finalYear != finalYear" (click)="submitForm()">
<nb-icon icon="save-outline"></nb-icon>
</button>
</div>
<nb-card size="tiny" *ngFor="let answer of answers; let i = index">
<nb-card-body class="classification">
<div class="row">
<div class="row" *ngIf="answer">
<div class="col-xxxl-6 col-xxl-6 col-lg-6 col-md-6">
<label class="label">{{'campaign_inspection_field_from' | translate}}</label>
<nb-select placeholder="" fullWidth filled size="small" [(selected)]="answer.initialYear" [disabled]="answers.length >= (i + 1)">
Expand All @@ -52,8 +52,8 @@ <h6 class="title-point" *ngIf="isDataAvailable"> {{'campaign_inspection_point_ti
<div class="row">
<div class="col-xxxl-12 col-xxl-12 col-lg-12 col-md-12">
<label class="label ">{{'campaign_inspection_field_class' | translate}}</label>
<nb-select fullWidth filled size="small" [(selected)]="answer.landUse" (selectedChange)="formPlus()">
<nb-option *ngFor="let class of login.campaign.landUse; let i = index" [value]="class">{{class}}</nb-option>
<nb-select fullWidth filled size="small" [(selected)]="answer.class" (selectedChange)="formPlus()">
<nb-option *ngFor="let class of campaign.classes; let i = index" [value]="class">{{class.name}}</nb-option>
</nb-select>
</div>
</div>
Expand Down Expand Up @@ -141,8 +141,10 @@ <h6 class="title-point" *ngIf="isDataAvailable"> {{'campaign_inspection_point_ti
<div class="col-xxxl-12 col-xxl-12 col-lg-12 col-md-12">
<nb-card [nbSpinner]="!isDataAvailableTimeSeries" size="tiny">
<nb-card-header>{{'campaign_inspection_point_landsat_title' | translate}}</nb-card-header>
<nb-card-body class="classification">
<chart *ngIf="isDataAvailableTimeSeries" type="line" [data]="dataChart" [options]="options"></chart>
<nb-card-body>
<div class="classification">
<chart *ngIf="isDataAvailableTimeSeries" [data]="dataChart" [options]="options" ></chart>
</div>
</nb-card-body>
</nb-card>
</div>
Expand Down
Loading

0 comments on commit 099d9a8

Please sign in to comment.