From a80c3675ff8c2db06cd657cdef1be42bd82b3dd5 Mon Sep 17 00:00:00 2001 From: ISA Date: Mon, 12 May 2025 13:19:57 +0200 Subject: [PATCH] =?UTF-8?q?fix:=20Bei=20den=20Messkurven=20der=20Kabel?= =?UTF-8?q?=C3=BCberwachungen=20ist=20noch=20ein=20Fehler:=20Du=20=C3=BCbe?= =?UTF-8?q?rgibst=20f=C3=BCr=20die=20erste=20Kabel=C3=BCberwachung=20den?= =?UTF-8?q?=20Wert=201=20anstatt=200.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Im Lastenheft steht 0 bis 31 für Kabelüberwachungen (Wert q): --- .../LoopMeasurementChart/LoopChartActionBar.tsx | 13 +++++++++---- .../main/kabelueberwachung/kue705FO/Kue705FO.tsx | 2 +- .../kue705FO/handlers/handleOpenChartModal.ts | 3 ++- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/components/main/kabelueberwachung/kue705FO/Charts/LoopMeasurementChart/LoopChartActionBar.tsx b/components/main/kabelueberwachung/kue705FO/Charts/LoopMeasurementChart/LoopChartActionBar.tsx index 9157fce..a5e46c3 100644 --- a/components/main/kabelueberwachung/kue705FO/Charts/LoopMeasurementChart/LoopChartActionBar.tsx +++ b/components/main/kabelueberwachung/kue705FO/Charts/LoopMeasurementChart/LoopChartActionBar.tsx @@ -35,13 +35,18 @@ export const useLoopChartLoader = () => { const typeFolder = type === 3 ? "isolationswiderstand" : "schleifenwiderstand"; + let url: string; + if (process.env.NODE_ENV === "development") { - return `/api/cpl/slotDataAPIHandler?slot=${slotNumber}&messart=${typeFolder}&dia=${mode}&vonDatum=${vonDatum}&bisDatum=${bisDatum}`; + url = `/api/cpl/slotDataAPIHandler?slot=${slotNumber}&messart=${typeFolder}&dia=${mode}&vonDatum=${vonDatum}&bisDatum=${bisDatum}`; + } else { + url = `${window.location.origin}/CPL?seite.ACP&${mode}=${formatDate( + vonDatum + )};${formatDate(bisDatum)};${slotNumber};${type};`; } - return `${window.location.origin}/CPL?seite.ACP&${mode}=${formatDate( - vonDatum - )};${formatDate(bisDatum)};${slotNumber};${type};`; + console.log("API URL:", url); // Hier wird die URL in der Konsole ausgegeben + return url; }; const loadLoopChartData = async () => { diff --git a/components/main/kabelueberwachung/kue705FO/Kue705FO.tsx b/components/main/kabelueberwachung/kue705FO/Kue705FO.tsx index 903e51d..138df69 100644 --- a/components/main/kabelueberwachung/kue705FO/Kue705FO.tsx +++ b/components/main/kabelueberwachung/kue705FO/Kue705FO.tsx @@ -367,7 +367,7 @@ const Kue705FO: React.FC = ({ ) : (
{/* Das soll rausgenommen werden -

Kein Modul im Slot {slotIndex + 1}

+

Kein Modul im Slot {slotIndex + 0}

*/}
)} diff --git a/components/main/kabelueberwachung/kue705FO/handlers/handleOpenChartModal.ts b/components/main/kabelueberwachung/kue705FO/handlers/handleOpenChartModal.ts index f0bdd69..a054f85 100644 --- a/components/main/kabelueberwachung/kue705FO/handlers/handleOpenChartModal.ts +++ b/components/main/kabelueberwachung/kue705FO/handlers/handleOpenChartModal.ts @@ -18,7 +18,8 @@ const handleOpenChartModal = ( ) => { setShowChartModal(true); dispatch(setChartOpen(true)); - dispatch(setSlotNumber(slotIndex + 1)); + dispatch(setSlotNumber(slotIndex)); + console.log("SlotIndex:", slotIndex); // ✅ Speichert den gewählten Slot in Redux dispatch(setSelectedSlot(slotIndex));