feat: Zeitspanne-Funktion mit Von/Bis und Button-Trigger im DetailModal eingebaut
- Chart-Daten werden jetzt erst bei Klick auf „Daten laden“ geladen - Von/Bis-Zeitauswahl über Redux-State korrekt eingebunden - Styling der Eingabefelder und Dropdowns vereinheitlicht (eine Zeile) - Lokalen State für Zeitspanne entfernt und durch Redux ersetzt
This commit is contained in:
@@ -6,6 +6,6 @@ NEXT_PUBLIC_USE_MOCK_BACKEND_LOOP_START=false
|
|||||||
NEXT_PUBLIC_EXPORT_STATIC=false
|
NEXT_PUBLIC_EXPORT_STATIC=false
|
||||||
NEXT_PUBLIC_USE_CGI=false
|
NEXT_PUBLIC_USE_CGI=false
|
||||||
# App-Versionsnummer
|
# App-Versionsnummer
|
||||||
NEXT_PUBLIC_APP_VERSION=1.6.587
|
NEXT_PUBLIC_APP_VERSION=1.6.588
|
||||||
NEXT_PUBLIC_CPL_MODE=json # json (Entwicklungsumgebung) oder jsSimulatedProd (CPL ->CGI-Interface-Simulator) oder production (CPL-> CGI-Interface Platzhalter)
|
NEXT_PUBLIC_CPL_MODE=json # json (Entwicklungsumgebung) oder jsSimulatedProd (CPL ->CGI-Interface-Simulator) oder production (CPL-> CGI-Interface Platzhalter)
|
||||||
|
|
||||||
|
|||||||
@@ -5,5 +5,5 @@ NEXT_PUBLIC_CPL_API_PATH=/CPL
|
|||||||
NEXT_PUBLIC_EXPORT_STATIC=true
|
NEXT_PUBLIC_EXPORT_STATIC=true
|
||||||
NEXT_PUBLIC_USE_CGI=true
|
NEXT_PUBLIC_USE_CGI=true
|
||||||
# App-Versionsnummer
|
# App-Versionsnummer
|
||||||
NEXT_PUBLIC_APP_VERSION=1.6.587
|
NEXT_PUBLIC_APP_VERSION=1.6.588
|
||||||
NEXT_PUBLIC_CPL_MODE=production
|
NEXT_PUBLIC_CPL_MODE=production
|
||||||
@@ -1,3 +1,8 @@
|
|||||||
|
## [1.6.588] – 2025-07-11
|
||||||
|
|
||||||
|
- fix: Messwertlinie (m) im DIA0-Modus in DetailModal sichtbar gemacht
|
||||||
|
|
||||||
|
---
|
||||||
## [1.6.587] – 2025-07-11
|
## [1.6.587] – 2025-07-11
|
||||||
|
|
||||||
- fix: Anzeige der Messwertlinie (m) im DIA0-Modus in DetailModal korrigiert
|
- fix: Anzeige der Messwertlinie (m) im DIA0-Modus in DetailModal korrigiert
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// /components/main/kabelueberwachung/kue705FO/Charts/LoopMeasurementChart/DateRangePicker.tsx
|
// /components/common/DateRangePicker.tsx
|
||||||
import React, { useEffect } from "react";
|
import React, { useEffect } from "react";
|
||||||
import DatePicker from "react-datepicker";
|
import DatePicker from "react-datepicker";
|
||||||
import { useSelector, useDispatch } from "react-redux";
|
import { useSelector, useDispatch } from "react-redux";
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
"use client";
|
"use client";
|
||||||
// /components/main/kabelueberwachung/kue705FO/Charts/LoopMeasurementChart/LoopChartActionBar.tsx
|
// /components/main/kabelueberwachung/kue705FO/Charts/LoopMeasurementChart/LoopChartActionBar.tsx
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import DateRangePicker from "./DateRangePicker";
|
import DateRangePicker from "@/components/common/DateRangePicker";
|
||||||
import { useDispatch, useSelector } from "react-redux";
|
import { useDispatch, useSelector } from "react-redux";
|
||||||
import { RootState } from "@/redux/store";
|
import { RootState } from "@/redux/store";
|
||||||
import {
|
import {
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import { useSelector, useDispatch } from "react-redux";
|
|||||||
import { RootState } from "@/redux/store";
|
import { RootState } from "@/redux/store";
|
||||||
import { Listbox } from "@headlessui/react";
|
import { Listbox } from "@headlessui/react";
|
||||||
import { setFullScreen } from "@/redux/slices/kabelueberwachungChartSlice";
|
import { setFullScreen } from "@/redux/slices/kabelueberwachungChartSlice";
|
||||||
|
import DateRangePicker from "@/components/common/DateRangePicker";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
Chart as ChartJS,
|
Chart as ChartJS,
|
||||||
@@ -121,6 +122,14 @@ export const DetailModal = ({
|
|||||||
const [chartData, setChartData] = useState<any>({
|
const [chartData, setChartData] = useState<any>({
|
||||||
datasets: [],
|
datasets: [],
|
||||||
});
|
});
|
||||||
|
const vonDatum = useSelector(
|
||||||
|
(state: RootState) => state.kabelueberwachungChartSlice.vonDatum
|
||||||
|
);
|
||||||
|
const bisDatum = useSelector(
|
||||||
|
(state: RootState) => state.kabelueberwachungChartSlice.bisDatum
|
||||||
|
);
|
||||||
|
|
||||||
|
const [filteredData, setFilteredData] = useState<ReduxDataEntry[]>([]);
|
||||||
|
|
||||||
const reduxData = useSelector((state: RootState) => {
|
const reduxData = useSelector((state: RootState) => {
|
||||||
switch (selectedKey) {
|
switch (selectedKey) {
|
||||||
@@ -170,8 +179,19 @@ export const DetailModal = ({
|
|||||||
loadZoomPlugin();
|
loadZoomPlugin();
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
useEffect(() => {
|
const handleFetchData = () => {
|
||||||
const sortedData = [...reduxData].reverse();
|
let sortedData = [...reduxData].reverse();
|
||||||
|
|
||||||
|
if (vonDatum && bisDatum) {
|
||||||
|
const vonDate = new Date(vonDatum);
|
||||||
|
const bisDate = new Date(bisDatum);
|
||||||
|
sortedData = sortedData.filter((entry) => {
|
||||||
|
const entryDate = new Date(entry.t);
|
||||||
|
return entryDate >= vonDate && entryDate <= bisDate;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
setFilteredData(sortedData);
|
||||||
|
|
||||||
setChartData({
|
setChartData({
|
||||||
datasets: [
|
datasets: [
|
||||||
@@ -207,7 +227,7 @@ export const DetailModal = ({
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
}, [reduxData]);
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (chartRef.current && selectedKey) {
|
if (chartRef.current && selectedKey) {
|
||||||
@@ -259,7 +279,8 @@ export const DetailModal = ({
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="flex items-center space-x-2 mb-4">
|
<div className="flex items-center justify-start gap-4 mb-4 flex-wrap">
|
||||||
|
<DateRangePicker />
|
||||||
<label className="font-medium">Zeitraum:</label>
|
<label className="font-medium">Zeitraum:</label>
|
||||||
<Listbox value={zeitraum} onChange={setZeitraum}>
|
<Listbox value={zeitraum} onChange={setZeitraum}>
|
||||||
<div className="relative w-48">
|
<div className="relative w-48">
|
||||||
@@ -312,6 +333,12 @@ export const DetailModal = ({
|
|||||||
</Listbox.Options>
|
</Listbox.Options>
|
||||||
</div>
|
</div>
|
||||||
</Listbox>
|
</Listbox>
|
||||||
|
<button
|
||||||
|
onClick={handleFetchData}
|
||||||
|
className="px-4 py-1 bg-littwin-blue text-white rounded text-sm"
|
||||||
|
>
|
||||||
|
Daten laden
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="h-[85%]">
|
<div className="h-[85%]">
|
||||||
|
|||||||
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "cpl-v4",
|
"name": "cpl-v4",
|
||||||
"version": "1.6.587",
|
"version": "1.6.588",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "cpl-v4",
|
"name": "cpl-v4",
|
||||||
"version": "1.6.587",
|
"version": "1.6.588",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@fontsource/roboto": "^5.1.0",
|
"@fontsource/roboto": "^5.1.0",
|
||||||
"@headlessui/react": "^2.2.4",
|
"@headlessui/react": "^2.2.4",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "cpl-v4",
|
"name": "cpl-v4",
|
||||||
"version": "1.6.587",
|
"version": "1.6.588",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "next dev",
|
"dev": "next dev",
|
||||||
|
|||||||
Reference in New Issue
Block a user