diff --git a/src/main/bundles/dev.bundle b/src/main/bundles/dev.bundle index 4815a84..bd01910 100644 Binary files a/src/main/bundles/dev.bundle and b/src/main/bundles/dev.bundle differ diff --git a/src/main/bundles/prod.bundle b/src/main/bundles/prod.bundle index b3a8225..ddefb70 100644 Binary files a/src/main/bundles/prod.bundle and b/src/main/bundles/prod.bundle differ diff --git a/src/main/frontend/themes/sistema-mantenimiento/styles.css b/src/main/frontend/themes/sistema-mantenimiento/styles.css index d5b28db..c806e58 100644 --- a/src/main/frontend/themes/sistema-mantenimiento/styles.css +++ b/src/main/frontend/themes/sistema-mantenimiento/styles.css @@ -275,3 +275,20 @@ vaadin-popover-overlay::part(overlay) { border-radius: 12px; box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); } + + + +@media (max-width: 900px) { + .v-horizontallayout { + flex-direction: column !important; + align-items: stretch !important; + } + .mantenimiento-text-field, + .mantenimiento-combo, + vaadin-text-field, + vaadin-combo-box { + min-width: 0; + width: 100% !important; + box-sizing: border-box; + } +} diff --git a/src/main/java/mx/gob/jumapacelaya/ui/DetallesMantView.java b/src/main/java/mx/gob/jumapacelaya/ui/DetallesMantView.java index 5bb8c8d..a2b404e 100644 --- a/src/main/java/mx/gob/jumapacelaya/ui/DetallesMantView.java +++ b/src/main/java/mx/gob/jumapacelaya/ui/DetallesMantView.java @@ -8,7 +8,9 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import com.vaadin.flow.component.UI; import com.vaadin.flow.component.html.Anchor; +import com.vaadin.flow.server.StreamRegistration; import com.vaadin.flow.server.StreamResource; import mx.gob.jumapacelaya.services.ReportService; import org.springframework.security.core.Authentication; @@ -282,14 +284,17 @@ public class DetallesMantView extends VerticalLayout implements BeforeEnterObser // Se crea el recurso para descarga StreamResource resource = new StreamResource("reporte.pdf", () -> new ByteArrayInputStream(pdf)); - Anchor downloadLink = new Anchor(resource, "Descargar Reporte"); + /*Anchor downloadLink = new Anchor(resource, "Descargar Reporte"); downloadLink.setTarget("_blank"); downloadLink.setId("descargar-reporte-link"); add(downloadLink); getUI().ifPresent(ui -> ui.getPage().executeJs("document.getElementById('descargar-reporte-link').click();") - ); + );*/ + + StreamRegistration registration = UI.getCurrent().getSession().getResourceRegistry().registerResource(resource); + UI.getCurrent().getPage().executeJs("window.open('" + registration.getResourceUri().toString() + "','_blank')"); } catch (Exception ex) { Notification.show("Error al generar el reporte: " + ex.getMessage(), 4000, Notification.Position.MIDDLE) diff --git a/src/main/java/mx/gob/jumapacelaya/ui/MantenimientoView.java b/src/main/java/mx/gob/jumapacelaya/ui/MantenimientoView.java index 2154e7d..2b5dd8c 100644 --- a/src/main/java/mx/gob/jumapacelaya/ui/MantenimientoView.java +++ b/src/main/java/mx/gob/jumapacelaya/ui/MantenimientoView.java @@ -76,6 +76,7 @@ public class MantenimientoView extends VerticalLayout implements BeforeEnterObse private LocalDate fechaProgramada; private LocalDate fechaSeleccionada; private TextArea jsutificacion; + private VerticalLayout mainLayout; Span userSignSpan = new Span("Nombre Usuario"); @@ -92,6 +93,15 @@ public class MantenimientoView extends VerticalLayout implements BeforeEnterObse this.userService = userService; this.emailService = emailService; + mainLayout = new VerticalLayout(); + mainLayout.setHeightFull(); + mainLayout.getStyle() + .set("box-shadow","0 4px 8px rgba(0,0,0,0.2)") + .set("border-radius", "12px") + .set("background-color", "white") + .set("padding", "1rem") + .set("margin", "1rem auto"); + HorizontalLayout fechaLayout = new HorizontalLayout(); //Componentes de texto TextField nomenclatura = new TextField("Nomenclatura"); @@ -211,7 +221,8 @@ public class MantenimientoView extends VerticalLayout implements BeforeEnterObse buttons(); - add(fechaLayout, departamentoLayout, controlsLayout, actualizacionesLayout, etiquetaLayout, firmasLayout, botonesLayout); + mainLayout.add(fechaLayout, departamentoLayout, controlsLayout, actualizacionesLayout, etiquetaLayout, firmasLayout, botonesLayout); + add(mainLayout); } @@ -451,7 +462,7 @@ public class MantenimientoView extends VerticalLayout implements BeforeEnterObse smtSignPad.setHeight("200px"); smtSignPad.setBackgroundColor("#FFFFFF"); smtSignPad.setPenColor("#000000"); - smtSignPad.getElement().getStyle().set("border", "2px solid black"); + smtSignPad.getElement().getStyle().set("border", "1px solid black"); String u = securityService.getAuthenticatedUser(); Span smtSignSpan = new Span(u); Span tituloSMT = new Span("Responsable de Soporte"); @@ -475,8 +486,9 @@ public class MantenimientoView extends VerticalLayout implements BeforeEnterObse firmasLayout.add(userSignLayout, smtSignLayout, gcialSignLayout); - firmasLayout.setSizeFull(); + firmasLayout.setWidthFull(); firmasLayout.setSpacing(false); + firmasLayout.setJustifyContentMode(JustifyContentMode.CENTER); } diff --git a/src/main/java/mx/gob/jumapacelaya/ui/PlanAnualView.java b/src/main/java/mx/gob/jumapacelaya/ui/PlanAnualView.java index 11dc8a8..69fbe5e 100644 --- a/src/main/java/mx/gob/jumapacelaya/ui/PlanAnualView.java +++ b/src/main/java/mx/gob/jumapacelaya/ui/PlanAnualView.java @@ -1,6 +1,7 @@ package mx.gob.jumapacelaya.ui; import com.vaadin.flow.component.Component; +import com.vaadin.flow.component.UI; import com.vaadin.flow.component.button.Button; import com.vaadin.flow.component.button.ButtonVariant; import com.vaadin.flow.component.checkbox.Checkbox; @@ -33,6 +34,7 @@ import com.vaadin.flow.data.value.ValueChangeMode; import com.vaadin.flow.function.ValueProvider; import com.vaadin.flow.router.PageTitle; import com.vaadin.flow.router.Route; +import com.vaadin.flow.server.StreamRegistration; import com.vaadin.flow.server.StreamResource; import jakarta.annotation.security.PermitAll; import mx.gob.jumapacelaya.models.PlanAnual; @@ -593,14 +595,17 @@ public class PlanAnualView extends VerticalLayout { // Creando el recurso de descarga StreamResource resource = new StreamResource("reporte.pdf", () -> new ByteArrayInputStream(pdf)); - Anchor downloadLink = new Anchor(resource, "Descargar Reporte"); + /*Anchor downloadLink = new Anchor(resource, "Descargar Reporte"); downloadLink.setTarget("_blank"); downloadLink.setId("descargar-reporte-link"); add(downloadLink); getUI().ifPresent(ui -> ui.getPage().executeJs("document.getElementById('descargar-reporte-link').click();") - ); + );*/ + + StreamRegistration registration = UI.getCurrent().getSession().getResourceRegistry().registerResource(resource); + UI.getCurrent().getPage().executeJs("window.open('" + registration.getResourceUri().toString() + "','_blank')"); } catch (Exception ex) { @@ -805,14 +810,17 @@ public class PlanAnualView extends VerticalLayout { // Creando el recurso de descarga StreamResource resource = new StreamResource("listado_mantenimientos.pdf", () -> new ByteArrayInputStream(pdf)); - Anchor downloadLink = new Anchor(resource, "Descargar Reporte"); + /*Anchor downloadLink = new Anchor(resource, "Descargar Reporte"); downloadLink.setTarget("_blank"); downloadLink.setId("descargar-listado-link"); add(downloadLink); getUI().ifPresent(ui -> ui.getPage().executeJs("document.getElementById('descargar-listado-link').click();") - ); + );*/ + + StreamRegistration registration = UI.getCurrent().getSession().getResourceRegistry().registerResource(resource); + UI.getCurrent().getPage().executeJs("window.open('" + registration.getResourceUri().toString() + "','_blank')"); } catch (Exception ex) { Notification.show("Error al generar el reporte: " + ex.getMessage(), 5000, Notification.Position.MIDDLE) diff --git a/src/main/resources/META-INF/resources/reportes/listadoMantenimientos.jasper b/src/main/resources/META-INF/resources/reportes/listadoMantenimientos.jasper index 7238b84..8b2a21f 100644 Binary files a/src/main/resources/META-INF/resources/reportes/listadoMantenimientos.jasper and b/src/main/resources/META-INF/resources/reportes/listadoMantenimientos.jasper differ