Browse Source

add date

master
drfelfel 1 year ago
parent
commit
700dee91a1
2 changed files with 49 additions and 12 deletions
  1. +46
    -10
      src/routes/panel/volunteer/table/table.component.html
  2. +3
    -2
      src/routes/panel/volunteer/table/table.component.ts

+ 46
- 10
src/routes/panel/volunteer/table/table.component.html View File

@ -13,9 +13,12 @@
<mat-option value="فعلی"> فعلی </mat-option>
</mat-select>
</mat-form-field>
<mat-form-field appearance="outline" >
<mat-form-field appearance="outline">
<mat-label>جستجو بر اساس فیلد</mat-label>
<mat-select [(ngModel)]="searchBy" (selectionChange)="Get($event, 'search')">
<mat-select
[(ngModel)]="searchBy"
(selectionChange)="Get($event, 'search')"
>
<mat-option value="name"> نام </mat-option>
<mat-option value="lastname"> نام خانوادگی </mat-option>
<mat-option value="nationalcode"> کد ملی </mat-option>
@ -23,7 +26,6 @@
<mat-option value="step"> مرحله </mat-option>
<mat-option value="militaryserviceStatus"> نظام وظیفه </mat-option>
</mat-select>
</mat-form-field>
<mat-form-field appearance="outline">
@ -58,29 +60,58 @@
<td mat-cell *matCellDef="let element">{{ element.firstname }}</td>
</ng-container>
<ng-container matColumnDef="lastname">
<th mat-header-cell *matHeaderCellDef mat-sort-header="lastname">نام خانوادگی</th>
<th mat-header-cell *matHeaderCellDef mat-sort-header="lastname">
نام خانوادگی
</th>
<td mat-cell *matCellDef="let element">{{ element.lastname }}</td>
</ng-container>
<ng-container matColumnDef="fathername">
<th mat-header-cell *matHeaderCellDef mat-sort-header="fathername">نام پدر</th>
<th mat-header-cell *matHeaderCellDef mat-sort-header="fathername">
نام پدر
</th>
<td mat-cell *matCellDef="let element">{{ element.fathername }}</td>
</ng-container>
<ng-container matColumnDef="major">
<th mat-header-cell *matHeaderCellDef mat-sort-header="major">رشته قبولی</th>
<th mat-header-cell *matHeaderCellDef mat-sort-header="major">
رشته قبولی
</th>
<td mat-cell *matCellDef="let element">{{ element.major }}</td>
</ng-container>
<ng-container matColumnDef="nationalcode">
<th mat-header-cell *matHeaderCellDef mat-sort-header="nationalcode">کد ملی</th>
<th mat-header-cell *matHeaderCellDef mat-sort-header="nationalcode">
کد ملی
</th>
<td mat-cell *matCellDef="let element">{{ element.nationalcode }}</td>
</ng-container>
<ng-container matColumnDef="militaryserviceStatus">
<th mat-header-cell *matHeaderCellDef mat-sort-header="militaryserviceStatus">وضعیت نظام وظیفه</th>
<td mat-cell *matCellDef="let element">{{ element.militaryserviceStatus?element.militaryserviceStatus:'کاربر هنوز وارد این مرحله نشده است' }}</td>
<th
mat-header-cell
*matHeaderCellDef
mat-sort-header="militaryserviceStatus"
>
وضعیت نظام وظیفه
</th>
<td mat-cell *matCellDef="let element">
{{
element.militaryserviceStatus
? element.militaryserviceStatus
: "کاربر هنوز وارد این مرحله نشده است"
}}
</td>
</ng-container>
<ng-container matColumnDef="step">
<th mat-header-cell *matHeaderCellDef mat-sort-header="step">مرحله</th>
<td mat-cell *matCellDef="let element">{{ element.step }}</td>
</ng-container>
<ng-container matColumnDef="done">
<th mat-header-cell *matHeaderCellDef mat-sort-header="step">
تاریخ مراجعه حضوری
</th>
<td mat-cell *matCellDef="let element">
{{ element.done ? element.done : "هنوز نوبت نگرفته است" }}
</td>
</ng-container>
<ng-container matColumnDef="options">
<th mat-header-cell *matHeaderCellDef style="width: 25px"></th>
<td mat-cell *matCellDef="let element" style="width: 25px">
@ -98,7 +129,12 @@
<tr mat-header-row *matHeaderRowDef="columns"></tr>
<tr mat-row *matRowDef="let row; columns: columns"></tr>
</table>
<mat-paginator [length]="size" [pageSize]="10" [pageSizeOptions]=[10,20,30] (page)="Get($event)">
<mat-paginator
[length]="size"
[pageSize]="10"
[pageSizeOptions]="[10, 20, 30]"
(page)="Get($event)"
>
</mat-paginator>
</ng-container>
</mat-card>

+ 3
- 2
src/routes/panel/volunteer/table/table.component.ts View File

@ -3,7 +3,7 @@ import { MatTableDataSource } from '@angular/material/table';
import { type } from 'os';
import { Excel } from '../../../../services/excel/excel.service';
import { Rayconnect } from '../../../../services/rayconnect/rayconnect.service';
import * as moment from 'jalali-moment'
@Component({
selector: 'app-table',
templateUrl: './table.component.html',
@ -11,7 +11,7 @@ import { Rayconnect } from '../../../../services/rayconnect/rayconnect.service';
})
export class TableComponent implements OnInit {
public columns: string[] = ['firstname', 'lastname', 'fathername', 'major', 'nationalcode', 'militaryserviceStatus', 'step', 'options'];
public columns: string[] = ['firstname', 'lastname', 'fathername', 'major', 'nationalcode', 'militaryserviceStatus', 'step','done', 'options'];
public data: MatTableDataSource<object> = new MatTableDataSource<object>();
public loading: boolean = false;
public search: string = '';
@ -45,6 +45,7 @@ export class TableComponent implements OnInit {
user.step = list[i]['step']
user.options = true
user.uid = list[i]['uid']
user.done = moment(user.done).format("jYYYY/jMM/jDD")
user.major = list[i]["educationalInformation"]["major"]

Loading…
Cancel
Save