From b06a88e96914a66c7cd9b743ca7b3cb789c0be88 Mon Sep 17 00:00:00 2001 From: Esteban Date: Tue, 16 Dec 2025 21:10:13 -0600 Subject: [PATCH] Data Query section --- src/App.tsx | 3 + src/pages/DataQuery.tsx | 174 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 177 insertions(+) create mode 100644 src/pages/DataQuery.tsx diff --git a/src/App.tsx b/src/App.tsx index d60c568..21ce922 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -5,6 +5,7 @@ import AreaManagement from "./pages/AreaManagement"; import OperatorManagement from "./pages/OperatorManagement"; import DeviceManagement from "./pages/DeviceManagement"; import DataMonitoring from "./pages/DataMonitoring"; +import DataQuery from "./pages/DataQuery"; import Home from "./pages/Home"; // Tipos para las páginas que reciben subPage @@ -28,6 +29,8 @@ export default function App() { return ; case "data-monitoring": return ; + case "data-query": + return ; default: return
Selecciona una opción
; } diff --git a/src/pages/DataQuery.tsx b/src/pages/DataQuery.tsx new file mode 100644 index 0000000..8400261 --- /dev/null +++ b/src/pages/DataQuery.tsx @@ -0,0 +1,174 @@ +import { useState } from "react"; +import { DataGrid, GridColDef } from "@mui/x-data-grid"; +import { Refresh } from "@mui/icons-material"; +import { Button, CircularProgress } from "@mui/material"; + +interface DataQueryItem { + id: number; + sort: number; + areaName: string; + meterSn: string; + communicationTime: string; + positiveTotalFlow: number; + batteryStatus: string; +} + +interface DataQueryProps { + subPage: string; +} + +export default function DataQuery({ subPage: _subPage }: DataQueryProps) { + const [rows, setRows] = useState([ + { + id: 1, + sort: 1, + areaName: "Operaciones", + meterSn: "MTR001", + communicationTime: "2024-12-16 14:25:00", + positiveTotalFlow: 88.97, + batteryStatus: "Good" + }, + { + id: 2, + sort: 2, + areaName: "Calidad", + meterSn: "MTR002", + communicationTime: "2024-12-16 13:45:00", + positiveTotalFlow: 122.82, + batteryStatus: "Low" + }, + { + id: 3, + sort: 3, + areaName: "Mantenimiento", + meterSn: "MTR003", + communicationTime: "2024-12-16 12:30:00", + positiveTotalFlow: 67.45, + batteryStatus: "Good" + }, + { + id: 4, + sort: 4, + areaName: "Operaciones", + meterSn: "MTR004", + communicationTime: "2024-12-16 11:15:00", + positiveTotalFlow: 234.67, + batteryStatus: "Critical" + }, + { + id: 5, + sort: 5, + areaName: "Calidad", + meterSn: "MTR005", + communicationTime: "2024-12-16 10:00:00", + positiveTotalFlow: 156.23, + batteryStatus: "Good" + }, + { + id: 6, + sort: 6, + areaName: "Mantenimiento", + meterSn: "MTR006", + communicationTime: "2024-12-16 09:30:00", + positiveTotalFlow: 78.91, + batteryStatus: "Low" + }, + { + id: 7, + sort: 7, + areaName: "Operaciones", + meterSn: "MTR007", + communicationTime: "2024-12-16 08:45:00", + positiveTotalFlow: 189.34, + batteryStatus: "Good" + }, + { + id: 8, + sort: 8, + areaName: "Calidad", + meterSn: "MTR008", + communicationTime: "2024-12-16 07:20:00", + positiveTotalFlow: 145.78, + batteryStatus: "Critical" + }, + ]); + + const [loading, setLoading] = useState(false); + + const columns: GridColDef[] = [ + { field: "sort", headerName: "Sort", width: 80, type: "number" }, + { field: "areaName", headerName: "Area Name", width: 150 }, + { field: "meterSn", headerName: "Meter S/N", width: 130 }, + { field: "communicationTime", headerName: "Communication Time", width: 180 }, + { field: "positiveTotalFlow", headerName: "Positive Total Flow", width: 160, type: "number" }, + { field: "batteryStatus", headerName: "Battery Status", width: 130 }, + ]; + + const handleRefresh = () => { + setLoading(true); + setTimeout(() => { + setRows([...rows]); + setLoading(false); + }, 1000); + }; + + return ( +
+ +
+

Data Query

+
+ +
+
+ +
+ +
+ + +
+ ); +}