From 4c5db559a606c6b4c40b58eee3b41120221e6cc5 Mon Sep 17 00:00:00 2001 From: IO420 <320154041@pcpuma.acatlan.unam.mx> Date: Tue, 11 Nov 2025 13:56:54 -0600 Subject: [PATCH 1/4] fixed editar --- src/app/(Operador)/escaner/page.tsx | 5 +++-- src/components/Editar.tsx | 17 +++++++++++------ 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/app/(Operador)/escaner/page.tsx b/src/app/(Operador)/escaner/page.tsx index 2105340..3860d17 100644 --- a/src/app/(Operador)/escaner/page.tsx +++ b/src/app/(Operador)/escaner/page.tsx @@ -29,10 +29,11 @@ export default function Page() { if (data) { router.push(`/editar?equipoId=${data.inventario}`); } else { - toast.error("Equipo no encontrado"); + router.push(`/agregarEquipo?equipoId=${data.inventario}`); } } catch (error) { - toast.error(`Equipo no encontrado,${error}`); + toast.error("Error No se encontro el equipo"); + router.push(`/agregarEquipo?equipoId=${search}`); } }; diff --git a/src/components/Editar.tsx b/src/components/Editar.tsx index 8249854..81a291d 100644 --- a/src/components/Editar.tsx +++ b/src/components/Editar.tsx @@ -88,6 +88,7 @@ export default function Editar() { const [procesadores, setProcesadores] = useState([]); const [perifericos, setPerifericos] = useState([]); const [adscripcionLabel, setAdscripcionLabel] = useState(""); + const [id, setId] = useState(0); const [suggestions, setSuggestions] = useState({ adscripcion: [] as string[], @@ -234,6 +235,7 @@ export default function Editar() { }); setAdscripcionLabel(equipo.adscripcion?.adscripcion); + setId(equipo.id_equipo); } catch (error) { console.error("Error al obtener el equipo:", error); toast.error("No se pudo cargar la información del equipo."); @@ -283,7 +285,7 @@ export default function Editar() { const handleGuardar = async () => { - + if (!formData.inventario) { toast.error("Inventario no encontrado"); return; @@ -321,7 +323,7 @@ export default function Editar() { } } - if(formData.id_tipo_equipo != 8 && formData.id_tipo_equipo != 7 && formData.id_tipo_equipo != 9){ + if (formData.id_tipo_equipo != 8 && formData.id_tipo_equipo != 7 && formData.id_tipo_equipo != 9) { if (!formData.id_sistema_operativo) { toast.error("Sistema operativo no encontrado "); return; @@ -339,6 +341,7 @@ export default function Editar() { const headers = { Authorization: `Bearer ${token}` }; const data = { + id_procesador:formData.id_procesador, id_estado: formData.id_estado, id_adscripcion: formData.id_adscripcion, lugar: formData.lugar, @@ -352,7 +355,7 @@ export default function Editar() { try { await axios.patch( - `${api_url}/equipos/update/${formData.inventario}`, + `${api_url}/equipos/update/${id}`, data, { headers, @@ -426,9 +429,8 @@ export default function Editar() { const first = data[0]; setFormData((prev) => ({ ...prev, - responsable: `${first.nombre ?? ""} ${ - first.apellidos ?? "" - }`.trim(), + responsable: `${first.nombre ?? ""} ${first.apellidos ?? "" + }`.trim(), })); } else { toast.error( @@ -513,6 +515,8 @@ export default function Editar() {
Date: Tue, 11 Nov 2025 17:51:13 -0600 Subject: [PATCH 2/4] Actualizacion de vista Reporte --- src/app/(Administrador)/pregunta1/page.tsx | 172 ++---------------- .../{pregunta1.1 => pregunta1_1}/page.tsx | 0 .../{pregunta1.2 => pregunta1_2}/page.tsx | 0 .../{pregunta1.2 => pregunta1_2}/page1.css | 0 .../{pregunta2.1 => pregunta2_1}/page.tsx | 0 .../{pregunta2.1 => pregunta2_1}/page2.css | 0 .../{pregunta3.1 => pregunta3_1}/page.tsx | 0 .../{pregunta3.1 => pregunta3_1}/page3.1.css | 0 .../{pregunta3.2 => pregunta3_2}/page.tsx | 0 .../{pregunta3.2 => pregunta3_2}/page3.2.css | 0 .../{pregunta3.3 => pregunta3_3}/page.tsx | 0 .../{pregunta3.3 => pregunta3_3}/page3.3.css | 0 .../{pregunta3.4 => pregunta3_4}/page.tsx | 0 .../{pregunta3.4 => pregunta3_4}/page3.4.css | 0 .../{pregunta3.5 => pregunta3_5}/page.tsx | 0 .../{pregunta3.5 => pregunta3_5}/page3.5.css | 0 .../{pregunta7.1 => pregunta7_1}/page.tsx | 0 .../pregunta7.css | 0 .../(Administrador)/pregunta9/pregunta9.css | 1 - src/app/(Administrador)/reporte/page.tsx | 155 ++++++++-------- .../(Administrador)/reporteNOValido/page.tsx | 93 ++++++++++ .../{reporte => reporteNOValido}/reporte.css | 0 src/app/styles/layout/pregunta1.scss | 31 +--- src/app/styles/layout/reporte.scss | 75 ++++++++ src/components/Preguanta1.tsx | 116 ++++++++++++ src/components/Pregunta2.tsx | 158 ++++++++++++++++ src/components/Pregunta9.tsx | 135 ++++++++++++++ src/components/pregunta2.scss | 166 +++++++++++++++++ src/components/pregunta9.css | 133 ++++++++++++++ 29 files changed, 969 insertions(+), 266 deletions(-) rename src/app/(Administrador)/{pregunta1.1 => pregunta1_1}/page.tsx (100%) rename src/app/(Administrador)/{pregunta1.2 => pregunta1_2}/page.tsx (100%) rename src/app/(Administrador)/{pregunta1.2 => pregunta1_2}/page1.css (100%) rename src/app/(Administrador)/{pregunta2.1 => pregunta2_1}/page.tsx (100%) rename src/app/(Administrador)/{pregunta2.1 => pregunta2_1}/page2.css (100%) rename src/app/(Administrador)/{pregunta3.1 => pregunta3_1}/page.tsx (100%) rename src/app/(Administrador)/{pregunta3.1 => pregunta3_1}/page3.1.css (100%) rename src/app/(Administrador)/{pregunta3.2 => pregunta3_2}/page.tsx (100%) rename src/app/(Administrador)/{pregunta3.2 => pregunta3_2}/page3.2.css (100%) rename src/app/(Administrador)/{pregunta3.3 => pregunta3_3}/page.tsx (100%) rename src/app/(Administrador)/{pregunta3.3 => pregunta3_3}/page3.3.css (100%) rename src/app/(Administrador)/{pregunta3.4 => pregunta3_4}/page.tsx (100%) rename src/app/(Administrador)/{pregunta3.4 => pregunta3_4}/page3.4.css (100%) rename src/app/(Administrador)/{pregunta3.5 => pregunta3_5}/page.tsx (100%) rename src/app/(Administrador)/{pregunta3.5 => pregunta3_5}/page3.5.css (100%) rename src/app/(Administrador)/{pregunta7.1 => pregunta7_1}/page.tsx (100%) rename src/app/(Administrador)/{pregunta7.1 => pregunta7_1}/pregunta7.css (100%) create mode 100644 src/app/(Administrador)/reporteNOValido/page.tsx rename src/app/(Administrador)/{reporte => reporteNOValido}/reporte.css (100%) create mode 100644 src/app/styles/layout/reporte.scss create mode 100644 src/components/Preguanta1.tsx create mode 100644 src/components/Pregunta2.tsx create mode 100644 src/components/Pregunta9.tsx create mode 100644 src/components/pregunta2.scss create mode 100644 src/components/pregunta9.css diff --git a/src/app/(Administrador)/pregunta1/page.tsx b/src/app/(Administrador)/pregunta1/page.tsx index 97ea191..9f6eea1 100644 --- a/src/app/(Administrador)/pregunta1/page.tsx +++ b/src/app/(Administrador)/pregunta1/page.tsx @@ -1,161 +1,15 @@ -"use client"; +"use client" +import React from "react"; +import Pregunta1 from "@/components/Preguanta1"; +import Pregunta2 from "@/components/Pregunta2"; -import { useState, useEffect } from "react"; -import "../../styles/layout/pregunta1.scss"; - -// Tipos -type OsEntry = { - os: string; - count: string; // o number si la API devuelve números - isTotal?: boolean; -}; - -type PlatformData = { - [key: string]: OsEntry[]; -}; - -// === DATOS TEMPORALES (mock) === -const MOCK_DATA: PlatformData = { - "pc-desktop": [ - { os: "Windows 11", count: "408" }, - { os: "Windows 10", count: "1171" }, - { os: "Windows 7/8", count: "177" }, - { os: "Windows XP/Vista", count: "43" }, - { os: "Linux", count: "45" }, - { os: "Total", count: "1844", isTotal: true }, - ], - "apple-desktop": [ - { os: "Mac OS X(13 - Ventura, 14 - Sonoma)", count: "205" }, - { - os: "Mac OS X(Mojave,Catalina,11 - Big Sur, 12 - Monterrey)", - count: "180", - }, - { os: "Mac OS X(Yosemite,El Capitan,Sierra,High Sierra)", count: "95" }, - { os: "Mac OS X(Snow Leopard,Mountain Lion,Mavericks)", count: "6" }, - { os: "Total", count: "480", isTotal: true }, - ], - "pc-laptop": [ - { os: "Windows 11", count: "40" }, - { os: "Windows 10", count: "171" }, - { os: "Windows 7/8", count: "17" }, - { os: "Windows XP/Vista", count: "3" }, - { os: "Linux", count: "5" }, - { os: "Total", count: "144", isTotal: true }, - ], - "apple-laptop": [ - { os: "Mac OS X(13 - Ventura, 14 - Sonoma)", count: "205" }, - { - os: "Mac OS X(Mojave,Catalina,11 - Big Sur, 12 - Monterrey)", - count: "180", - }, - { os: "Mac OS X(Yosemite,El Capitan,Sierra,High Sierra)", count: "95" }, - { os: "Mac OS X(Snow Leopard,Mountain Lion,Mavericks)", count: "6" }, - { os: "Total", count: "480", isTotal: true }, - ], - servers: [ - { - os: "Linux (CentOs,Fedora,Ubuntu,Red Hat Enterprise,entre otros)", - count: "120", - }, - { os: "Unix (AIX,MAC OS Server,Solaris,entre otros)", count: "80" }, - { os: "Windows Server 2022/2023", count: "50" }, - { os: "Windows Server 2016/2019", count: "80" }, - { os: "Windows Server 2008/2012", count: "50" }, - { os: "Windows Server 2000/2003", count: "12" }, - { os: "Total", count: "250", isTotal: true }, - ], -}; - -const API_ENDPOINT = "/api/platform-stats"; // ← ¡Reemplaza esto cuando sepas la URL real! - -const Page = () => { - const [activeTab, setActiveTab] = useState("pc-desktop"); - const [data, setData] = useState(MOCK_DATA); - const [loading, setLoading] = useState(true); - const [error, setError] = useState(null); - - useEffect(() => { - const fetchData = async () => { - try { - // === DESCOMENTA ESTO CUANDO TENGAS LA API === - // const response = await fetch(API_ENDPOINT); - // if (!response.ok) throw new Error('Error al cargar estadísticas'); - // const apiData: PlatformData = await response.json(); - // setData(apiData); - // setLoading(false); - - // === POR AHORA: usa datos simulados (y simula un retraso si quieres) === - // await new Promise(resolve => setTimeout(resolve, 300)); - setData(MOCK_DATA); - setLoading(false); - } catch (err) { - console.error("Error al cargar datos:", err); - setError( - "No se pudieron cargar las estadísticas. Usando datos temporales." - ); - setData(MOCK_DATA); // fallback en caso de error - setLoading(false); - } - }; - - fetchData(); - }, []); - - const currentData = data[activeTab] || []; - - // Si quisieras mostrar un estado de carga (opcional) - // if (loading) return

Cargando...

; - // if (error) console.warn(error); // o muestra un toast, etc. - - return ( -
-
-

Estadísticas de Plataformas

-
- -
-
-
- Presione cada pestaña para ver la información de las plataformas. -
- -
-
- {Object.entries({ - "pc-desktop": "Computadoras de escritorio Plataforma PC", - "apple-desktop": "Computadoras de escritorio Plataforma Apple", - "pc-laptop": "Computadoras portatiles Plataforma PC", - "apple-laptop": "Computadoras portatiles Plataforma Apple", - servers: "Servidores de alto rendimiento", - }).map(([key, label]) => ( -
setActiveTab(key)} - > - {label} -
- ))} -
- -
-
- {currentData.map((item, index) => ( -
-
{item.os}
-
{item.count}
-
- ))} -
-
-
-
-
-
+export default function Page(){ + return( + <> +

Reporte General de Preguntas

+ + + ); -}; - -export default Page; + +} \ No newline at end of file diff --git a/src/app/(Administrador)/pregunta1.1/page.tsx b/src/app/(Administrador)/pregunta1_1/page.tsx similarity index 100% rename from src/app/(Administrador)/pregunta1.1/page.tsx rename to src/app/(Administrador)/pregunta1_1/page.tsx diff --git a/src/app/(Administrador)/pregunta1.2/page.tsx b/src/app/(Administrador)/pregunta1_2/page.tsx similarity index 100% rename from src/app/(Administrador)/pregunta1.2/page.tsx rename to src/app/(Administrador)/pregunta1_2/page.tsx diff --git a/src/app/(Administrador)/pregunta1.2/page1.css b/src/app/(Administrador)/pregunta1_2/page1.css similarity index 100% rename from src/app/(Administrador)/pregunta1.2/page1.css rename to src/app/(Administrador)/pregunta1_2/page1.css diff --git a/src/app/(Administrador)/pregunta2.1/page.tsx b/src/app/(Administrador)/pregunta2_1/page.tsx similarity index 100% rename from src/app/(Administrador)/pregunta2.1/page.tsx rename to src/app/(Administrador)/pregunta2_1/page.tsx diff --git a/src/app/(Administrador)/pregunta2.1/page2.css b/src/app/(Administrador)/pregunta2_1/page2.css similarity index 100% rename from src/app/(Administrador)/pregunta2.1/page2.css rename to src/app/(Administrador)/pregunta2_1/page2.css diff --git a/src/app/(Administrador)/pregunta3.1/page.tsx b/src/app/(Administrador)/pregunta3_1/page.tsx similarity index 100% rename from src/app/(Administrador)/pregunta3.1/page.tsx rename to src/app/(Administrador)/pregunta3_1/page.tsx diff --git a/src/app/(Administrador)/pregunta3.1/page3.1.css b/src/app/(Administrador)/pregunta3_1/page3.1.css similarity index 100% rename from src/app/(Administrador)/pregunta3.1/page3.1.css rename to src/app/(Administrador)/pregunta3_1/page3.1.css diff --git a/src/app/(Administrador)/pregunta3.2/page.tsx b/src/app/(Administrador)/pregunta3_2/page.tsx similarity index 100% rename from src/app/(Administrador)/pregunta3.2/page.tsx rename to src/app/(Administrador)/pregunta3_2/page.tsx diff --git a/src/app/(Administrador)/pregunta3.2/page3.2.css b/src/app/(Administrador)/pregunta3_2/page3.2.css similarity index 100% rename from src/app/(Administrador)/pregunta3.2/page3.2.css rename to src/app/(Administrador)/pregunta3_2/page3.2.css diff --git a/src/app/(Administrador)/pregunta3.3/page.tsx b/src/app/(Administrador)/pregunta3_3/page.tsx similarity index 100% rename from src/app/(Administrador)/pregunta3.3/page.tsx rename to src/app/(Administrador)/pregunta3_3/page.tsx diff --git a/src/app/(Administrador)/pregunta3.3/page3.3.css b/src/app/(Administrador)/pregunta3_3/page3.3.css similarity index 100% rename from src/app/(Administrador)/pregunta3.3/page3.3.css rename to src/app/(Administrador)/pregunta3_3/page3.3.css diff --git a/src/app/(Administrador)/pregunta3.4/page.tsx b/src/app/(Administrador)/pregunta3_4/page.tsx similarity index 100% rename from src/app/(Administrador)/pregunta3.4/page.tsx rename to src/app/(Administrador)/pregunta3_4/page.tsx diff --git a/src/app/(Administrador)/pregunta3.4/page3.4.css b/src/app/(Administrador)/pregunta3_4/page3.4.css similarity index 100% rename from src/app/(Administrador)/pregunta3.4/page3.4.css rename to src/app/(Administrador)/pregunta3_4/page3.4.css diff --git a/src/app/(Administrador)/pregunta3.5/page.tsx b/src/app/(Administrador)/pregunta3_5/page.tsx similarity index 100% rename from src/app/(Administrador)/pregunta3.5/page.tsx rename to src/app/(Administrador)/pregunta3_5/page.tsx diff --git a/src/app/(Administrador)/pregunta3.5/page3.5.css b/src/app/(Administrador)/pregunta3_5/page3.5.css similarity index 100% rename from src/app/(Administrador)/pregunta3.5/page3.5.css rename to src/app/(Administrador)/pregunta3_5/page3.5.css diff --git a/src/app/(Administrador)/pregunta7.1/page.tsx b/src/app/(Administrador)/pregunta7_1/page.tsx similarity index 100% rename from src/app/(Administrador)/pregunta7.1/page.tsx rename to src/app/(Administrador)/pregunta7_1/page.tsx diff --git a/src/app/(Administrador)/pregunta7.1/pregunta7.css b/src/app/(Administrador)/pregunta7_1/pregunta7.css similarity index 100% rename from src/app/(Administrador)/pregunta7.1/pregunta7.css rename to src/app/(Administrador)/pregunta7_1/pregunta7.css diff --git a/src/app/(Administrador)/pregunta9/pregunta9.css b/src/app/(Administrador)/pregunta9/pregunta9.css index bf92392..5bc5cec 100644 --- a/src/app/(Administrador)/pregunta9/pregunta9.css +++ b/src/app/(Administrador)/pregunta9/pregunta9.css @@ -1,6 +1,5 @@ .contenedor-pregunta { padding: 20px; - font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif; background-color: #f9fafc; } diff --git a/src/app/(Administrador)/reporte/page.tsx b/src/app/(Administrador)/reporte/page.tsx index ce601e1..f9f26c3 100644 --- a/src/app/(Administrador)/reporte/page.tsx +++ b/src/app/(Administrador)/reporte/page.tsx @@ -1,92 +1,87 @@ "use client"; -import { useState } from "react"; -import "./reporte.css"; -import axios from "axios"; -export default function Page() { - const [report, setReport] = useState(); +import React, { useState } from "react"; +import Pregunta1 from "@/components/Preguanta1"; // Asegúrate que el nombre del archivo sea correcto +import Pregunta2 from "@/components/Pregunta2"; +import Pregunta9 from "@/components/Pregunta9"; +import "../../styles/layout/reporte.scss"; - async function Report() { - const res = await axios.get("https"); - setReport(res.data); - } +export default function Reporte() { + const [isOpen1, setIsOpen1] = useState(true); + const [isOpen2, setIsOpen2] = useState(true); + const [isOpen9, setIsOpen9] = useState(true); return ( -
- {/* Panel izquierdo: título, buscador y tabla */} -
-
-

REPORTE

+
+

Reporte General de Preguntas

+ +
+ {/* Pregunta 1 */} +
+
+ +
+
+ +
-
- - -
- -
- {/* Aquí irá tu tabla real */} -

Tabla de equipos...

-
-
- - {/* Panel derecho: filtros + botón descargar */} -
-
-
-

Filtro

-
- - - - - - - - - - - - - -
- - -
-
+ {/* Pregunta 2 */} +
+
+ +
+
+ +
- + {/* Pregunta 9 */} +
+
+ +
+
+ +
+
); -} +} \ No newline at end of file diff --git a/src/app/(Administrador)/reporteNOValido/page.tsx b/src/app/(Administrador)/reporteNOValido/page.tsx new file mode 100644 index 0000000..6cf87c7 --- /dev/null +++ b/src/app/(Administrador)/reporteNOValido/page.tsx @@ -0,0 +1,93 @@ +"use client"; +import { useState } from "react"; +import "./reporte.css"; +import axios from "axios"; +import Pregunta9 from "../pregunta9/page"; +export default function Page() { + const [report, setReport] = useState(); + + async function Report() { + const res = await axios.get("https"); + setReport(res.data); + } + + return ( +
+ {/* Panel izquierdo: título, buscador y tabla */} +
+
+

REPORTE

+
+ +
+ + +
+ +
+ {/* Aquí irá tu tabla real */} +

Tabla de equipos...

+
+
+ + {/* Panel derecho: filtros + botón descargar */} +
+
+
+

Filtro

+
+ + + + + + + + + + + + + +
+ + +
+ +
+ + +
+ +
+ ); +} diff --git a/src/app/(Administrador)/reporte/reporte.css b/src/app/(Administrador)/reporteNOValido/reporte.css similarity index 100% rename from src/app/(Administrador)/reporte/reporte.css rename to src/app/(Administrador)/reporteNOValido/reporte.css diff --git a/src/app/styles/layout/pregunta1.scss b/src/app/styles/layout/pregunta1.scss index dff448f..03bc614 100644 --- a/src/app/styles/layout/pregunta1.scss +++ b/src/app/styles/layout/pregunta1.scss @@ -7,33 +7,12 @@ background-color: #f4f4f4; } -.header { - display: flex; - justify-content: space-between; - align-items: center; - padding: 16px 24px; - background-color: #ffffff; - box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1); - position: sticky; - top: 0; - z-index: 10; - h2 { - margin: 0; - font-size: 1.5rem; - color: #0056b3; - } -} + .scanView { - flex: 1; - display: flex; - flex-direction: column; - align-items: center; - justify-content: flex-start; padding: 20px; width: 100%; - height: 100%; .container { width: 100%; @@ -55,9 +34,6 @@ color: #0056b3; text-align: center; font-weight: 500; - display: block; - box-shadow: none; - position: static; } .main-content { @@ -82,6 +58,9 @@ border-left: 4px solid transparent; font-size: 15px; font-weight: 500; + background: none; + border: none; + text-align: left; } .tab:hover { @@ -141,7 +120,7 @@ font-weight: bold; .count-box { - color:#0056b3; + color: #0056b3; } } } diff --git a/src/app/styles/layout/reporte.scss b/src/app/styles/layout/reporte.scss new file mode 100644 index 0000000..ee6730b --- /dev/null +++ b/src/app/styles/layout/reporte.scss @@ -0,0 +1,75 @@ +.accordion-content { + max-height: 0; + overflow: hidden; + transition: max-height 0.4s ease, opacity 0.4s ease; + opacity: 0; +} + +.accordion-content.open { + max-height: 1000px; /* Ajusta si tienes más contenido */ + opacity: 1; +} +.accordion-header-wrapper { + padding: 20px; +} + +.accordion-header { + background-color: #f5f5f5; + border:none; + width: 100%; + display: flex; + justify-content: space-between; + align-items: center; + background-color: #f5f5f5; + border-left: 6px solid #001f3f; + padding: 15px; + border-radius: 8px; + font-size: 16px; + cursor: pointer; + text-align: left; + transition: background-color 0.2s ease; + + &:hover { + background-color: #f0f2f5; + } + + .toggle-icon { + font-size: 14px; + color: #666; + transition: transform 0.3s ease; + display: inline-block; + width: 20px; + text-align: center; + } + + .toggle-icon.open { + transform: rotate(180deg); + } +} +.reporte-page { + .reporte-container { + padding: 40px; + background-color: #f9fafc; + } + + .titulo-reporte { + text-align: center; + font-size: 28px; + font-weight: bold; + color: #002855; + margin-bottom: 40px; + } + + .reporte-contenido { + display: flex; + flex-direction: column; + gap: 40px; + } + + .bloque-pregunta { + background-color: white; + border-radius: 12px; + box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1); + padding: 25px; + } +} diff --git a/src/components/Preguanta1.tsx b/src/components/Preguanta1.tsx new file mode 100644 index 0000000..d529a79 --- /dev/null +++ b/src/components/Preguanta1.tsx @@ -0,0 +1,116 @@ +"use client"; + +import { useState } from "react"; +import "../app/styles/layout/pregunta1.scss"; + +type OsEntry = { + os: string; + count: string; + isTotal?: boolean; +}; + +const MOCK_DATA = { + "pc-desktop": [ + { os: "Windows 11", count: "408" }, + { os: "Windows 10", count: "1171" }, + { os: "Windows 7/8", count: "177" }, + { os: "Windows XP/Vista", count: "43" }, + { os: "Linux", count: "45" }, + { os: "Total", count: "1844", isTotal: true }, + ], + "apple-desktop": [ + { os: "Mac OS X(13 - Ventura, 14 - Sonoma)", count: "205" }, + { + os: "Mac OS X(Mojave,Catalina,11 - Big Sur, 12 - Monterrey)", + count: "180", + }, + { os: "Mac OS X(Yosemite,El Capitan,Sierra,High Sierra)", count: "95" }, + { os: "Mac OS X(Snow Leopard,Mountain Lion,Mavericks)", count: "6" }, + { os: "Total", count: "480", isTotal: true }, + ], + "pc-laptop": [ + { os: "Windows 11", count: "40" }, + { os: "Windows 10", count: "171" }, + { os: "Windows 7/8", count: "17" }, + { os: "Windows XP/Vista", count: "3" }, + { os: "Linux", count: "5" }, + { os: "Total", count: "236", isTotal: true }, // corregido + ], + "apple-laptop": [ + { os: "Mac OS X(13 - Ventura, 14 - Sonoma)", count: "205" }, + { + os: "Mac OS X(Mojave,Catalina,11 - Big Sur, 12 - Monterrey)", + count: "180", + }, + { os: "Mac OS X(Yosemite,El Capitan,Sierra,High Sierra)", count: "95" }, + { os: "Mac OS X(Snow Leopard,Mountain Lion,Mavericks)", count: "6" }, + { os: "Total", count: "480", isTotal: true }, + ], + servers: [ + { + os: "Linux (CentOs,Fedora,Ubuntu,Red Hat Enterprise,entre otros)", + count: "120", + }, + { os: "Unix (AIX,MAC OS Server,Solaris,entre otros)", count: "80" }, + { os: "Windows Server 2022/2023", count: "50" }, + { os: "Windows Server 2016/2019", count: "80" }, + { os: "Windows Server 2008/2012", count: "50" }, + { os: "Windows Server 2000/2003", count: "12" }, + { os: "Total", count: "392", isTotal: true }, // corregido también + ], +}; + +const PLATFORM_LABELS: Record = { + "pc-desktop": "Computadoras de escritorio Plataforma PC", + "apple-desktop": "Computadoras de escritorio Plataforma Apple", + "pc-laptop": "Computadoras portátiles Plataforma PC", + "apple-laptop": "Computadoras portátiles Plataforma Apple", + servers: "Servidores de alto rendimiento", +}; + +const Pregunta1 = () => { + const [activeTab, setActiveTab] = + useState("pc-desktop"); + const currentData = MOCK_DATA[activeTab]; + + return ( +
+
+
+ Presione cada pestaña para ver la información de las plataformas. +
+ +
+
+ {Object.entries(PLATFORM_LABELS).map(([key, label]) => ( + + ))} +
+ +
+
+ {currentData.map((item, index) => ( +
+
{item.os}
+
{item.count}
+
+ ))} +
+
+
+
+
+ ); +}; + +export default Pregunta1; diff --git a/src/components/Pregunta2.tsx b/src/components/Pregunta2.tsx new file mode 100644 index 0000000..42b3e52 --- /dev/null +++ b/src/components/Pregunta2.tsx @@ -0,0 +1,158 @@ +"use client"; + +import { useState, useEffect } from "react"; +import "./pregunta2.scss"; + +// Tipos +type OsEntry = { + os: string; + count: string; // o number si la API devuelve números + isTotal?: boolean; +}; + +type PlatformData = { + [key: string]: OsEntry[]; +}; + +// === DATOS TEMPORALES (mock) === +const MOCK_DATA: PlatformData = { + "pc-desktop": [ + { os: "Windows 11", count: "408" }, + { os: "Windows 10", count: "1171" }, + { os: "Windows 7/8", count: "177" }, + { os: "Windows XP/Vista", count: "43" }, + { os: "Linux", count: "45" }, + { os: "Total", count: "1844", isTotal: true }, + ], + "apple-desktop": [ + { os: "Mac OS X(13 - Ventura, 14 - Sonoma)", count: "205" }, + { + os: "Mac OS X(Mojave,Catalina,11 - Big Sur, 12 - Monterrey)", + count: "180", + }, + { os: "Mac OS X(Yosemite,El Capitan,Sierra,High Sierra)", count: "95" }, + { os: "Mac OS X(Snow Leopard,Mountain Lion,Mavericks)", count: "6" }, + { os: "Total", count: "480", isTotal: true }, + ], + "pc-laptop": [ + { os: "Windows 11", count: "40" }, + { os: "Windows 10", count: "171" }, + { os: "Windows 7/8", count: "17" }, + { os: "Windows XP/Vista", count: "3" }, + { os: "Linux", count: "5" }, + { os: "Total", count: "144", isTotal: true }, + ], + "apple-laptop": [ + { os: "Mac OS X(13 - Ventura, 14 - Sonoma)", count: "39" }, + { + os: "Mac OS X(Mojave,Catalina,11 - Big Sur, 12 - Monterrey)", + count: "23", + }, + { os: "Mac OS X(Yosemite,El Capitan,Sierra,High Sierra)", count: "0" }, + { os: "Mac OS X(Snow Leopard,Mountain Lion,Mavericks)", count: "9" }, + { os: "Total", count: "71", isTotal: true }, + ], + servers: [ + { + os: "Linux (CentOs,Fedora,Ubuntu,Red Hat Enterprise,entre otros)", + count: "21", + }, + { os: "Unix (AIX,MAC OS Server,Solaris,entre otros)", count: "2" }, + { os: "Windows Server 2022/2023", count: "6" }, + { os: "Windows Server 2016/2019", count: "3" }, + { os: "Windows Server 2008/2012", count: "3" }, + { os: "Windows Server 2000/2003", count: "2" }, + { os: "Total", count: "37", isTotal: true }, + ], +}; + +const API_ENDPOINT = "/api/platform-stats"; // ← ¡Reemplaza esto cuando sepas la URL real! + +const Pregunta2= () => { + const [activeTab, setActiveTab] = useState("pc-desktop"); + const [data, setData] = useState(MOCK_DATA); + const [loading, setLoading] = useState(true); + const [error, setError] = useState(null); + + useEffect(() => { + const fetchData = async () => { + try { + // === DESCOMENTA ESTO CUANDO TENGAS LA API === + // const response = await fetch(API_ENDPOINT); + // if (!response.ok) throw new Error('Error al cargar estadísticas'); + // const apiData: PlatformData = await response.json(); + // setData(apiData); + // setLoading(false); + + // === POR AHORA: usa datos simulados (y simula un retraso si quieres) === + // await new Promise(resolve => setTimeout(resolve, 300)); + setData(MOCK_DATA); + setLoading(false); + } catch (err) { + console.error("Error al cargar datos:", err); + setError( + "No se pudieron cargar las estadísticas. Usando datos temporales." + ); + setData(MOCK_DATA); // fallback en caso de error + setLoading(false); + } + }; + + fetchData(); + }, []); + + const currentData = data[activeTab] || []; + + // Si quisieras mostrar un estado de carga (opcional) + // if (loading) return

Cargando...

; + // if (error) console.warn(error); // o muestra un toast, etc. + + return ( +
+ +
+
+
+ Presione cada pestaña para ver la información de las plataformas. +
+ +
+
+ {Object.entries({ + "pc-desktop": "Computadoras de escritorio Plataforma PC", + "apple-desktop": "Computadoras de escritorio Plataforma Apple", + "pc-laptop": "Computadoras portátiles Plataforma PC", + "apple-laptop": "Computadoras portátiles Plataforma Apple", + servers: "Servidores de alto rendimiento", + }).map(([key, label]) => ( +
setActiveTab(key)} + > + {label} +
+ ))} +
+ +
+
+ {currentData.map((item, index) => ( +
+
{item.os}
+
{item.count}
+
+ ))} +
+
+
+
+
+
+ ); +}; + +export default Pregunta2; diff --git a/src/components/Pregunta9.tsx b/src/components/Pregunta9.tsx new file mode 100644 index 0000000..6f0cfe2 --- /dev/null +++ b/src/components/Pregunta9.tsx @@ -0,0 +1,135 @@ +"use client"; +import React, { useState } from "react"; +import "./pregunta9.css"; + +export default function Pregunta9() { + + const [datos, setDatos] = useState([ + { nombre: "Computadoras de Escritorio", valores: ["", "", "", ""] }, + { nombre: "Computadoras Portátiles", valores: ["", "", "", ""] }, + { nombre: "Alto Rendimiento", valores: ["", "", "", ""] }, + ]); + + + const [garantia, setGarantia] = useState({ + escritorio: "", + portatil: "", + altoRendimiento: "", + }); + + // Función para actualizar datos de Pregunta 9 + const handleChange = (filaIndex: number, colIndex: number, value: string) => { + const nuevosDatos = [...datos]; + nuevosDatos[filaIndex].valores[colIndex] = value; + setDatos(nuevosDatos); + }; + + // Función para calcular total de cada fila en Pregunta 9 + const calcularTotal = (valores: string[]) => + valores.reduce((acc, val) => acc + (Number(val) || 0), 0); + + return ( +
+ {/* Pregunta 9 */} +
+ + + + + + + + + + + + + {datos.map((fila, filaIndex) => { + const total = calcularTotal(fila.valores); + return ( + + + {fila.valores.map((valor, colIndex) => ( + + ))} + + + ); + })} + +
% Antiguedad de los equiposMenor a 2 añosEntre 2 y 3 añosEntre 4 y 5 añosMayor a 6 añosTotal
{fila.nombre} +
+ + handleChange(filaIndex, colIndex, e.target.value) + } + /> + % +
+
100 ? "total-error" : "" + }`} + > + {total.toFixed(2)}% +
+
+ + {/* Pregunta 10 */} +
+ 10. ¿Cuántos equipos de cómputo tienen garantía de proveedor?. * +
+ +
+ + + + + + + + + + + + + + + +
Computadoras de Escritorio (247)Computadoras Portátiles (767)Alto Rendimiento (17)
+
+ + setGarantia({ ...garantia, escritorio: e.target.value }) + } + /> +
+
+
+ + setGarantia({ ...garantia, portatil: e.target.value }) + } + /> +
+
+
+ + setGarantia({ ...garantia, altoRendimiento: e.target.value }) + } + /> +
+
+
+
+ ); +} diff --git a/src/components/pregunta2.scss b/src/components/pregunta2.scss new file mode 100644 index 0000000..dff448f --- /dev/null +++ b/src/components/pregunta2.scss @@ -0,0 +1,166 @@ +.dashboardContainer { + display: flex; + flex-direction: column; + padding: 0; + margin: 0; + min-height: 100vh; + background-color: #f4f4f4; +} + +.header { + display: flex; + justify-content: space-between; + align-items: center; + padding: 16px 24px; + background-color: #ffffff; + box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1); + position: sticky; + top: 0; + z-index: 10; + + h2 { + margin: 0; + font-size: 1.5rem; + color: #0056b3; + } +} + +.scanView { + flex: 1; + display: flex; + flex-direction: column; + align-items: center; + justify-content: flex-start; + padding: 20px; + width: 100%; + height: 100%; + + .container { + width: 100%; + max-width: 900px; + background: #fff; + border-radius: 12px; + box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1); + overflow: hidden; + display: flex; + flex-direction: column; + border: 1px solid #ddd; + } + + .header { + padding: 16px 20px; + background: #f7f7f7; + border-bottom: 1px solid #e0e0e0; + font-size: 15px; + color: #0056b3; + text-align: center; + font-weight: 500; + display: block; + box-shadow: none; + position: static; + } + + .main-content { + display: flex; + min-height: 420px; + } + + .tabs { + width: 230px; + background-color: #fafafa; + display: flex; + flex-direction: column; + justify-content: flex-start; + } + + .tab { + padding: 18px 16px; + cursor: pointer; + border-right: 1px solid #e0e0e0; + color: #555; + transition: all 0.3s ease; + border-left: 4px solid transparent; + font-size: 15px; + font-weight: 500; + } + + .tab:hover { + background-color: #f0f0f0; + color: #000; + } + + .tab.active { + background-color: #fff; + border-left: 4px solid #0056b3; + border-right: none; + border-bottom: 1px solid #0056b3; + color: #0056b3; + font-weight: 600; + } + + .data-table-wrapper { + flex: 1; + padding: 20px; + } + + .data-table { + width: 100%; + } + + .data-row { + display: flex; + align-items: center; + justify-content: space-between; + padding: 12px 16px; + background: #f9f9f9; + transition: background 0.2s ease; + } + + .data-row:hover { + background: #f1f1f1; + } + + .os-name { + flex: 1; + font-size: 15px; + color: #333; + } + + .count-box { + background: #ffffff; + border: 1px solid #0056b3; + padding: 6px 14px; + font-weight: 600; + font-size: 15px; + text-align: center; + min-width: 70px; + } + + .total-row { + background: #eaf4ff; + font-weight: bold; + + .count-box { + color:#0056b3; + } + } +} + +/* ======== RESPONSIVE ======== */ +@media (max-width: 700px) { + .scanView .main-content { + flex-direction: column; + } + + .scanView .tabs { + flex-direction: row; + width: 100%; + } + + .scanView .tab { + flex: 1; + padding: 14px 0; + text-align: center; + font-size: 13px; + } +} \ No newline at end of file diff --git a/src/components/pregunta9.css b/src/components/pregunta9.css new file mode 100644 index 0000000..5bc5cec --- /dev/null +++ b/src/components/pregunta9.css @@ -0,0 +1,133 @@ +.contenedor-pregunta { + padding: 20px; + background-color: #f9fafc; +} + + +.pregunta-cuadro { + background-color: #f5f5f5; + border-left: 6px solid #001f3f; + padding: 15px; + border-radius: 8px; + font-size: 16px; + margin-bottom: 25px; +} + + +.tabla-contenedor { + background: white; + padding: 20px; + border-radius: 10px; + box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1); + overflow-x: auto; +} + +/* Tabla */ +.tabla { + width: 100%; + border-collapse: collapse; + text-align: center; + color: black; +} + +.tabla th, +.tabla td { + border: 1px solid #ddd; + padding: 12px; + +} + +.tabla th { + color: white; + font-weight: 600; + font-size: 15px; +} + +.tabla td { + font-size: 14px; +} + +/* Colores personalizados */ +.azul-marino { + background-color: #002855; + color: white; +} + +.rosa-fuerte { + background-color: #dc1557; + color: white; +} + +/* Contenedor input */ +.input-contenedor { + position: relative; + display: flex; + justify-content: center; + align-items: center; + height: 100%; +} + +/* Input */ +.input-contenedor input { + width: 40%; + padding: 6px 25px 6px 6px; + border: 2px solid #002855; + border-radius: 6px; + font-size: 14px; + color: #333; + text-align: center; + outline: none; + background-color: rgb(232, 226, 226); + box-sizing: border-box; +} + + +.input-contenedor input::-webkit-inner-spin-button, +.input-contenedor input::-webkit-outer-spin-button { + -webkit-appearance: none; + margin: 0; +} + +/* Focus del input */ +.input-contenedor input:focus { + border-color: #001f3f; + box-shadow: 0 0 6px rgba(0, 47, 95, 0.3); +} + +/* Placeholder gris claro */ +.input-contenedor input::placeholder { + color: #bbb; + opacity: 1; +} + + +.input-contenedor .porcentaje { + position: absolute; + + right: 8px; + color: #555; + font-weight: bold; + pointer-events: none; + font-size: 14px; + top: 50%; + transform: translateY(-50%); +} + +/* Celda del total */ +.total-celda { + font-weight: bold; + color: #002855; + background-color: #eef2f6; +} + +/* Total > 100% */ +.total-error { + background-color: #ffcccc; + color: #a80000; +} + + +.input-sp input { + width: 38%; + padding: 6px 6px 6px 6px; +} From 7e88588bb6d54be995470925be8730934a9e4f6d Mon Sep 17 00:00:00 2001 From: IO420 <320154041@pcpuma.acatlan.unam.mx> Date: Tue, 11 Nov 2025 18:30:40 -0600 Subject: [PATCH 3/4] fixed styles and added required to procesador and so --- src/app/(Administrador)/cambiarPass/page.tsx | 60 +++++++++---------- src/app/(Administrador)/crearCuenta/page.tsx | 14 +---- src/app/styles/layout/ForgotPasswordPage.scss | 16 ++--- src/components/AgregarEquipo.tsx | 8 ++- src/components/Editar.tsx | 4 +- 5 files changed, 43 insertions(+), 59 deletions(-) diff --git a/src/app/(Administrador)/cambiarPass/page.tsx b/src/app/(Administrador)/cambiarPass/page.tsx index 9c576ab..089183d 100644 --- a/src/app/(Administrador)/cambiarPass/page.tsx +++ b/src/app/(Administrador)/cambiarPass/page.tsx @@ -47,39 +47,39 @@ export default function Page() { }; return ( -
-

Cambiar contraseña

-

Ingresa el nombre del usuario y su nueva contraseña.

+
+
-
- - setNombre(e.target.value)} - placeholder="Nombre de usuario" - required - /> +

Cambiar contraseña de operador

+

Ingresa el nombre del usuario y su nueva contraseña.

- - setContraseña(e.target.value)} - placeholder="Nueva contraseña" - required - /> + + + setNombre(e.target.value)} + placeholder="Nombre de usuario" + required + /> - + + setContraseña(e.target.value)} + placeholder="Nueva contraseña" + required + /> -
- Regresar al inicio -
-
-
+ + + +
+ ); } diff --git a/src/app/(Administrador)/crearCuenta/page.tsx b/src/app/(Administrador)/crearCuenta/page.tsx index 82b332a..d46267d 100644 --- a/src/app/(Administrador)/crearCuenta/page.tsx +++ b/src/app/(Administrador)/crearCuenta/page.tsx @@ -73,7 +73,7 @@ export default function Page() { return (
-

Crear cuenta

+

Crear cuenta de Operador

@@ -86,17 +86,6 @@ export default function Page() { />
-
- - setCorreo(e.target.value)} - required - /> -
-
- ¿Ya tienes cuenta? Inicia sesión
diff --git a/src/app/styles/layout/ForgotPasswordPage.scss b/src/app/styles/layout/ForgotPasswordPage.scss index 93651e9..c32595e 100644 --- a/src/app/styles/layout/ForgotPasswordPage.scss +++ b/src/app/styles/layout/ForgotPasswordPage.scss @@ -3,13 +3,13 @@ // ===================================== .forgot-password-page { - width: 90%; - max-width: 520px; - margin: 10rem auto; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + width: 100%; padding: 2rem; - background: #ffffff; border-radius: 1rem; - box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); color: #222; transition: background 0.3s ease, color 0.3s ease; @@ -128,10 +128,8 @@ // --- Teléfonos pequeños --- @media (max-width: 480px) { .forgot-password-page { - margin: 15rem auto; padding: 1.5rem; width: 92%; - box-shadow: none; h1 { font-size: 1.6rem; @@ -160,9 +158,7 @@ // --- Tablets (iPad y similares) --- @media (min-width: 768px) and (max-width: 1024px) { .forgot-password-page { - margin: 8rem auto; padding: 3rem 2.5rem; - max-width: 600px; font-size: 1.05rem; h1 { @@ -193,8 +189,6 @@ // --- Escritorio grande --- @media (min-width: 1280px) { .forgot-password-page { - margin: 12rem auto; padding: 3rem; - max-width: 520px; } } diff --git a/src/components/AgregarEquipo.tsx b/src/components/AgregarEquipo.tsx index 514825b..d08233a 100644 --- a/src/components/AgregarEquipo.tsx +++ b/src/components/AgregarEquipo.tsx @@ -160,7 +160,7 @@ export default function Page() { const headers = { Authorization: `Bearer ${token}` }; const response = await axios.get( - `${api_url}/equipos/procesador-tipo-equipos/${formData.id_tipo_equipo}`, + `${api_url}/equipos/procesador-tipo-equipos`, { headers, } @@ -422,12 +422,13 @@ export default function Page() {
handleInputChange( @@ -449,7 +451,7 @@ export default function Page() { ) } > - + {SO_POR_EQUIPO[formData.id_tipo_equipo]?.map((so) => ( + {PROCESADORES_POR_EQUIPO[formData.id_tipo_equipo]?.map( (p) => (