Skip to content
Snippets Groups Projects
Commit 73eb44cf authored by Névisson Gonçalves's avatar Névisson Gonçalves
Browse files

Merge branch 'RS' of https://gitlab.com/hugoleonardo/simcaq-ui into RS

parents ba4d6d35 7810b374
No related branches found
No related tags found
1 merge request!1v1
...@@ -20,7 +20,11 @@ ...@@ -20,7 +20,11 @@
projection.sourceInformations[0].indice : ''}})</sup></th> projection.sourceInformations[0].indice : ''}})</sup></th>
<th>Oferta atual <sup>({{projection.sourceInformations ? projection.sourceInformations[1].indice : <th>Oferta atual <sup>({{projection.sourceInformations ? projection.sourceInformations[1].indice :
''}})</sup></th> ''}})</sup></th>
<th [colSpan]="data.years.length">Projeção da oferta</th> <th [colSpan]="data.years.length">
<span [class.projection-title]="disabledData" [popover]="popoverText" placement="bottom"
container="body" [triggers]="popoverTriggers" [isOpen]="disabledData"
containerClass="popover-simcaq result">Projeção da oferta</span>
</th>
</tr> </tr>
<tr> <tr>
<th>{{data.offerYear}}</th> <th>{{data.offerYear}}</th>
...@@ -60,7 +64,7 @@ ...@@ -60,7 +64,7 @@
[(ngModel)]="enrollment.quantity" (keyup)="calculateTotals(projection)" maxlength="13" [(ngModel)]="enrollment.quantity" (keyup)="calculateTotals(projection)" maxlength="13"
currencyMask currencyMask
[options]="{ prefix: '', align: 'right', precision: 0, thousands: '.', decimal: ',' }" [options]="{ prefix: '', align: 'right', precision: 0, thousands: '.', decimal: ',' }"
[disabled]="disableOfferProjection()"> [disabled]="disabledData">
<input type="text" disabled class="form-control enrollment-quantity" <input type="text" disabled class="form-control enrollment-quantity"
*ngIf="!showEnrollmentQuantity(projection.periods[0], stageEnrollments.id)"> *ngIf="!showEnrollmentQuantity(projection.periods[0], stageEnrollments.id)">
......
...@@ -9,6 +9,10 @@ ...@@ -9,6 +9,10 @@
min-width: 70px; min-width: 70px;
} }
.projection-title {
cursor: pointer;
}
.relative-projection { .relative-projection {
background-color: #ebf0f3; background-color: #ebf0f3;
font-weight: bold; font-weight: bold;
......
import { Component, Injector } from '@angular/core'; import { Component, Injector, OnInit } from '@angular/core';
import { Observable, Subject } from 'rxjs'; import { Observable, Subject } from 'rxjs';
import { takeUntil, debounceTime } from 'rxjs/operators'; import { takeUntil, debounceTime } from 'rxjs/operators';
...@@ -19,11 +19,15 @@ import { SelectLocation } from 'app/simulator/select-location/entities/select-lo ...@@ -19,11 +19,15 @@ import { SelectLocation } from 'app/simulator/select-location/entities/select-lo
templateUrl: './enrollment-by-stage-series.component.html', templateUrl: './enrollment-by-stage-series.component.html',
styleUrls: ['./enrollment-by-stage-series.component.scss'] styleUrls: ['./enrollment-by-stage-series.component.scss']
}) })
export class EnrollmentByStageSeriesComponent extends BaseNavigableComponent<EnrollmentByStageSeries> { export class EnrollmentByStageSeriesComponent extends BaseNavigableComponent<EnrollmentByStageSeries> implements OnInit {
data: EnrollmentByStageSeries = new EnrollmentByStageSeries(); data: EnrollmentByStageSeries = new EnrollmentByStageSeries();
functionality: FunctionalityInfo = Functionality.enrollmentByStageAndSeries; functionality: FunctionalityInfo = Functionality.enrollmentByStageAndSeries;
inconsistencies: Array<Inconsistency>; inconsistencies: Array<Inconsistency>;
disabledData: boolean = true;
popoverTriggers: string;
popoverText: string = 'Esses parâmetros só podem ser alterados para simulações em nível municipal. ' +
'Para simulações em nível nacional ou estadual, são apresentados resultados dos valores municipais agregados internamente pelo simulador.';
private calculateTotalsSubject: Subject<Projection> = new Subject<Projection>(); private calculateTotalsSubject: Subject<Projection> = new Subject<Projection>();
private calculateTotalsObserver: Observable<Projection> = this.calculateTotalsSubject.asObservable(); private calculateTotalsObserver: Observable<Projection> = this.calculateTotalsSubject.asObservable();
...@@ -32,6 +36,11 @@ export class EnrollmentByStageSeriesComponent extends BaseNavigableComponent<Enr ...@@ -32,6 +36,11 @@ export class EnrollmentByStageSeriesComponent extends BaseNavigableComponent<Enr
super(injector); super(injector);
} }
ngOnInit(): void {
super.ngOnInit();
this.processDisabledData();
}
processData(): Observable<EnrollmentByStageSeries> { processData(): Observable<EnrollmentByStageSeries> {
return this.enrollmentByStageSeriesService.getData(); return this.enrollmentByStageSeriesService.getData();
} }
...@@ -76,9 +85,12 @@ export class EnrollmentByStageSeriesComponent extends BaseNavigableComponent<Enr ...@@ -76,9 +85,12 @@ export class EnrollmentByStageSeriesComponent extends BaseNavigableComponent<Enr
return period !== Period.nocturnal || (stage !== nursery && stage !== preSchool); return period !== Period.nocturnal || (stage !== nursery && stage !== preSchool);
} }
disableOfferProjection(): boolean { processDisabledData(): void {
const selectLocationData: SelectLocation = this.sessionService.getItem<SelectLocation>(Functionality.selectLocation.key);
return (this.sessionService.getItem<SelectLocation>(Functionality.selectLocation.key).selectedCity === undefined) ? true : false; this.disabledData = !selectLocationData || !selectLocationData.selectedCity;
if (this.disabledData) {
this.popoverTriggers = 'mouseenter:mouseleave';
}
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment