Début du travail sur la page de résumé

This commit is contained in:
Sébastien André
2019-10-23 18:31:52 +02:00
parent 75bea5189e
commit 7af8236561
5 changed files with 93 additions and 7 deletions

View File

@@ -12,7 +12,6 @@ import { ServiceComm } from '../../services/serviceComm';
styleUrls: ['./list-of-aircrafts.component.css'] styleUrls: ['./list-of-aircrafts.component.css']
}) })
export class ListOfAircraftsComponent implements OnInit { export class ListOfAircraftsComponent implements OnInit {
public listOfAircrafts: Array<AircraftResp> = new Array<AircraftResp>();
public displayedColumns: Array<string> = ['id', 'name']; public displayedColumns: Array<string> = ['id', 'name'];
public dataSourceTable; public dataSourceTable;
@ViewChild(MatPaginator, { static: true }) paginator: MatPaginator; @ViewChild(MatPaginator, { static: true }) paginator: MatPaginator;
@@ -28,7 +27,6 @@ export class ListOfAircraftsComponent implements OnInit {
getListOfAircrafts() { getListOfAircrafts() {
this.serviceApi.getListOfAircrafts() this.serviceApi.getListOfAircrafts()
.subscribe(data => { .subscribe(data => {
this.listOfAircrafts = data;
this.dataSourceTable = new MatTableDataSource<AircraftResp>(data); this.dataSourceTable = new MatTableDataSource<AircraftResp>(data);
this.dataSourceTable.paginator = this.paginator; this.dataSourceTable.paginator = this.paginator;
}); });

View File

@@ -14,7 +14,6 @@ import { ServiceComm } from '../../services/serviceComm';
export class ListOfDzsComponent implements OnInit { export class ListOfDzsComponent implements OnInit {
public listOfDropZones: Array<DropZoneResp> = new Array<DropZoneResp>();
public displayedColumns: Array<string> = ['id', 'name', 'latitude', 'longitude', 'address', 'email', 'type']; public displayedColumns: Array<string> = ['id', 'name', 'latitude', 'longitude', 'address', 'email', 'type'];
public dataSourceTable; public dataSourceTable;
@ViewChild(MatPaginator, { static: true }) paginator: MatPaginator; @ViewChild(MatPaginator, { static: true }) paginator: MatPaginator;
@@ -31,7 +30,6 @@ export class ListOfDzsComponent implements OnInit {
getListOfDropZones() { getListOfDropZones() {
this.serviceApi.getListOfDropZones() this.serviceApi.getListOfDropZones()
.subscribe(data => { .subscribe(data => {
this.listOfDropZones = data;
this.dataSourceTable = new MatTableDataSource<DropZoneResp>(data); this.dataSourceTable = new MatTableDataSource<DropZoneResp>(data);
this.dataSourceTable.paginator = this.paginator; this.dataSourceTable.paginator = this.paginator;
}); });

View File

@@ -12,7 +12,6 @@ import { ServiceComm } from '../../services/serviceComm';
styleUrls: ['./list-of-jump-types.component.css'] styleUrls: ['./list-of-jump-types.component.css']
}) })
export class ListOfJumpTypesComponent implements OnInit { export class ListOfJumpTypesComponent implements OnInit {
public listOfJumpTypes: Array<JumpTypeResp> = new Array<JumpTypeResp>();
public displayedColumns: Array<string> = ['id', 'name']; public displayedColumns: Array<string> = ['id', 'name'];
public dataSourceTable; public dataSourceTable;
@ViewChild(MatPaginator, { static: true }) paginator: MatPaginator; @ViewChild(MatPaginator, { static: true }) paginator: MatPaginator;
@@ -28,7 +27,6 @@ export class ListOfJumpTypesComponent implements OnInit {
getListOfJumpTypes() { getListOfJumpTypes() {
this.serviceApi.getListOfJumpTypes() this.serviceApi.getListOfJumpTypes()
.subscribe(data => { .subscribe(data => {
this.listOfJumpTypes = data;
this.dataSourceTable = new MatTableDataSource<JumpTypeResp>(data); this.dataSourceTable = new MatTableDataSource<JumpTypeResp>(data);
this.dataSourceTable.paginator = this.paginator; this.dataSourceTable.paginator = this.paginator;
}); });

View File

@@ -1,3 +1,89 @@
<p> <p>
summary works! <label>Total jumps</label>
Total Total
</p>
<p>
<label>Per DZ</label>
<table mat-table [dataSource]="dsNbJumpByDz">
<ng-container matColumnDef="label">
<!-- <th mat-header-cell *matHeaderCellDef>DZ</th> -->
<td mat-cell *matCellDef="let element">{{element.label}}</td>
</ng-container>
<ng-container matColumnDef="nb">
<!-- <th mat-header-cell *matHeaderCellDef>Nb</th> -->
<td mat-cell *matCellDef="let element">{{element.nb}}</td>
</ng-container>
<!-- <tr mat-header-row *matHeaderRowDef="displayedColumns"></tr> -->
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
</table>
</p>
<p>
<label>Per aircraft</label>
<table mat-table [dataSource]="dsNbJumpByAircraft">
<ng-container matColumnDef="label">
<td mat-cell *matCellDef="let element">{{element.label}}</td>
</ng-container>
<ng-container matColumnDef="nb">
<td mat-cell *matCellDef="let element">{{element.nb}}</td>
</ng-container>
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
</table>
</p>
<p>
<label>Per RIG</label>
<table mat-table [dataSource]="dsNbJumpByRig">
<ng-container matColumnDef="label">
<td mat-cell *matCellDef="let element">{{element.label}}</td>
</ng-container>
<ng-container matColumnDef="nb">
<td mat-cell *matCellDef="let element">{{element.nb}}</td>
</ng-container>
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
</table>
</p>
<p>
<label>Per jump type</label>
<table mat-table [dataSource]="dsNbJumpByType">
<ng-container matColumnDef="label">
<td mat-cell *matCellDef="let element">{{element.label}}</td>
</ng-container>
<ng-container matColumnDef="nb">
<td mat-cell *matCellDef="let element">{{element.nb}}</td>
</ng-container>
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
</table>
</p>
<p>
Per year
<table mat-table [dataSource]="dsNbJumpByYear">
<ng-container matColumnDef="label">
<td mat-cell *matCellDef="let element">{{element.label}}</td>
</ng-container>
<ng-container matColumnDef="nb">
<td mat-cell *matCellDef="let element">{{element.nb}}</td>
</ng-container>
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
</table>
</p>
<p>
<label>Total cutaways</label>
</p>
<p>
<label>Last jump</label>
Date and location
</p>
<p>
<label>Jumps in the last month</label>
</p>
<p>
<label>Jumps in the last year</label>
</p> </p>

View File

@@ -7,6 +7,12 @@ import { ServiceComm } from '../../services/serviceComm';
styleUrls: ['./summary.component.css'] styleUrls: ['./summary.component.css']
}) })
export class SummaryComponent implements OnInit { export class SummaryComponent implements OnInit {
public displayedColumns: Array<string> = ['label', 'nb'];
public dsNbJumpByDz;
public dsNbJumpByAircraft;
public dsNbJumpByRig;
public dsNbJumpByType;
public dsNbJumpByYear;
constructor(private serviceComm: ServiceComm) { } constructor(private serviceComm: ServiceComm) { }