|
|
@@ -16,10 +16,10 @@ export class BitagoraComponent {
|
|
|
private userData = JSON.parse(localStorage.getItem('userDataS') ? localStorage.getItem('userDataS') || '' : localStorage.getItem('userData') || '');
|
|
|
public isLoading: boolean = true;
|
|
|
|
|
|
-public color: string = '#e89a20';
|
|
|
-public textColor: string = '#ffffff';
|
|
|
-public filtro: string = 'Activos';
|
|
|
-public inputValue: string = '';
|
|
|
+ public color: string = '#e89a20';
|
|
|
+ public textColor: string = '#ffffff';
|
|
|
+ public filtro: string = 'Activos';
|
|
|
+ public inputValue: string = '';
|
|
|
|
|
|
public mensajeBienvenida: string = '';
|
|
|
public currentDate = new Date();
|
|
|
@@ -70,10 +70,10 @@ public inputValue: string = '';
|
|
|
obtenerBitacoras() {
|
|
|
return this.bitacoraService.getByUser(this.userData[0]).subscribe((response: any) => {
|
|
|
this.isLoading = false;
|
|
|
- this.dataSourceBitacoras = new MatTableDataSource<any>(response.filter((filtro:any)=> filtro.estado=== 'Activo'));
|
|
|
- this.dataSourceBitacoras.paginator= this.paginatorBit;
|
|
|
+ this.dataSourceBitacoras = new MatTableDataSource<any>(response.filter((filtro: any) => filtro.estado === 'Activo'));
|
|
|
+ this.dataSourceBitacoras.paginator = this.paginatorBit;
|
|
|
|
|
|
- response.forEach((item: any) => {
|
|
|
+ response.forEach((item: any) => {
|
|
|
if (typeof item.jsonAdjuntos === 'string') {
|
|
|
item.jsonAdjuntos = JSON.parse(item.jsonAdjuntos);
|
|
|
}
|
|
|
@@ -88,6 +88,7 @@ public inputValue: string = '';
|
|
|
|
|
|
|
|
|
openDialog(bitacora: any) {
|
|
|
+ console.log(bitacora);
|
|
|
this.dialog.open(BitacoraAlumComponent, {
|
|
|
data: {
|
|
|
materia: bitacora.idMateriaBitacora,
|
|
|
@@ -105,17 +106,32 @@ public inputValue: string = '';
|
|
|
}
|
|
|
}
|
|
|
applyFilter(event: Event) {
|
|
|
- const filterValue = (event.target as HTMLInputElement).value.trim().toLowerCase();
|
|
|
- this.dataSourceBitacoras.filter = filterValue;
|
|
|
-}
|
|
|
+ const filterValue = (event.target as HTMLInputElement).value.trim().toLowerCase();
|
|
|
+ this.dataSourceBitacoras.filter = filterValue;
|
|
|
+ }
|
|
|
|
|
|
-// Método para filtrar por estado
|
|
|
-option(value: string) {
|
|
|
- this.filtro = value;
|
|
|
- this.obtenerBitacoras();
|
|
|
-}
|
|
|
+ // Método para filtrar por estado
|
|
|
+ option(value: string) {
|
|
|
+ this.filtro = value;
|
|
|
+ this.obtenerBitacoras();
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
+@Component({
|
|
|
+ selector: 'app-bitacora-alum',
|
|
|
+ template: `
|
|
|
+ <h2 mat-dialog-title>Detalles de Bitácora</h2>
|
|
|
+ <mat-dialog-content>
|
|
|
+ <p><strong>Materia:</strong> {{ data.materia }}</p>
|
|
|
+ <p><strong>Tipo:</strong> {{ data.tipo }}</p>
|
|
|
+ <p><strong>Fecha:</strong> {{ data.fecha }}</p>
|
|
|
+ <div [innerHTML]="data.descripcion"></div>
|
|
|
+ </mat-dialog-content>
|
|
|
+ <mat-dialog-actions align="end">
|
|
|
+ <button mat-button mat-dialog-close>Cerrar</button>
|
|
|
+ </mat-dialog-actions>
|
|
|
+ `
|
|
|
+})
|
|
|
export class BitacoraAlumComponent {
|
|
|
constructor(@Inject(MAT_DIALOG_DATA) public data: any) { }
|
|
|
}
|