Browse Source

Se corrigio un error con la clase downloadLink que iba acumulando links con los reportes anteriores y se confundian, tambien se cambio el reporte de listado ahora mostrando incluso los que aun no se han hecho, dentro y fuera de tiempo, asi como el porcentaje de efectividad del periodo

main
mramirezg 2 days ago
parent
commit
c8308ef18a
7 changed files with 51 additions and 9 deletions
  1. BIN
      src/main/bundles/dev.bundle
  2. BIN
      src/main/bundles/prod.bundle
  3. +17
    -0
      src/main/frontend/themes/sistema-mantenimiento/styles.css
  4. +7
    -2
      src/main/java/mx/gob/jumapacelaya/ui/DetallesMantView.java
  5. +15
    -3
      src/main/java/mx/gob/jumapacelaya/ui/MantenimientoView.java
  6. +12
    -4
      src/main/java/mx/gob/jumapacelaya/ui/PlanAnualView.java
  7. BIN
      src/main/resources/META-INF/resources/reportes/listadoMantenimientos.jasper

BIN
src/main/bundles/dev.bundle View File


BIN
src/main/bundles/prod.bundle View File


+ 17
- 0
src/main/frontend/themes/sistema-mantenimiento/styles.css View File

@ -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;
}
}

+ 7
- 2
src/main/java/mx/gob/jumapacelaya/ui/DetallesMantView.java View File

@ -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)


+ 15
- 3
src/main/java/mx/gob/jumapacelaya/ui/MantenimientoView.java View File

@ -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);
}


+ 12
- 4
src/main/java/mx/gob/jumapacelaya/ui/PlanAnualView.java View File

@ -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)


BIN
src/main/resources/META-INF/resources/reportes/listadoMantenimientos.jasper View File


Loading…
Cancel
Save