70 lines
2.9 KiB
HTML
70 lines
2.9 KiB
HTML
<div class="card card-table">
|
|
<div class="card-header text-right">
|
|
<button type="button" class="btn btn-create" (click)="onPopup()">
|
|
<i class="bi bi-plus"></i>
|
|
เพิ่มสิทธิ์การใช้งาน
|
|
</button>
|
|
</div>
|
|
<div class="card-body">
|
|
<div class="table-wrap">
|
|
<table class="table table-main" mat-table [dataSource]="dataSource" matSort (matSortChange)="onSort($event)">
|
|
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
|
|
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
|
|
|
|
<ng-container matColumnDef="code">
|
|
<th mat-header-cell *matHeaderCellDef class="tac">รหัส</th>
|
|
<td mat-cell *matCellDef="let item" width="150" class="tac">
|
|
{{item.code}}
|
|
</td>
|
|
</ng-container>
|
|
|
|
<ng-container matColumnDef="name">
|
|
<th mat-header-cell *matHeaderCellDef class="tal">สิทธิ์การใช้งาน</th>
|
|
<td mat-cell *matCellDef="let item" class="">
|
|
{{item.name }}
|
|
</td>
|
|
</ng-container>
|
|
<ng-container matColumnDef="desc">
|
|
<th mat-header-cell *matHeaderCellDef class="tal">รายละเอียด</th>
|
|
<td mat-cell *matCellDef="let item" class="">
|
|
{{item.desc }}
|
|
</td>
|
|
</ng-container>
|
|
|
|
|
|
<ng-container matColumnDef="createdDate">
|
|
<th mat-header-cell *matHeaderCellDef class="tal">User Create</th>
|
|
<td mat-cell *matCellDef="let item" class="">
|
|
<span *ngIf="item?.created">{{item?.created?.name}}-</span>{{item.createdDate | date : 'dd/MM/YYYY' }}
|
|
</td>
|
|
</ng-container>
|
|
|
|
<ng-container matColumnDef="status">
|
|
<th mat-header-cell *matHeaderCellDef class="tac" width="100">สถานะ</th>
|
|
<td mat-cell *matCellDef="let item" class="tac">
|
|
<div *ngIf="item.status" class="status status-active">ใช้งาน</div>
|
|
<div *ngIf="!item.status" class="status status-disabled">ปิดใช้งาน</div>
|
|
</td>
|
|
</ng-container>
|
|
|
|
<ng-container matColumnDef="action">
|
|
<th mat-header-cell *matHeaderCellDef width="100"> </th>
|
|
<td mat-cell *matCellDef="let item">
|
|
<div class="action flex justify-center">
|
|
<div class="item">
|
|
<i class="bi bi-pencil-square icon-edit" (click)="onPopup(item.id)"></i>
|
|
</div>
|
|
<div class="item icon-delete">
|
|
<i class="bi bi-trash3" (click)="onDelete(item.id)"></i>
|
|
</div>
|
|
</div>
|
|
</td>
|
|
</ng-container>
|
|
|
|
</table>
|
|
</div>
|
|
<div *ngIf="dataSourceCount === 0" class="no-data"></div>
|
|
<mat-paginator [pageSizeOptions]="pageSizeOptions" showFirstLastButtons (page)="getData($event)"></mat-paginator>
|
|
</div>
|
|
</div>
|