feat: Dynamische Einheit in Redux für Schleifen- und Isolationswiderstand hinzugefügt
- Redux-Slice erweitert um `unit`-State (kOhm/MOhm) - `setSelectedSlotType` aktualisiert die Einheit basierend auf der Auswahl - Dropdown in `LoopChartActionBar.tsx` angepasst, um Einheit zu setzen - Y-Achse und Tooltip in `LoopMeasurementChart.tsx` zeigen dynamisch die Einheit aus Redux - Initialwert von `bisDatum` auf das heutige Datum gesetzt
This commit is contained in:
@@ -19,19 +19,21 @@ interface KabelueberwachungChartState {
|
||||
slotNumber: number | null;
|
||||
tdrChartData: TDRData[]; // Hinzufügen des TDR-Datenzustands
|
||||
isFullScreen: boolean;
|
||||
unit: "kOhm" | "MOhm"; // 🆕 Einheit für Messwerte
|
||||
}
|
||||
|
||||
// Initialer Zustand des Slices
|
||||
const initialState: KabelueberwachungChartState = {
|
||||
loopMeasurementCurveChartData: [],
|
||||
vonDatum: "2025-02-01",
|
||||
bisDatum: "2025-02-28",
|
||||
bisDatum: new Date().toISOString().split("T")[0], // Heutiges Datum als Standardwert
|
||||
selectedMode: "DIA0",
|
||||
selectedSlotType: "schleifenwiderstand",
|
||||
isChartOpen: false,
|
||||
slotNumber: null,
|
||||
tdrChartData: [], // Initialisierung mit leerem Array
|
||||
isFullScreen: false,
|
||||
unit: "kOhm", // Standard auf Schleifenwiderstand (kOhm)
|
||||
};
|
||||
|
||||
// Erstellung des Slices
|
||||
@@ -68,6 +70,7 @@ const kabelueberwachungChartSlice = createSlice({
|
||||
action: PayloadAction<"isolationswiderstand" | "schleifenwiderstand">
|
||||
) => {
|
||||
state.selectedSlotType = action.payload;
|
||||
state.unit = action.payload === "schleifenwiderstand" ? "kOhm" : "MOhm"; // 🆕 Einheit setzen
|
||||
},
|
||||
// Aktion zum Öffnen oder Schließen des Charts
|
||||
setChartOpen: (state, action: PayloadAction<boolean>) => {
|
||||
|
||||
Reference in New Issue
Block a user