-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.component.html
150 lines (134 loc) · 5.3 KB
/
app.component.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
<mat-tab-group [(selectedIndex)]="selectedTab">
<mat-tab label="Funcionários">
<div style="margin: 10px" class="row">
<div class="col-md-11">
<!-- Tabela Funcionários -->
<mat-table #table [dataSource]="dataSource">
<!-- ID Column -->
<ng-container matColumnDef="id">
<mat-header-cell *matHeaderCellDef>
<div *ngIf="!SearchMode">
ID
</div>
<div *ngIf="SearchMode">
<mat-form-field>
<input matInput placeholder="ID" [formControl]="filter_id">
</mat-form-field>
</div>
</mat-header-cell>
<mat-cell *matCellDef="let element"> {{element.id}}</mat-cell>
</ng-container>
<!-- Nome Column -->
<ng-container matColumnDef="nome">
<mat-header-cell *matHeaderCellDef>
<div *ngIf="!SearchMode">
Nome
</div>
<div *ngIf="SearchMode">
<mat-form-field>
<input matInput placeholder="Nome" [formControl]="filter_nome">
</mat-form-field>
</div>
</mat-header-cell>
<mat-cell *matCellDef="let element"> {{element.nome}}</mat-cell>
</ng-container>
<!-- Idade Column -->
<ng-container matColumnDef="idade">
<mat-header-cell *matHeaderCellDef>
<div *ngIf="!SearchMode">
Idade
</div>
<div *ngIf="SearchMode">
<mat-form-field>
<input matInput placeholder="Idade" [formControl]="filter_idade">
</mat-form-field>
</div>
</mat-header-cell>
<mat-cell *matCellDef="let element"> {{element.idade}}</mat-cell>
</ng-container>
<!-- Cargo Column -->
<ng-container matColumnDef="cargo">
<mat-header-cell *matHeaderCellDef>
<div *ngIf="!SearchMode">
Cargo
</div>
<div *ngIf="SearchMode">
<mat-form-field>
<input matInput placeholder="Cargo" [formControl]="filter_cargo">
</mat-form-field>
</div>
</mat-header-cell>
<mat-cell *matCellDef="let element"> {{element.cargo}}</mat-cell>
</ng-container>
<!-- Editar Column -->
<ng-container matColumnDef="actions">
<mat-header-cell *matHeaderCellDef></mat-header-cell>
<mat-cell *matCellDef="let element">
<button *ngIf="ConfigMode" mat-icon-button color="warn" aria-label="Deletar funcionarios"
(click)="RemoverFuncionario(element.id)">
<mat-icon>delete</mat-icon>
</button>
<button *ngIf="ConfigMode" mat-icon-button aria-label="Editar funcionarios"
(click)="openEditionDialog(element)">
<mat-icon>edit</mat-icon>
</button>
</mat-cell>
</ng-container>
<mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
<mat-row *matRowDef="let row; columns: displayedColumns;"></mat-row>
</mat-table>
<!-- Paginação -->
<mat-paginator #paginator
[pageSize]="10"
[pageSizeOptions]="[5, 10, 20]"
[showFirstLastButtons]="true">
</mat-paginator>
</div>
<!-- Configurações e Pesquisa -->
<div class="col-md-1">
<div class="row" style="margin: 15px;">
<button mat-mini-fab aria-label="Configurar funcionarios" (click)="ToggleConfigMode()"
[color]="ConfigMode?'primary':''">
<mat-icon>settings</mat-icon>
</button>
</div>
<div class="row" style="margin: 15px;">
<button mat-mini-fab aria-label="Procurar funcionarios" (click)="ToggleSearchMode()"
[color]="SearchMode?'primary':''">
<mat-icon>search</mat-icon>
</button>
</div>
</div>
</div>
</mat-tab>
<mat-tab label="Administrar">
<!-- Registrar Novos Funcionários -->
<mat-card style="margin: 10px">
<mat-card-header style="margin-bottom: 20px">
Registrar Funcionário
</mat-card-header>
<mat-card-content>
<form class="register-form">
<!-- Nome -->
<mat-form-field class="example-full-width">
<input matInput placeholder="Nome" [formControl]="field_nome">
</mat-form-field>
<!-- Idade -->
<mat-form-field class="example-full-width">
<input matInput type="number" placeholder="Idade" [formControl]="field_idade">
<mat-error *ngIf="field_idade.invalid"></mat-error>
</mat-form-field>
<!-- Cargo -->
<mat-form-field class="example-full-width">
<input matInput placeholder="Cargo" [formControl]="field_cargo">
</mat-form-field>
</form>
</mat-card-content>
<mat-card-actions align="end">
<button mat-button (click)="RegistrarFuncionario()" [disabled]="field_idade.invalid">
Adicionar
</button>
</mat-card-actions>
</mat-card>
</mat-tab>
</mat-tab-group>