utn-cli 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/commands/backend.js +282 -0
- package/commands/db.js +49 -0
- package/commands/frontend.js +225 -0
- package/index.js +98 -0
- package/package.json +27 -0
- package/templates/backend/InformacionDelModulo.json +21 -0
- package/templates/backend/NOMBRE_DEL_CANONICO_DEL_PROYECTO.rest +74 -0
- package/templates/backend/README.md +0 -0
- package/templates/backend/gitignore +3 -0
- package/templates/backend/index.rest +288 -0
- package/templates/backend/package.json +30 -0
- package/templates/backend/reporte.pdf +0 -0
- package/templates/backend/rutas/API.js +49 -0
- package/templates/backend/rutas/Servicio1.js +184 -0
- package/templates/backend/rutas/misc.js +671 -0
- package/templates/backend/rutas/rutas.js +11 -0
- package/templates/backend/server.js +79 -0
- package/templates/backend/servicios/API.js +101 -0
- package/templates/backend/servicios/InformacionDelModulo.js +70 -0
- package/templates/backend/servicios/Nucleo/EnvioDeCorreos.js +45 -0
- package/templates/backend/servicios/Nucleo/ManejadorDeErrores.js +54 -0
- package/templates/backend/servicios/Nucleo/Miscelaneas.js +1901 -0
- package/templates/backend/servicios/Nucleo/Monitoreo.js +65 -0
- package/templates/backend/servicios/Nucleo/db.js +78 -0
- package/templates/backend/servicios/Servicio1.js +118 -0
- package/templates/backend/variables-calidad.env +6 -0
- package/templates/backend/variables-desarrollo.env +6 -0
- package/templates/backend/variables-pruebas.env +6 -0
- package/templates/bd/README.md +78 -0
- package/templates/bd/cumulodb-scripts/gitignore +1 -0
- package/templates/bd/docker-compose.yml +28 -0
- package/templates/bd/docker-scripts/1-crear estructura.sql +29 -0
- package/templates/bd/docker-scripts/2-cambios estructura original.sql +1 -0
- package/templates/bd/docker-scripts/3-insertar datos de prueba.sql +1 -0
- package/templates/bd/docker-scripts/4-crear eventos y rutinas.sql +1 -0
- package/templates/bd/docker-scripts/5-crear vistas.sql +1 -0
- package/templates/bd/docker-scripts/6-calidad.sql +1 -0
- package/templates/bd/docker-scripts/7-pruebas.sql +1 -0
- package/templates/bd/docker-scripts/8-local.sql +1 -0
- package/templates/bd/servidores-scripts/calidad.sql +1 -0
- package/templates/bd/servidores-scripts/datos_iniciales_produccion.sql +1 -0
- package/templates/bd/servidores-scripts/produccion.sql +1 -0
- package/templates/bd/servidores-scripts/pruebas.sql +1 -0
- package/templates/frontend/.vscode/extensions.json +4 -0
- package/templates/frontend/.vscode/launch.json +20 -0
- package/templates/frontend/.vscode/tasks.json +42 -0
- package/templates/frontend/Dockerfile +5 -0
- package/templates/frontend/README.md +59 -0
- package/templates/frontend/angular.json +101 -0
- package/templates/frontend/dist/frontend/3rdpartylicenses.txt +459 -0
- package/templates/frontend/dist/frontend/prerendered-routes.json +3 -0
- package/templates/frontend/docker-compose.yml +5 -0
- package/templates/frontend/editorconfig +17 -0
- package/templates/frontend/gitignore +45 -0
- package/templates/frontend/nginx.conf +12 -0
- package/templates/frontend/package.json +46 -0
- package/templates/frontend/public/favicon.ico +0 -0
- package/templates/frontend/src/app/Componentes/Nucleo/graficos/graficos.component.css +15 -0
- package/templates/frontend/src/app/Componentes/Nucleo/graficos/graficos.component.html +25 -0
- package/templates/frontend/src/app/Componentes/Nucleo/graficos/graficos.component.ts +80 -0
- package/templates/frontend/src/app/Componentes/Nucleo/iframe/iframe.ts +37 -0
- package/templates/frontend/src/app/Componentes/Nucleo/mensaje-confirmacion/mensaje-confirmacion.component.css +5 -0
- package/templates/frontend/src/app/Componentes/Nucleo/mensaje-confirmacion/mensaje-confirmacion.component.html +22 -0
- package/templates/frontend/src/app/Componentes/Nucleo/mensaje-confirmacion/mensaje-confirmacion.ts +64 -0
- package/templates/frontend/src/app/Componentes/Nucleo/mensaje-confirmacion-html/mensaje-confirmacion-html.component.css +5 -0
- package/templates/frontend/src/app/Componentes/Nucleo/mensaje-confirmacion-html/mensaje-confirmacion-html.component.html +22 -0
- package/templates/frontend/src/app/Componentes/Nucleo/mensaje-confirmacion-html/mensaje-confirmacion-html.ts +64 -0
- package/templates/frontend/src/app/Componentes/Nucleo/mensaje-informacion/mensaje-informacion.component.css +5 -0
- package/templates/frontend/src/app/Componentes/Nucleo/mensaje-informacion/mensaje-informacion.component.html +11 -0
- package/templates/frontend/src/app/Componentes/Nucleo/mensaje-informacion/mensaje-informacion.ts +46 -0
- package/templates/frontend/src/app/Componentes/Nucleo/mensajes/mensajes.component.css +11 -0
- package/templates/frontend/src/app/Componentes/Nucleo/mensajes/mensajes.component.html +17 -0
- package/templates/frontend/src/app/Componentes/Nucleo/mensajes/mensajes.component.ts +43 -0
- package/templates/frontend/src/app/Componentes/Nucleo/reporte-de-incidencias/reporte-de-incidencias.component.css +37 -0
- package/templates/frontend/src/app/Componentes/Nucleo/reporte-de-incidencias/reporte-de-incidencias.component.html +35 -0
- package/templates/frontend/src/app/Componentes/Nucleo/reporte-de-incidencias/reporte-de-incidencias.component.ts +103 -0
- package/templates/frontend/src/app/Componentes/Nucleo/subir-archivo/subir-archivo.component.css +90 -0
- package/templates/frontend/src/app/Componentes/Nucleo/subir-archivo/subir-archivo.component.html +39 -0
- package/templates/frontend/src/app/Componentes/Nucleo/subir-archivo/subir-archivo.component.ts +132 -0
- package/templates/frontend/src/app/Componentes/Nucleo/tabla/paginador-personalizado.ts +17 -0
- package/templates/frontend/src/app/Componentes/Nucleo/tabla/tabla.component.css +332 -0
- package/templates/frontend/src/app/Componentes/Nucleo/tabla/tabla.component.html +166 -0
- package/templates/frontend/src/app/Componentes/Nucleo/tabla/tabla.component.ts +228 -0
- package/templates/frontend/src/app/Componentes/Nucleo/tarjeta/tarjeta.component.css +129 -0
- package/templates/frontend/src/app/Componentes/Nucleo/tarjeta/tarjeta.component.html +35 -0
- package/templates/frontend/src/app/Componentes/Nucleo/tarjeta/tarjeta.component.ts +46 -0
- package/templates/frontend/src/app/Componentes/Nucleo/tarjeta-modulo/tarjeta-modulo.component.css +92 -0
- package/templates/frontend/src/app/Componentes/Nucleo/tarjeta-modulo/tarjeta-modulo.component.html +17 -0
- package/templates/frontend/src/app/Componentes/Nucleo/tarjeta-modulo/tarjeta-modulo.component.ts +42 -0
- package/templates/frontend/src/app/Componentes/Nucleo/tarjeta-multiple/tarjeta-multiple.component.css +90 -0
- package/templates/frontend/src/app/Componentes/Nucleo/tarjeta-multiple/tarjeta-multiple.component.html +22 -0
- package/templates/frontend/src/app/Componentes/Nucleo/tarjeta-multiple/tarjeta-multiple.component.ts +46 -0
- package/templates/frontend/src/app/Componentes/Nucleo/tarjeta-reporte/tarjeta-reporte.component.css +129 -0
- package/templates/frontend/src/app/Componentes/Nucleo/tarjeta-reporte/tarjeta-reporte.component.html +20 -0
- package/templates/frontend/src/app/Componentes/Nucleo/tarjeta-reporte/tarjeta-reporte.component.ts +25 -0
- package/templates/frontend/src/app/Componentes/guardar-incapacidad/guardar-incapacidad.component.css +20 -0
- package/templates/frontend/src/app/Componentes/guardar-incapacidad/guardar-incapacidad.component.html +46 -0
- package/templates/frontend/src/app/Componentes/guardar-incapacidad/guardar-incapacidad.component.ts +64 -0
- package/templates/frontend/src/app/Paginas/Nucleo/contenedor-componentes/contenedor-componentes.component.css +142 -0
- package/templates/frontend/src/app/Paginas/Nucleo/contenedor-componentes/contenedor-componentes.component.html +90 -0
- package/templates/frontend/src/app/Paginas/Nucleo/contenedor-componentes/contenedor-componentes.component.ts +139 -0
- package/templates/frontend/src/app/Paginas/contenedor-principal/contenedor-principal.component.css +4 -0
- package/templates/frontend/src/app/Paginas/contenedor-principal/contenedor-principal.component.html +17 -0
- package/templates/frontend/src/app/Paginas/contenedor-principal/contenedor-principal.component.ts +36 -0
- package/templates/frontend/src/app/Paginas/gestion-de-reportes/gestion-de-reportes.component.css +4 -0
- package/templates/frontend/src/app/Paginas/gestion-de-reportes/gestion-de-reportes.component.html +6 -0
- package/templates/frontend/src/app/Paginas/gestion-de-reportes/gestion-de-reportes.component.ts +36 -0
- package/templates/frontend/src/app/Paginas/gestion-graficos/gestion-graficos.component.css +13 -0
- package/templates/frontend/src/app/Paginas/gestion-graficos/gestion-graficos.component.html +13 -0
- package/templates/frontend/src/app/Paginas/gestion-graficos/gestion-graficos.component.ts +75 -0
- package/templates/frontend/src/app/Paginas/gestion-iframe1/gestion-iframe1.component.css +13 -0
- package/templates/frontend/src/app/Paginas/gestion-iframe1/gestion-iframe1.component.html +3 -0
- package/templates/frontend/src/app/Paginas/gestion-iframe1/gestion-iframe1.component.ts +14 -0
- package/templates/frontend/src/app/Paginas/gestion-tabla/gestion-tabla.component.css +13 -0
- package/templates/frontend/src/app/Paginas/gestion-tabla/gestion-tabla.component.html +24 -0
- package/templates/frontend/src/app/Paginas/gestion-tabla/gestion-tabla.component.ts +300 -0
- package/templates/frontend/src/app/Paginas/gestion-tabla-XYZ/gestion-tabla-XYZ.component.css +13 -0
- package/templates/frontend/src/app/Paginas/gestion-tabla-XYZ/gestion-tabla-XYZ.component.html +43 -0
- package/templates/frontend/src/app/Paginas/gestion-tabla-XYZ/gestion-tabla-XYZ.component.ts +305 -0
- package/templates/frontend/src/app/Paginas/gestion-tabla-jefe/gestion-tabla-jefe.component.css +13 -0
- package/templates/frontend/src/app/Paginas/gestion-tabla-jefe/gestion-tabla-jefe.component.html +25 -0
- package/templates/frontend/src/app/Paginas/gestion-tabla-jefe/gestion-tabla-jefe.component.ts +245 -0
- package/templates/frontend/src/app/analytics.module.ts +45 -0
- package/templates/frontend/src/app/app.component.css +0 -0
- package/templates/frontend/src/app/app.component.html +1 -0
- package/templates/frontend/src/app/app.component.ts +10 -0
- package/templates/frontend/src/app/app.config.server.ts +14 -0
- package/templates/frontend/src/app/app.config.ts +27 -0
- package/templates/frontend/src/app/app.routes.ts +16 -0
- package/templates/frontend/src/app/auth.interceptor.ts +26 -0
- package/templates/frontend/src/app/datos-globales.service.ts +45 -0
- package/templates/frontend/src/assets/Puntos.svg +94 -0
- package/templates/frontend/src/index.html +36 -0
- package/templates/frontend/src/main.server.ts +7 -0
- package/templates/frontend/src/main.ts +6 -0
- package/templates/frontend/src/styles.css +14 -0
- package/templates/frontend/tsconfig.app.json +15 -0
- package/templates/frontend/tsconfig.json +27 -0
- package/templates/frontend/tsconfig.spec.json +15 -0
- package/utils/index.js +105 -0
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { Component, ElementRef, OnInit, ViewChild, inject } from '@angular/core';
|
|
2
|
+
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
|
|
3
|
+
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
4
|
+
import { MatInputModule } from '@angular/material/input';
|
|
5
|
+
import { ReactiveFormsModule } from '@angular/forms';
|
|
6
|
+
import { MatDialogActions, MatDialogContent, MatDialogRef, MatDialogTitle } from '@angular/material/dialog';
|
|
7
|
+
import { MatButtonModule } from '@angular/material/button';
|
|
8
|
+
import { DatosGlobalesService } from '../../../datos-globales.service';
|
|
9
|
+
import { HttpClient, HttpHeaders } from '@angular/common/http';
|
|
10
|
+
|
|
11
|
+
@Component({
|
|
12
|
+
selector: 'app-reporte-de-incidencias',
|
|
13
|
+
templateUrl: './reporte-de-incidencias.component.html',
|
|
14
|
+
styleUrls: ['./reporte-de-incidencias.component.css'],
|
|
15
|
+
imports: [
|
|
16
|
+
MatFormFieldModule,
|
|
17
|
+
MatInputModule,
|
|
18
|
+
ReactiveFormsModule,
|
|
19
|
+
MatDialogContent,
|
|
20
|
+
MatButtonModule,
|
|
21
|
+
MatDialogTitle,
|
|
22
|
+
MatDialogActions
|
|
23
|
+
]
|
|
24
|
+
})
|
|
25
|
+
|
|
26
|
+
export class ReporteDeIncidenciasComponent implements OnInit {
|
|
27
|
+
formulario!: FormGroup;
|
|
28
|
+
|
|
29
|
+
archivos: File[] = [];
|
|
30
|
+
|
|
31
|
+
readonly dialogRef = inject(MatDialogRef<ReporteDeIncidenciasComponent>);
|
|
32
|
+
|
|
33
|
+
constructor(private fb: FormBuilder, private datosGlobalesService: DatosGlobalesService, private http: HttpClient) { }
|
|
34
|
+
|
|
35
|
+
@ViewChild('EntradDeArchivo') EntradDeArchivo!: ElementRef<HTMLInputElement>;
|
|
36
|
+
|
|
37
|
+
Archivo: any;
|
|
38
|
+
|
|
39
|
+
ngOnInit(): void {
|
|
40
|
+
this.formulario = this.fb.group({
|
|
41
|
+
detalle: ['', Validators.required],
|
|
42
|
+
resultado: ['', Validators.required],
|
|
43
|
+
adjuntos: ['', Validators.required],
|
|
44
|
+
contacto: ['', Validators.required]
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
Cerrar(): void {
|
|
49
|
+
this.dialogRef.close();
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
Enviar() {
|
|
53
|
+
if (this.Archivo) {
|
|
54
|
+
const archivo = new FormData();
|
|
55
|
+
archivo.append("file", this.Archivo);
|
|
56
|
+
const Datos = JSON.stringify(this.formulario.value);
|
|
57
|
+
this.http.post(this.datosGlobalesService.ObtenerURL() + 'misc/reporteDeIncidencia/' + Datos,
|
|
58
|
+
archivo)
|
|
59
|
+
.subscribe({
|
|
60
|
+
next: (data: any) => {
|
|
61
|
+
alert('Mensaje enviado');
|
|
62
|
+
},
|
|
63
|
+
error: (error) => {
|
|
64
|
+
console.error('Ocurrió un error al informar de la incidenmcia:', error);
|
|
65
|
+
}
|
|
66
|
+
})
|
|
67
|
+
}
|
|
68
|
+
this.Cerrar();
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
ArchivoSeleccionado(event: Event) {
|
|
72
|
+
const entrada = event.target as HTMLInputElement;
|
|
73
|
+
if (entrada.files?.length) {
|
|
74
|
+
this.Archivo = entrada.files[0];
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
AbrirGestorDeArchivos() {
|
|
79
|
+
this.EntradDeArchivo.nativeElement.click();
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
ArrastrarAdentro(event: DragEvent) {
|
|
83
|
+
event.preventDefault();
|
|
84
|
+
event.stopPropagation();
|
|
85
|
+
const archivoZona = event.target as HTMLElement;
|
|
86
|
+
archivoZona.classList.add('arrastrar');
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
ArrastrarAfuera(event: DragEvent) {
|
|
90
|
+
const archivoZona = event.target as HTMLElement;
|
|
91
|
+
archivoZona.classList.remove('arrastrar');
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
Soltar(event: DragEvent) {
|
|
95
|
+
event.preventDefault();
|
|
96
|
+
event.stopPropagation();
|
|
97
|
+
const archivoZona = event.target as HTMLElement;
|
|
98
|
+
archivoZona.classList.remove('arrastrar');
|
|
99
|
+
if (event.dataTransfer?.files.length) {
|
|
100
|
+
this.Archivo = event.dataTransfer.files[0];
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
package/templates/frontend/src/app/Componentes/Nucleo/subir-archivo/subir-archivo.component.css
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
button:focus {
|
|
2
|
+
outline: none !important;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.contenedor {
|
|
6
|
+
|
|
7
|
+
min-height: 20vh;
|
|
8
|
+
padding: 2%;
|
|
9
|
+
padding-top: 10%;
|
|
10
|
+
padding-bottom: 5%;
|
|
11
|
+
|
|
12
|
+
background-color: white;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.zona-archivo {
|
|
16
|
+
width: 90%;
|
|
17
|
+
height: 10vh;
|
|
18
|
+
margin-left: 4%;
|
|
19
|
+
border: 2px dashed #3498db;
|
|
20
|
+
padding: 1%;
|
|
21
|
+
align-items: center;
|
|
22
|
+
display: flex;
|
|
23
|
+
cursor: pointer;
|
|
24
|
+
transition: background 0.3s;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.texto {
|
|
28
|
+
width: 100%;
|
|
29
|
+
text-align: center;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.zona-archivo:hover,
|
|
33
|
+
.zona-archivo.arrastrar {
|
|
34
|
+
background: #e3f2fd;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.texto-clic {
|
|
38
|
+
color: #007bff;
|
|
39
|
+
font-weight: bold;
|
|
40
|
+
cursor: pointer;
|
|
41
|
+
text-decoration: underline;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.pie {
|
|
45
|
+
margin-top: 5%;
|
|
46
|
+
margin-right: 5%;
|
|
47
|
+
display: flex;
|
|
48
|
+
flex-direction: row-reverse;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.lista {
|
|
52
|
+
width: 95%;
|
|
53
|
+
margin-bottom: 2%;
|
|
54
|
+
padding-left: 4%;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.lista .archivo {
|
|
58
|
+
border: solid 1px #007bff;
|
|
59
|
+
;
|
|
60
|
+
border-radius: 10px;
|
|
61
|
+
width: 100%;
|
|
62
|
+
display: flex;
|
|
63
|
+
justify-content: center;
|
|
64
|
+
align-items: center;
|
|
65
|
+
margin-bottom: 1%;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.lista .archivo p {
|
|
69
|
+
|
|
70
|
+
text-align: center;
|
|
71
|
+
width: 70%;
|
|
72
|
+
padding: 1%;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.lista p:nth-child(odd) {
|
|
76
|
+
margin-right: 2%;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.descargar {
|
|
80
|
+
color: #007bff;
|
|
81
|
+
margin-right: 5%;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.eliminar {
|
|
85
|
+
color: red;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.deshabilitado {
|
|
89
|
+
color: gray;
|
|
90
|
+
}
|
package/templates/frontend/src/app/Componentes/Nucleo/subir-archivo/subir-archivo.component.html
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<div class="contenedor">
|
|
2
|
+
<div class="lista">
|
|
3
|
+
@for(archivo of ListaArchivos;track $index){
|
|
4
|
+
<div class="archivo">
|
|
5
|
+
<p>{{archivo.Nombre}}</p>
|
|
6
|
+
<button mat-icon-button (click)="DescargarArchivo(archivo.ArchivoId,archivo.Nombre)" matTooltip="Descargar">
|
|
7
|
+
<!--pone deshabilitado si es estado coincide con el indicado -->
|
|
8
|
+
<mat-icon class="descargar">download</mat-icon>
|
|
9
|
+
</button>
|
|
10
|
+
<button mat-icon-button [disabled]="!EsEditable" (click)="BorrarArchivo(archivo.ArchivoId)" matTooltip="Eliminar">
|
|
11
|
+
<!--pone deshabilitado si es estado coincide con el indicado -->
|
|
12
|
+
<mat-icon class="eliminar" [class.deshabilitado]="!EsEditable">delete</mat-icon>
|
|
13
|
+
</button>
|
|
14
|
+
|
|
15
|
+
</div>
|
|
16
|
+
}
|
|
17
|
+
</div>
|
|
18
|
+
@if(EsEditable) {
|
|
19
|
+
<div class="zona-archivo" (click)="AbrirGestorDeArchivos()" (dragover)="ArrastrarAdentro($event)"
|
|
20
|
+
(dragleave)="ArrastrarAfuera($event)" (drop)="Soltar($event)">
|
|
21
|
+
@if(!Archivo){
|
|
22
|
+
<p class="texto">Arrastra y suelta un archivo aquí o <span class="texto-clic">haz clic para subir</span></p>
|
|
23
|
+
}
|
|
24
|
+
@else{
|
|
25
|
+
<p>Archivo seleccionado: {{ Archivo.name }}</p>
|
|
26
|
+
}
|
|
27
|
+
<!-- Input oculto para seleccionar archivos manualmente -->
|
|
28
|
+
<input type="file" #EntradDeArchivo hidden (change)="ArchivoSeleccionado($event)">
|
|
29
|
+
</div>
|
|
30
|
+
} @else {
|
|
31
|
+
@if(ListaArchivos.length === 0) {
|
|
32
|
+
<p>Sin archivos adjuntos</p>
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
<div class="pie">
|
|
36
|
+
<button mat-button [disabled]="!EsEditable" (click)="SubirArchivo()">Guardar</button>
|
|
37
|
+
<button mat-button (click)="Cancelar()">Cerrar</button>
|
|
38
|
+
</div>
|
|
39
|
+
</div>
|
package/templates/frontend/src/app/Componentes/Nucleo/subir-archivo/subir-archivo.component.ts
ADDED
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { Component, ElementRef, inject, OnInit, ViewChild } from '@angular/core';
|
|
2
|
+
import { MatButtonModule } from '@angular/material/button';
|
|
3
|
+
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
|
4
|
+
import { HttpClient, HttpHeaders } from '@angular/common/http';
|
|
5
|
+
import { MatIconModule } from '@angular/material/icon';
|
|
6
|
+
import { DatosGlobalesService } from '../../../datos-globales.service';
|
|
7
|
+
|
|
8
|
+
@Component({
|
|
9
|
+
selector: 'app-subir-archivo',
|
|
10
|
+
imports: [MatButtonModule, MatIconModule],
|
|
11
|
+
templateUrl: './subir-archivo.component.html',
|
|
12
|
+
styleUrl: './subir-archivo.component.css'
|
|
13
|
+
})
|
|
14
|
+
export class SubirArchivoComponent implements OnInit {
|
|
15
|
+
readonly dialogRef = inject(MatDialogRef<SubirArchivoComponent>);
|
|
16
|
+
Archivo: any;
|
|
17
|
+
ListaArchivos: any[] = []
|
|
18
|
+
@ViewChild('EntradDeArchivo') EntradDeArchivo!: ElementRef<HTMLInputElement>;
|
|
19
|
+
readonly data = inject(MAT_DIALOG_DATA);
|
|
20
|
+
Permiso = '--Permiso=' + this.data.Permiso;
|
|
21
|
+
Etiqueta = this.data.Etiqueta + this.Permiso;
|
|
22
|
+
EsEditable = this.data.EsEditable;
|
|
23
|
+
Token: any;
|
|
24
|
+
constructor(private datosGlobalesService: DatosGlobalesService,
|
|
25
|
+
private http: HttpClient
|
|
26
|
+
) { }
|
|
27
|
+
ngOnInit(): void {
|
|
28
|
+
this.ListarArchivos(this.Etiqueta)
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
ArrastrarAdentro(event: DragEvent) {
|
|
32
|
+
event.preventDefault();
|
|
33
|
+
event.stopPropagation();
|
|
34
|
+
const archivoZona = event.target as HTMLElement;
|
|
35
|
+
archivoZona.classList.add('arrastrar');
|
|
36
|
+
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
ArrastrarAfuera(event: DragEvent) {
|
|
40
|
+
const archivoZona = event.target as HTMLElement;
|
|
41
|
+
archivoZona.classList.remove('arrastrar');
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
Soltar(event: DragEvent) {
|
|
45
|
+
event.preventDefault();
|
|
46
|
+
event.stopPropagation();
|
|
47
|
+
|
|
48
|
+
const archivoZona = event.target as HTMLElement;
|
|
49
|
+
archivoZona.classList.remove('arrastrar');
|
|
50
|
+
|
|
51
|
+
if (event.dataTransfer?.files.length && this.EsEditable) {
|
|
52
|
+
this.Archivo = event.dataTransfer.files[0];
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
ArchivoSeleccionado(event: Event) {
|
|
57
|
+
const entrada = event.target as HTMLInputElement;
|
|
58
|
+
if (entrada.files?.length) {
|
|
59
|
+
this.Archivo = entrada.files[0];
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
AbrirGestorDeArchivos() {
|
|
64
|
+
if (this.EsEditable) {
|
|
65
|
+
this.EntradDeArchivo.nativeElement.click();
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
SubirArchivo() {
|
|
70
|
+
if (this.Archivo) {
|
|
71
|
+
let archivo = new FormData();
|
|
72
|
+
archivo.append("file", this.Archivo);
|
|
73
|
+
this.CargarArchivo(archivo, this.Etiqueta)
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
CargarArchivo(archivo: any, Etiqueta: string) {
|
|
78
|
+
this.http.post(this.datosGlobalesService.ObtenerURL() + 'misc/cargarArchivo/' + Etiqueta,
|
|
79
|
+
archivo)
|
|
80
|
+
.subscribe({
|
|
81
|
+
next: (data: any) => {
|
|
82
|
+
this.Archivo = undefined;
|
|
83
|
+
this.ListarArchivos(Etiqueta)
|
|
84
|
+
},
|
|
85
|
+
error: (error) => {
|
|
86
|
+
console.error('Ocurrió un error guardando el archivo:', error);
|
|
87
|
+
}
|
|
88
|
+
})
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
ListarArchivos(Etiqueta: string) {
|
|
92
|
+
this.http.get(this.datosGlobalesService.ObtenerURL() + 'misc/listarArchivos/' + Etiqueta)
|
|
93
|
+
.subscribe({
|
|
94
|
+
next: (data: any) => {
|
|
95
|
+
this.ListaArchivos = data.body;
|
|
96
|
+
},
|
|
97
|
+
error: (error) => {
|
|
98
|
+
console.error('Ocurrió un error listando los archivos:', error);
|
|
99
|
+
}
|
|
100
|
+
})
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
DescargarArchivo(ArchivoId: string, Nombre: string) {
|
|
104
|
+
this.http.get(this.datosGlobalesService.ObtenerURL() + 'misc/descargarArchivo/' + ArchivoId + this.Permiso
|
|
105
|
+
, { responseType: 'blob' })
|
|
106
|
+
.subscribe((pdfBlob) => {
|
|
107
|
+
const url = window.URL.createObjectURL(pdfBlob);
|
|
108
|
+
const a = document.createElement('a');
|
|
109
|
+
a.href = url;
|
|
110
|
+
a.download = Nombre;
|
|
111
|
+
document.body.appendChild(a);
|
|
112
|
+
a.click();
|
|
113
|
+
document.body.removeChild(a);
|
|
114
|
+
})
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
BorrarArchivo(ArchivoId: string) {
|
|
118
|
+
this.http.delete(this.datosGlobalesService.ObtenerURL() + 'misc/borrarArchivo/' + ArchivoId)
|
|
119
|
+
.subscribe({
|
|
120
|
+
next: (data: any) => {
|
|
121
|
+
this.ListarArchivos(this.Etiqueta);
|
|
122
|
+
},
|
|
123
|
+
error: (error) => {
|
|
124
|
+
console.error('Ocurrió un error borrando el archivo:', error);
|
|
125
|
+
}
|
|
126
|
+
})
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
Cancelar() {
|
|
130
|
+
this.dialogRef.close();
|
|
131
|
+
}
|
|
132
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { MatPaginatorIntl } from '@angular/material/paginator';
|
|
2
|
+
export class PaginadorPersonalizado extends MatPaginatorIntl {
|
|
3
|
+
override itemsPerPageLabel = 'Elementos por página:';
|
|
4
|
+
override nextPageLabel = 'Siguiente página';
|
|
5
|
+
override previousPageLabel = 'Página anterior';
|
|
6
|
+
override firstPageLabel = 'Primera página';
|
|
7
|
+
override lastPageLabel = 'Última página';
|
|
8
|
+
|
|
9
|
+
override getRangeLabel = (page: number, pageSize: number, length: number) => {
|
|
10
|
+
if (length === 0 || pageSize === 0) {
|
|
11
|
+
return `0 de ${length}`;
|
|
12
|
+
}
|
|
13
|
+
const startIndex = page * pageSize;
|
|
14
|
+
const endIndex = Math.min(startIndex + pageSize, length);
|
|
15
|
+
return `${startIndex + 1} - ${endIndex} de ${length}`;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
@@ -0,0 +1,332 @@
|
|
|
1
|
+
.encabezado {
|
|
2
|
+
display: flex;
|
|
3
|
+
justify-content: space-between;
|
|
4
|
+
align-items: center;
|
|
5
|
+
width: 100%;
|
|
6
|
+
margin-top: 2px;
|
|
7
|
+
margin-bottom: 7px;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.custom-input {
|
|
11
|
+
padding: 8px;
|
|
12
|
+
border: 1px solid #ccc;
|
|
13
|
+
border-radius: 4px;
|
|
14
|
+
font-size: 14px;
|
|
15
|
+
width: 200px;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.izquierda,
|
|
19
|
+
.derecha {
|
|
20
|
+
display: flex;
|
|
21
|
+
flex-wrap: wrap;
|
|
22
|
+
gap: 10px;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.centro {
|
|
26
|
+
flex-grow: 1;
|
|
27
|
+
display: flex;
|
|
28
|
+
flex-wrap: wrap;
|
|
29
|
+
justify-content: center;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.formField {
|
|
33
|
+
max-height: 60px;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.descargar {
|
|
37
|
+
background-color: #0069B4 !important;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.Activa, .Activo, .Finalizado, .Aprobada, .Aprobado, .Ejecutando, .Autorizado, .Aperturado, .Ejecutada {
|
|
41
|
+
background-color: #518a5f;
|
|
42
|
+
color: white;
|
|
43
|
+
padding: 8px 16px;
|
|
44
|
+
border-radius: 20px;
|
|
45
|
+
border: none;
|
|
46
|
+
font-size: 16px;
|
|
47
|
+
font-weight: bold;
|
|
48
|
+
text-align: center;
|
|
49
|
+
display: inline-block;
|
|
50
|
+
cursor: pointer;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.Inactiva, .Inactivo, .Cerrado {
|
|
54
|
+
background-color: #7d7d7d;
|
|
55
|
+
color: white;
|
|
56
|
+
padding: 8px 16px;
|
|
57
|
+
border-radius: 20px;
|
|
58
|
+
border: none;
|
|
59
|
+
font-size: 16px;
|
|
60
|
+
font-weight: bold;
|
|
61
|
+
text-align: center;
|
|
62
|
+
display: inline-block;
|
|
63
|
+
cursor: pointer;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.Pendiente, .Enviada {
|
|
67
|
+
background-color: #FFA757;
|
|
68
|
+
color: white;
|
|
69
|
+
padding: 8px 16px;
|
|
70
|
+
border-radius: 20px;
|
|
71
|
+
border: none;
|
|
72
|
+
font-size: 16px;
|
|
73
|
+
font-weight: bold;
|
|
74
|
+
text-align: center;
|
|
75
|
+
display: inline-block;
|
|
76
|
+
cursor: pointer;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.Formalizado, .Procesando, .Borrador {
|
|
80
|
+
background-color: rgb(163, 156, 156);
|
|
81
|
+
color: white;
|
|
82
|
+
padding: 8px 16px;
|
|
83
|
+
border-radius: 20px;
|
|
84
|
+
border: none;
|
|
85
|
+
font-size: 16px;
|
|
86
|
+
font-weight: bold;
|
|
87
|
+
text-align: center;
|
|
88
|
+
display: inline-block;
|
|
89
|
+
cursor: pointer;
|
|
90
|
+
}
|
|
91
|
+
.Tramitando, .revisión {
|
|
92
|
+
background-color: #F87600;
|
|
93
|
+
color: white;
|
|
94
|
+
padding: 8px 16px;
|
|
95
|
+
border-radius: 20px;
|
|
96
|
+
border: none;
|
|
97
|
+
font-size: 16px;
|
|
98
|
+
font-weight: bold;
|
|
99
|
+
text-align: center;
|
|
100
|
+
display: inline-block;
|
|
101
|
+
cursor: pointer;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.Tramitada, .Detenida {
|
|
105
|
+
background-color: #FDC652;
|
|
106
|
+
color: white;
|
|
107
|
+
padding: 8px 16px;
|
|
108
|
+
border-radius: 20px;
|
|
109
|
+
border: none;
|
|
110
|
+
font-size: 16px;
|
|
111
|
+
font-weight: bold;
|
|
112
|
+
text-align: center;
|
|
113
|
+
display: inline-block;
|
|
114
|
+
cursor: pointer;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.Recibido, .Espera, .Revisión {
|
|
118
|
+
background-color: #0069B4;
|
|
119
|
+
color: white;
|
|
120
|
+
padding: 8px 16px;
|
|
121
|
+
border-radius: 20px;
|
|
122
|
+
border: none;
|
|
123
|
+
font-size: 16px;
|
|
124
|
+
font-weight: bold;
|
|
125
|
+
text-align: center;
|
|
126
|
+
display: inline-block;
|
|
127
|
+
cursor: pointer;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.Rechazado, .Rechazada, .Excedido, .Cancelada, .Cancelado, .Fallida {
|
|
131
|
+
background-color: #F82617;
|
|
132
|
+
color: white;
|
|
133
|
+
padding: 8px 16px;
|
|
134
|
+
border-radius: 20px;
|
|
135
|
+
border: none;
|
|
136
|
+
font-size: 16px;
|
|
137
|
+
font-weight: bold;
|
|
138
|
+
text-align: center;
|
|
139
|
+
display: inline-block;
|
|
140
|
+
cursor: pointer;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.Aplicando {
|
|
144
|
+
background-color: #76B82A;
|
|
145
|
+
color: white;
|
|
146
|
+
padding: 8px 16px;
|
|
147
|
+
border-radius: 20px;
|
|
148
|
+
border: none;
|
|
149
|
+
font-size: 16px;
|
|
150
|
+
font-weight: bold;
|
|
151
|
+
text-align: center;
|
|
152
|
+
display: inline-block;
|
|
153
|
+
cursor: pointer;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.Aplicada {
|
|
157
|
+
background-color: #007270;
|
|
158
|
+
color: white;
|
|
159
|
+
padding: 8px 16px;
|
|
160
|
+
border-radius: 20px;
|
|
161
|
+
border: none;
|
|
162
|
+
font-size: 16px;
|
|
163
|
+
font-weight: bold;
|
|
164
|
+
text-align: center;
|
|
165
|
+
display: inline-block;
|
|
166
|
+
cursor: pointer;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
table {
|
|
170
|
+
width: 100%;
|
|
171
|
+
border: 1px solid #00000057;
|
|
172
|
+
border-radius: 8px;
|
|
173
|
+
background: white;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
table td {
|
|
177
|
+
border-bottom: 1px solid #e0e0e0;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
table th {
|
|
181
|
+
border-bottom: 1px solid #ec0202;
|
|
182
|
+
text-align: center;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
.azul {
|
|
187
|
+
color: blue;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.rojo {
|
|
191
|
+
color: red;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
.verde {
|
|
195
|
+
color: green;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
.marino {
|
|
199
|
+
color: #0069B4;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
.verdeoscuro {
|
|
203
|
+
color: darkgreen;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
tr.example-detail-row {
|
|
207
|
+
height: 0;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
tr.example-element-row:not(.example-expanded-row):hover {
|
|
211
|
+
background: whitesmoke;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
tr.example-element-row:not(.example-expanded-row):active {
|
|
215
|
+
background: #efefef;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
.example-element-detail {
|
|
219
|
+
overflow: hidden;
|
|
220
|
+
display: flex;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
.separador {
|
|
224
|
+
margin-top: 10px;
|
|
225
|
+
margin-bottom: 10px;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
tr.example-element-row:hover {
|
|
229
|
+
filter: brightness(0.9); /* Oscurece un poco el color de fondo al pasar el mouse */
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
/* --- Ajustes para Mobile (Pantallas menores a 768px) --- */
|
|
233
|
+
@media (max-width: 768px) {
|
|
234
|
+
|
|
235
|
+
/* 1. Forzar a la tabla a dejar de comportarse como tal */
|
|
236
|
+
.mat-mdc-table {
|
|
237
|
+
display: block !important;
|
|
238
|
+
background: transparent !important;
|
|
239
|
+
border: none !important;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
/* Ocultar el encabezado por completo */
|
|
243
|
+
.mat-mdc-header-row {
|
|
244
|
+
display: none !important;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
/* 2. Convertir cada FILA en una tarjeta blanca separada */
|
|
248
|
+
.mat-mdc-row {
|
|
249
|
+
display: block !important;
|
|
250
|
+
background: white;
|
|
251
|
+
border-radius: 10px !important;
|
|
252
|
+
margin-bottom: 20px !important;
|
|
253
|
+
padding: 15px !important;
|
|
254
|
+
box-shadow: 0 4px 6px rgba(0,0,0,0.1) !important;
|
|
255
|
+
height: auto !important;
|
|
256
|
+
border: 1px solid #eee !important;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
/* 3. Convertir cada CELDA en una línea con espacio entre nombre y valor */
|
|
260
|
+
.mat-mdc-cell {
|
|
261
|
+
display: flex !important;
|
|
262
|
+
justify-content: space-between !important;
|
|
263
|
+
align-items: center !important;
|
|
264
|
+
border: none !important;
|
|
265
|
+
padding: 10px 0 !important;
|
|
266
|
+
width: 100% !important;
|
|
267
|
+
min-height: 40px !important;
|
|
268
|
+
text-align: right !important;
|
|
269
|
+
box-sizing: border-box !important;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
/* 4. Crear el "Label" para cada celda dinámicamente */
|
|
273
|
+
.mat-mdc-cell::before {
|
|
274
|
+
content: attr(data-label);
|
|
275
|
+
font-weight: bold;
|
|
276
|
+
text-align: left;
|
|
277
|
+
color: #666;
|
|
278
|
+
flex: 1;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
/* 5. Ajustar acciones */
|
|
282
|
+
.mat-column-acciones {
|
|
283
|
+
justify-content: center !important;
|
|
284
|
+
border-top: 1px solid #f0f0f0 !important;
|
|
285
|
+
margin-top: 10px !important;
|
|
286
|
+
padding-top: 15px !important;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
/* 6. Ajustes de Filtros y Encabezado (NUEVA VERSIÓN) */
|
|
290
|
+
.encabezado {
|
|
291
|
+
flex-direction: column !important;
|
|
292
|
+
gap: 15px !important;
|
|
293
|
+
padding: 0 10px;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
.izquierda, .derecha {
|
|
297
|
+
width: 100% !important;
|
|
298
|
+
flex-direction: column !important;
|
|
299
|
+
gap: 10px !important; /* Espacio uniforme entre elementos */
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
/* Forzamos que Input, Select y Botón sean idénticos en ancho */
|
|
303
|
+
.custom-input,
|
|
304
|
+
mat-select.custom-input,
|
|
305
|
+
.descargar {
|
|
306
|
+
width: 100% !important;
|
|
307
|
+
min-width: 100% !important;
|
|
308
|
+
max-width: 100% !important;
|
|
309
|
+
box-sizing: border-box !important;
|
|
310
|
+
margin: 0 !important;
|
|
311
|
+
height: 45px !important; /* Altura uniforme para mejor tacto */
|
|
312
|
+
display: flex !important;
|
|
313
|
+
align-items: center !important;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
/* Ajuste específico para que el texto dentro del select no se corte */
|
|
317
|
+
::ng-deep .mat-mdc-select-trigger {
|
|
318
|
+
width: 100% !important;
|
|
319
|
+
padding: 0 5px !important;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
/* 7. Ajustar Paginador */
|
|
323
|
+
::ng-deep .mat-mdc-paginator-container {
|
|
324
|
+
flex-wrap: wrap !important;
|
|
325
|
+
justify-content: center !important;
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
/* Ocultar la fila de detalle si no está expandida */
|
|
329
|
+
.detalle-oculto {
|
|
330
|
+
display: none !important;
|
|
331
|
+
}
|
|
332
|
+
}
|