Commit 46bb7d7f authored by Open Source Developer's avatar Open Source Developer
Browse files

Merge branch 'viewdirector' of https://git.minedu.gov.gr/akatsi/e-epal into viewdirector

parents ab12c6a1 40277cda
import { Component, OnInit, OnDestroy,ElementRef, NgZone, ViewChild} from "@angular/core"; import { Component, OnInit, OnDestroy,ElementRef, ViewChild} from "@angular/core";
import { Injectable } from "@angular/core"; import { Injectable } from "@angular/core";
import { AppSettings } from '../../app.settings'; import { AppSettings } from '../../app.settings';
import { HelperDataService } from '../../services/helper-data-service'; import { HelperDataService } from '../../services/helper-data-service';
...@@ -21,33 +21,33 @@ import { ...@@ -21,33 +21,33 @@ import {
selector: 'director-view', selector: 'director-view',
template: ` template: `
<form [formGroup]="formGroup">
<div class="form-group" >
<label for="name">Τάξη</label><br/> <label for="taxi">Τάξη</label><br/>
<select #txoption [(ngModel)]="taxi" [ngModelOptions]="{standalone: true}" (change)="verifyclass(txoption)" > <select #txoption [(ngModel)]="taxi" [ngModelOptions]="{standalone: false}" (ngModelChange)="verifyclass(txoption)" >
<option value="1" >Α' Λυκείου</option> <option value="1" >Α' Λυκείου</option>
<option value="2" >Β' Λυκείου</option> <option value="2" >Β' Λυκείου</option>
<option value="3" >Γ' Λυκείου</option> <option value="3" >Γ' Λυκείου</option>
</select> </select>
<div>
<div class="form-group" *ngIf="StudentSelected$ != {} || (verificationCodeVerified | async)" > <div *ngIf="StudentSelected$ != {} || (selectionBClass | async)" >
<label for="tomeas">Τομέας</label><br/> <label for="tomeas">Τομέας</label><br/>
<select #tmop [(ngModel)]="tomeas" [ngModelOptions]="{standalone: true}" (change) ="checkbclass(tmop,txoption)" > <select #tmop [(ngModel)]="tomeas" [ngModelOptions]="{standalone: false}" (ngModelChange) ="checkbclass(tmop,txoption)" >
<option *ngFor="let SectorSelection$ of StudentSelected$ | async" [ngValue]="SectorSelection$.id">{{SectorSelection$.sector_id}}</option> <option *ngFor="let SectorSelection$ of StudentSelected$ | async" [ngValue]="SectorSelection$.id">{{SectorSelection$.sector_id}}</option>
</select> </select>
<div> <div>
<div class="form-group" *ngIf="StudentSelectedSpecial$ != {}"> <div *ngIf="StudentSelectedSpecial$ != {} || (selectionCClass | async)">
<label for="special">Ειδικότητα</label><br/> <label for="special">Ειδικότητα</label><br/>
<select #spop [(ngModel)]="specialit" [ngModelOptions]="{standalone: true}" > <select #spop [(ngModel)]="specialit" [ngModelOptions]="{standalone: false}" >
<option *ngFor="let SpecialSelection$ of StudentSelectedSpecial$ | async" [ngValue]="SpecialSelection$.id">{{SpecialSelection$.specialty_id}}</option> <option *ngFor="let SpecialSelection$ of StudentSelectedSpecial$ | async" [ngValue]="SpecialSelection$.id">{{SpecialSelection$.specialty_id}}</option>
</select> </select>
<div> <div>
<button type="button" class="btn-primary btn-sm pull-right" (click)="findstudent()"> <button type="button" class="btn-primary btn-sm pull-right" (click)="findstudent(tmop,txoption)">
Αναζήτηση Αναζήτηση
</button> </button>
` `
}) })
...@@ -59,21 +59,22 @@ import { ...@@ -59,21 +59,22 @@ import {
private StudentSelectedSub: Subscription; private StudentSelectedSub: Subscription;
private StudentSelectedSpecial$: BehaviorSubject<any>; private StudentSelectedSpecial$: BehaviorSubject<any>;
private StudentSelectedSpecialSub: Subscription; private StudentSelectedSpecialSub: Subscription;
private verificationCodeVerified: BehaviorSubject<boolean>; private selectionAClass: BehaviorSubject<boolean>;
public bClassEnabled: boolean; private selectionBClass: BehaviorSubject<boolean>;
public gClassEnabled: boolean; private selectionCClass: BehaviorSubject<boolean>;
private SchoolId = 147 ; private SchoolId = 147 ;
constructor( private zone: NgZone, constructor( private fb: FormBuilder,
private fb: FormBuilder,
private _hds: HelperDataService, private _hds: HelperDataService,
private activatedRoute: ActivatedRoute, private activatedRoute: ActivatedRoute,
private router: Router ) private router: Router )
{ {
this.StudentSelected$ = new BehaviorSubject([{}]); this.StudentSelected$ = new BehaviorSubject([{}]);
this.StudentSelectedSpecial$ = new BehaviorSubject([{}]); this.StudentSelectedSpecial$ = new BehaviorSubject([{}]);
this.verificationCodeVerified = new BehaviorSubject(false); this.selectionAClass = new BehaviorSubject(false);
this.selectionBClass = new BehaviorSubject(false);
this.selectionCClass = new BehaviorSubject(false);
this.formGroup = this.fb.group({ this.formGroup = this.fb.group({
taxi:[], taxi:[],
tomeas: [], tomeas: [],
...@@ -93,13 +94,6 @@ import { ...@@ -93,13 +94,6 @@ import {
ngOnInit() { ngOnInit() {
this.bClassEnabled = false;
this.gClassEnabled = false;
console.log(this.StudentSelected$);
} }
...@@ -108,23 +102,21 @@ import { ...@@ -108,23 +102,21 @@ import {
{ {
console.log(txop.value); console.log(txop.value);
if (txop.value === "1") if (txop.value === "1")
{ {
this.zone.run(()=>this.verificationCodeVerified.next(false)); this.selectionBClass.next(false);
this.selectionCClass.next(false);
this.bClassEnabled = false;
this.gClassEnabled = false;
} }
else if (txop.value === "2") else if (txop.value === "2")
{ {
this.verificationCodeVerified.next(true); this.selectionBClass.next(true);
this.StudentSelectedSub = this._hds.getSectorPerSchool(this.SchoolId).subscribe(this.StudentSelected$); this.StudentSelectedSub = this._hds.getSectorPerSchool(this.SchoolId).subscribe(this.StudentSelected$);
console.log(txop.value,"aaaaaa");
this.bClassEnabled = true;
this.gClassEnabled = false;
} }
else if (txop.value === "3") else if (txop.value === "3")
{ this.bClassEnabled = true; {
this.gClassEnabled = true; this.selectionBClass.next(true);
this.selectionCClass.next(true);
this.StudentSelectedSub = this._hds.getSectorPerSchool(this.SchoolId).subscribe(this.StudentSelected$);
} }
} }
...@@ -136,18 +128,18 @@ import { ...@@ -136,18 +128,18 @@ import {
console.log(sectorint); console.log(sectorint);
if (txop.value === "3") if (txop.value === "3")
{ {
this.StudentSelectedSpecialSub = this._hds.getSpecialityPerSchool(this.SchoolId, sectorint).subscribe(this.StudentSelectedSpecial$); this.StudentSelectedSpecialSub = this._hds.getSpecialityPerSchool(this.SchoolId, sectorint).subscribe(this.StudentSelectedSpecial$);
this.findstudent(sectorint);
} }
} }
findstudent(sectorint) findstudent(tmop,txop)
{ {
{ const [id, sector] = tmop.value.split(': ');
var sectorint = +sector;
console.log(sectorint,"aaaaaa");
this.StudentSelectedSpecialSub = this._hds.getStudentPerSchool(this.SchoolId, sectorint).subscribe(this.StudentSelectedSpecial$); this.StudentSelectedSpecialSub = this._hds.getStudentPerSchool(this.SchoolId, sectorint).subscribe(this.StudentSelectedSpecial$);
}
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment