@ -12,6 +12,9 @@ import com.vaadin.flow.component.textfield.TextField;
import com.vaadin.flow.router.PageTitle ;
import com.vaadin.flow.router.PageTitle ;
import com.vaadin.flow.router.Route ;
import com.vaadin.flow.router.Route ;
import jakarta.annotation.security.PermitAll ;
import jakarta.annotation.security.PermitAll ;
import mx.gob.jumapacelaya.services.DatabaseService ;
import java.util.List ;
@PermitAll
@PermitAll
@ -20,10 +23,12 @@ import jakarta.annotation.security.PermitAll;
public class MantenimientoView extends VerticalLayout {
public class MantenimientoView extends VerticalLayout {
public MantenimientoView ( ) {
public MantenimientoView ( ) {
DatabaseService databaseService = new DatabaseService ( ) ;
/ / Componentes de texto
/ / Componentes de texto
TextField nomenclatura = new TextField ( "Nomenclatura" ) ;
TextField nomenclatura = new TextField ( "Nomenclatura" ) ;
nomenclatura . setReadOnly ( true ) ;
nomenclatura . setReadOnly ( true ) ;
TextArea otras = new TextArea ( "¿Cuales?" ) ;
TextArea otras = new TextArea ( "¿Cuales?" ) ;
otras . setEnabled ( false ) ;
otras . setEnabled ( false ) ;
@ -34,12 +39,23 @@ public class MantenimientoView extends VerticalLayout {
/ / ComboBox
/ / ComboBox
ComboBox < String > area = new ComboBox ( "Area o Departamento" ) ;
ComboBox < String > area = new ComboBox ( "Area o Departamento" ) ;
area . setItems ( "T.I" , "Catastro" , "Medicion" ) ; / / Areas de ejemplo
area . setItems ( "T.I" , "Catastro" , "Medicion" ) ; / / Areas de ejemplo
ComboBox < String > tipoMantt = new ComboBox < > ( "Tipo de Mantenimiento" ) ;
ComboBox < String > tipoMantt = new ComboBox < > ( "Tipo de Mantenimiento" ) ;
tipoMantt . setItems ( "Preventivo" , "Correctivo" ) ; / / Esto a futuro debera traer los tipos de mantenimiento directo de la BD
List < String > tiposDeMantenimiento = databaseService . getTiposDeMantenimientos ( ) ;
tipoMantt . setItems ( tiposDeMantenimiento ) ;
tipoMantt . addValueChangeListener ( event - > {
String tipoSeleccionado = event . getValue ( ) ;
if ( tipoSeleccionado ! = null ) {
String nomenclaturaValue = databaseService . getNomenclatura ( tipoSeleccionado ) ;
nomenclatura . setValue ( nomenclaturaValue ) ;
} else {
nomenclatura . clear ( ) ;
}
} ) ;
ComboBox < String > usuario = new ComboBox ( "Usuario" ) ;
ComboBox < String > usuario = new ComboBox ( "Usuario" ) ;
usuario . setItems ( "Usuario1" , "Usuario2" , "Usuario3" ) ;
usuario . setItems ( "Usuario1" , "Usuario2" , "Usuario3" ) ;
/ * ComboBox < String > tipoEquipo = new ComboBox < > ( "Tipo de Equipo" ) ;
tipoEquipo . setItems ( "Laptop" , "Escritorio" ) ; * /
/ / CheckBoxes LIMPIEZA DE EQUIPO
/ / CheckBoxes LIMPIEZA DE EQUIPO
CheckboxGroup < String > limpiezaEq = new CheckboxGroup < > ( ) ;
CheckboxGroup < String > limpiezaEq = new CheckboxGroup < > ( ) ;