Browse Source

add tvu

master
drfelfel 1 year ago
parent
commit
3727aab699
2 changed files with 35 additions and 29 deletions
  1. +25
    -23
      src/routes/panel/dashboard/app/app.component.html
  2. +10
    -6
      src/routes/panel/dashboard/app/app.component.ts

+ 25
- 23
src/routes/panel/dashboard/app/app.component.html View File

@ -1,26 +1,4 @@
<div class="selector" *ngIf="false">
<mat-form-field appearance="outline">
<mat-label>انتخاب مرکز / دانشگاه</mat-label>
<mat-select [formControl]="universityControl">
<mat-option value="all">تمامی مراکز</mat-option>
<mat-optgroup
*ngFor="let group of univeristygroups"
[label]="group.name"
[disabled]="group.disabled"
>
<mat-option [value]="group.value"
>تمامی مراکز {{ group.name }}</mat-option
>
<mat-option
*ngFor="let university of group.universities"
[value]="university.value"
>
{{ university.viewValue }}
</mat-option>
</mat-optgroup>
</mat-select>
</mat-form-field>
</div>
<mat-expansion-panel expanded style="width:100%">
<mat-expansion-panel-header>
@ -32,6 +10,30 @@
<mat-panel-description> فیلتر ها و جستجو </mat-panel-description>
</mat-expansion-panel-header>
<div class="selector" *ngIf="uid == 'tvu'">
<mat-form-field appearance="outline">
<mat-label>انتخاب مرکز / دانشگاه</mat-label>
<mat-select [formControl]="universityControl">
<mat-option value="all">تمامی مراکز</mat-option>
<mat-optgroup
*ngFor="let group of univeristygroups"
[label]="group.name"
[disabled]="group.disabled"
>
<mat-option [value]="group.value"
>تمامی مراکز {{ group.name }}</mat-option
>
<mat-option
*ngFor="let university of group.universities"
[value]="university.value"
>
{{ university.viewValue }}
</mat-option>
</mat-optgroup>
</mat-select>
</mat-form-field>
</div>
<mat-form-field appearance="outline">
<mat-label>مقطع</mat-label>
<mat-select [(ngModel)]="grade" (selectionChange)="subscribe()" multiple>

+ 10
- 6
src/routes/panel/dashboard/app/app.component.ts View File

@ -32,17 +32,20 @@ export class AppComponent implements OnInit {
entry = ["مهر"]
majors = []
majorList = []
namespace = []
uid = ""
univeristygroups: UniversityGroup[] = [
{
name: 'مرکزی',
value: "markazi",
value: "fani.markazi",
universities: [
{ value: 'athar', viewValue: 'اطهر' },
{ value: 'amirkabir', viewValue: 'امیر کبیر' },
{ value: 'khomein', viewValue: 'دکتر حسابی خمین' },
{ value: 'saveh', viewValue: 'مرکز پسران ساوه' }
{ value: 'fani.markazi.arak.athar', viewValue: 'اطهر' },
{ value: 'fani.markazi.arak.amirkabir', viewValue: 'امیر کبیر' },
{ value: 'fani.markazi.khomein.pkhomein', viewValue: 'دکتر حسابی خمین' },
{ value: 'fani.markazi.saveh.psaveh', viewValue: 'مرکز پسران ساوه' }
]
}
@ -59,6 +62,7 @@ export class AppComponent implements OnInit {
constructor(private dialog: MatDialog, private rayconnect: Rayconnect, private snackbar: MatSnackBar) { }
ngOnInit(): void {
this.uid = this.rayconnect.user.uid
this.fetch();
Chart.defaults.global.defaultFontFamily = "Font"
@ -86,7 +90,7 @@ export class AppComponent implements OnInit {
console.log(res['data'])
if(this.majors.length == 0){
if (this.majors.length == 0) {
this.majorList = res['data']['majors']
}
let cachedMajorColor = this.RandomColor(res['data']['majors'].length, 'majors');

Loading…
Cancel
Save