14
14
v-model =" auswertungsOptions"
15
15
:height =" stepperHeightVh"
16
16
:all-visible-messstellen =" allVisibleMessstellen"
17
+ :preset-data =" presetData"
17
18
/>
18
19
<v-spacer />
19
20
<v-card-actions >
@@ -92,10 +93,11 @@ import type MessstelleAuswertungIdDTO from "@/types/messstelle/auswertung/Messst
92
93
import type MessstelleAuswertungOptionsDTO from " @/types/messstelle/auswertung/MessstelleAuswertungOptionsDTO" ;
93
94
import type LadeZaehldatenSteplineDTO from " @/types/zaehlung/zaehldaten/LadeZaehldatenSteplineDTO" ;
94
95
95
- import { cloneDeep , head , isNil , toArray , valuesIn } from " lodash" ;
96
+ import { cloneDeep , head , isEmpty , isNil , toArray , valuesIn } from " lodash" ;
96
97
import { computed , onMounted , ref } from " vue" ;
97
98
import { useDisplay } from " vuetify" ;
98
99
100
+ import { ApiError , Levels } from " @/api/error" ;
99
101
import GeneratePdfService from " @/api/service/GeneratePdfService" ;
100
102
import MessstelleAuswertungService from " @/api/service/MessstelleAuswertungService" ;
101
103
import ProgressLoader from " @/components/common/ProgressLoader.vue" ;
@@ -129,6 +131,7 @@ const chartDataLoading = ref(false);
129
131
const steplineCard = ref <InstanceType <typeof StepLineCard > | null >();
130
132
const allVisibleMessstellen = ref <Array <MessstelleAuswertungDTO >>([]);
131
133
const pdfReportDialog = ref (false );
134
+ const presetData = ref (false );
132
135
133
136
const zaehldatenMessstellen = ref <LadeZaehldatenSteplineDTO >(
134
137
DefaultObjectCreator .createDefaultLadeZaehldatenSteplineDTO ()
@@ -140,6 +143,13 @@ const auswertungsOptions = ref<MessstelleAuswertungOptionsDTO>(
140
143
141
144
onMounted (() => {
142
145
loadAllVisibleMessstellen ();
146
+ auswertungsOptions .value = cloneDeep (
147
+ gesamtauswertungStore .getAuswertungMessstelleOptions
148
+ );
149
+ zaehldatenMessstellen .value = cloneDeep (
150
+ gesamtauswertungStore .getZaehldatenMessstellen
151
+ );
152
+ presetData .value = ! isEmpty (auswertungsOptions .value .zeitraum );
143
153
});
144
154
145
155
const textForNonShownDiagram = computed (() => {
@@ -251,6 +261,7 @@ function resetAuswertungsOptions() {
251
261
);
252
262
zaehldatenMessstellen .value =
253
263
DefaultObjectCreator .createDefaultLadeZaehldatenSteplineDTO ();
264
+ gesamtauswertungStore .setZaehldatenMessstellen (zaehldatenMessstellen .value );
254
265
}
255
266
256
267
function auswertungStarten() {
@@ -279,6 +290,9 @@ function auswertungStarten() {
279
290
zaehldatenMessstellen .value =
280
291
DefaultObjectCreator .createDefaultLadeZaehldatenSteplineDTO ();
281
292
}
293
+ gesamtauswertungStore .setZaehldatenMessstellen (
294
+ zaehldatenMessstellen .value
295
+ );
282
296
});
283
297
}
284
298
@@ -408,11 +422,17 @@ function getFilenameSingleMessstelleAndMessquerschnitte(
408
422
}
409
423
410
424
function loadAllVisibleMessstellen(): void {
411
- MessstelleAuswertungService .getAllVisibleMessstellen (). then (
412
- (messstellen : Array <MessstelleAuswertungDTO >) => {
425
+ MessstelleAuswertungService .getAllVisibleMessstellen ()
426
+ . then ( (messstellen : Array <MessstelleAuswertungDTO >) => {
413
427
allVisibleMessstellen .value = messstellen ;
414
- }
415
- );
428
+ })
429
+ .catch ((error ) => {
430
+ throw new ApiError (
431
+ Levels .ERROR ,
432
+ ` Beim Laden aller auswählbaren Messstellen ist ein Fehler aufgetreten. ` ,
433
+ error
434
+ );
435
+ });
416
436
}
417
437
function openPdfReportDialog(): void {
418
438
pdfReportDialog .value = true ;
0 commit comments