h-selfdelivery-admin-panel-p/src/app/pages/areas/areas.component.html

48 lines
1.6 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<h1>Зоны</h1>
<h2 *ngIf="chooseName; else ClientNull">Выбран: {{chooseName}}</h2>
<ng-template #ClientNull>
<h2 style="color:red">Выберите клиента</h2>
</ng-template>
<div *ngIf="new_ar;else new_Area">
<button (click)="createArea()">Добавить</button>
<p-table [value]="areas">
<ng-template pTemplate="header">
<tr style="position:sticky !important; top: 0">
<th style="width:35%">ID</th>
<th style="width:35%">Наименование зоны</th>
<th></th>
<th></th>
</tr>
</ng-template>
<ng-template pTemplate="body" let-areas>
<!--*ngIf="color()" style="color: red" [ngClass]="{ui-button-danger: true}"-->
<tr>
<td style="width:35%">{{areas.id}}</td>
<td style="width:35%">{{areas.name}}</td>
<td><button (click)="updateArea1(areas.id, areas.name)">Изменить</button></td>
<td><button (click)="deleteArea(areas.id)">Удалить</button></td>
</tr>
</ng-template>
</p-table>
</div>
<ng-template #new_Area>
<button (click)="getAreas()">К списку</button>
<p-table>
<ng-template pTemplate="header">
<tr>
<th>Введите наименование зоны:</th>
<th><input type="text" style="width: 400px; height: 30px; font-size:20px"></th>
</tr>
</ng-template>
</p-table>
<div *ngIf="create; else change">
<button (click)="createArea2()">Создать</button>
</div>
<ng-template #change>
<button (click)="updateArea()">Сохранить</button>
</ng-template>
</ng-template>