Browse Source

hi

master
drfelfel 1 year ago
parent
commit
88b288399b
4 changed files with 87 additions and 16 deletions
  1. +6
    -0
      src/routes/panel/volunteer/material.ts
  2. +34
    -6
      src/routes/panel/volunteer/table/table.component.html
  3. +4
    -5
      src/routes/panel/volunteer/table/table.component.scss
  4. +43
    -5
      src/routes/panel/volunteer/table/table.component.ts

+ 6
- 0
src/routes/panel/volunteer/material.ts View File

@ -14,6 +14,9 @@ import { MatSelectModule } from '@angular/material/select';
import { MatPaginatorModule, MatPaginatorIntl } from '@angular/material/paginator';
import {PersianMatPaginatorIntl} from './persianPage'
import { MatSortModule } from '@angular/material/sort';
import {MatExpansionModule} from '@angular/material/expansion'
import {MatChipsModule} from '@angular/material/chips'
const modules = [
MatCardModule,
MatInputModule,
@ -26,7 +29,10 @@ const modules = [
MatIconModule,
MatTableModule,
MatSelectModule,
MatChipsModule,
MatSortModule,
MatExpansionModule,
MatPaginatorModule
]

+ 34
- 6
src/routes/panel/volunteer/table/table.component.html View File

@ -6,13 +6,29 @@
</mat-toolbar>
<mat-card>
<mat-toolbar>
<mat-expansion-panel expanded>
<mat-expansion-panel-header>
<mat-panel-title>
<mat-icon style="margin-left: 5px">search</mat-icon>
فیلتر ها
</mat-panel-title>
<mat-panel-description> فیلتر ها و جستجو </mat-panel-description>
</mat-expansion-panel-header>
<mat-form-field appearance="outline">
<mat-label>آموزشکده</mat-label>
<mat-select>
<mat-select [(ngModel)]="university">
<mat-option value="فعلی"> فعلی </mat-option>
</mat-select>
</mat-form-field>
<mat-form-field appearance="outline">
<mat-label>مقطع</mat-label>
<mat-select [(ngModel)]="grade" (selectionChange)="Get($event)">
<mat-option value="کاردانی"> کاردانی </mat-option>
<mat-option value="کارشناسی"> کارشناسی </mat-option>
</mat-select>
</mat-form-field>
<mat-form-field appearance="outline">
<mat-label>جستجو بر اساس فیلد</mat-label>
<mat-select
@ -47,17 +63,24 @@
نتایج یافت شده : {{ this.size }}
</p>
<div class="flex-space"></div>
</mat-toolbar>
</mat-expansion-panel>
<mat-progress-bar
*ngIf="loading == true"
mode="indeterminate"
></mat-progress-bar>
<ng-container *ngIf="data != null">
<mat-divider></mat-divider>
<table matSort mat-table [dataSource]="data">
<table matSort mat-table [dataSource]="data" (matSortChange)="Get($event, 'sort')">
<ng-container matColumnDef="position">
<th mat-header-cell *matHeaderCellDef mat-sort-header>ردیف</th>
<td mat-cell *matCellDef="let element; let i = index">
{{ page * limit + i + 1 }}
</td>
</ng-container>
<ng-container matColumnDef="uid">
<th mat-header-cell *matHeaderCellDef mat-sort-header="uid">
شناسه سیستمی یا تلفن همراه
تلفن همراه
</th>
<td mat-cell *matCellDef="let element">{{ element.uid }}</td>
</ng-container>
@ -97,7 +120,12 @@
<ng-container matColumnDef="grade">
<th mat-header-cell *matHeaderCellDef mat-sort-header="grade">مقطع</th>
<td mat-cell *matCellDef="let element">{{ element.grade }}</td>
<td mat-cell *matCellDef="let element">
<b style="color: rgb(10, 8, 105);">
{{ element.grade }}
</b>
</td>
</ng-container>
<ng-container matColumnDef="done">

+ 4
- 5
src/routes/panel/volunteer/table/table.component.scss View File

@ -4,16 +4,15 @@ table {
mat-card {
mat-toolbar {
mat-expansion-panel {
margin-top: -16px;
margin-right: -16px;
width: calc(100% + 32px);
border-radius: 4px 4px 0 0;
padding-top: 16px;
div.flex-space {
flex: 1;
}
box-shadow: none;
mat-form-field {
font-size: 0.8rem;

+ 43
- 5
src/routes/panel/volunteer/table/table.component.ts View File

@ -11,14 +11,16 @@ import * as moment from 'jalali-moment'
})
export class TableComponent implements OnInit {
public columns: string[] = ['uid', 'firstname', 'lastname', 'fathername', 'major', 'grade', 'nationalcode', 'step', 'done', 'options'];
public columns: string[] = ['position', 'uid', 'firstname', 'lastname', 'fathername', 'major', 'grade', 'nationalcode', 'step', 'done', 'options'];
public data: MatTableDataSource<object> = new MatTableDataSource<object>();
public loading: boolean = false;
public search: string = '';
public size = 0;
public searchBy = "nationalcode";
public grade = "کاردانی";
public page = 0;
public uuid = "";
public university = "فعلی"
public filters = {
university: ""
@ -36,7 +38,7 @@ export class TableComponent implements OnInit {
}, (res => {
let list: object[] = res.data['list'];
let rendered = []
if (res.data['size']) {
if (res.data['size'] != undefined) {
this.size = res.data['size'];
}
for (let i in list) {
@ -128,17 +130,53 @@ export class TableComponent implements OnInit {
this.page = 0;
this.limit = 10;
Query['search'] = this.search
Query['searchBy'] = this.searchBy
}
Query = {
page: (this.page),
limit: this.limit,
search: this.search,
searchBy: this.searchBy
searchBy: this.searchBy,
grade: this.grade
}
if ((x == 'sort') && (e.direction != '')) {
switch (e.active) {
case 'name':
Query['sort'] = "information.firstname"
break;
case 'nationalcode':
Query['sort'] = "information.nationalcode"
break;
case 'lastname':
Query['sort'] = "information.lastname"
break;
case 'fathername':
Query['sort'] = "information.fathername"
case 'major':
Query['sort'] = "educationalInformation.major"
break;
case 'grade':
Query['sort'] = "educationalInformation.grade"
break;
case 'step':
Query['sort'] = "step"
break;
case 'done':
Query['sort'] = "done"
break;
default:
break;
}
Query['sortDirection'] = e.direction
}

Loading…
Cancel
Save