159159 />
160160 </template >
161161 <v-list density =" compact" >
162+ <v-list-item density =" compact" >
163+ <v-btn
164+ v-tooltip:end =" 'Link zur Dokumentation der CSV-Datei'"
165+ class =" ml-2 mr-2"
166+ icon =" mdi-information"
167+ variant =" text"
168+ color =" secondary"
169+ @click =" openCsvDokumentation"
170+ />
171+ </v-list-item >
162172 <v-list-item density =" compact" >
163173 <v-btn
164174 v-tooltip:end =" 'CSV-Muster herunterladen'"
@@ -194,6 +204,7 @@ import ZaehlartIcon from "@/components/icons/ZaehlartIcon.vue";
194204import ZaehldauerIcon from " @/components/icons/ZaehldauerIcon.vue" ;
195205import ZaehlungCardMap from " @/components/map/ZaehlungCardMap.vue" ;
196206import ZaehlungGeometrie from " @/components/zaehlung/ZaehlungGeometrie.vue" ;
207+ import { useConfigurationStore } from " @/store/ConfigurationStore" ;
197208import { useSnackbarStore } from " @/store/SnackbarStore" ;
198209import Status , { statusIcon } from " @/types/enum/Status" ;
199210import Zaehlart from " @/types/enum/Zaehlart" ;
@@ -216,6 +227,7 @@ const ICON_COLOR = "black";
216227const loading = ref <boolean >(false );
217228
218229const snackbarStore = useSnackbarStore ();
230+ const configurationStore = useConfigurationStore ();
219231const dateUtils = useDateUtils ();
220232
221233const coordsZaehlstelle = computed <LatLng >(() => {
@@ -343,20 +355,22 @@ function openZaehlungDialog() {
343355function downloadDummyCsv(): void {
344356 // Beispiel: 62301Q_20210423_Knotenarm2.csv
345357 const zaehlstelleNummer: string = zaehlung .value .zaehlstelleNummer ;
346- const zaehlart : string =
358+ const zaehlartForFileContent : string =
347359 zaehlung .value .zaehlart === Zaehlart .N ? " " : zaehlung .value .zaehlart ;
348- const filename = ` ${zaehlstelleNummer }${zaehlart }_${zaehlung .value .datum .replace (
360+ const filename = ` ${zaehlstelleNummer }${zaehlartForFileContent }_${zaehlung .value .datum .replace (
349361 " -" ,
350362 " "
351363 )}_Knotenarm_X.csv ` ;
352364
353- const metaHeader = " Zählstellennummer;Zählart;Datum;Knotenarmnummer;;;;;\n " ;
354- const metaData = ` ${zaehlstelleNummer };${zaehlart };${zaehlung .value .datum };<von-Knotenarmnr>;;;;;\n ` ;
355- const zaehlungHeader = " Intervallnummer;nach;Pkw;Lkw;Lz;Bus;Krad;Rad;Fuss\n " ;
365+ const csvFileContent = getCsvContentForAllZaehlarten (
366+ zaehlstelleNummer ,
367+ zaehlartForFileContent ,
368+ zaehlung .value .datum
369+ );
370+ const csvContentWithFileMetadata =
371+ " data:text/csv;charset=utf-8," + csvFileContent ;
356372
357- const csvContent =
358- " data:text/csv;charset=utf-8," + metaHeader + metaData + zaehlungHeader ;
359- const encodedUri = encodeURI (csvContent );
373+ const encodedUri = encodeURI (csvContentWithFileMetadata );
360374 const link = document .createElement (" a" );
361375 link .setAttribute (" href" , encodedUri );
362376 link .setAttribute (" download" , filename );
@@ -365,8 +379,29 @@ function downloadDummyCsv(): void {
365379 link .click ();
366380}
367381
382+ function getCsvContentForAllZaehlarten(
383+ zaehlstelleNummer : string ,
384+ zaehlart : string ,
385+ zaehlungDatum : string
386+ ): string {
387+ const metaHeader = " Zählstellennummer;Zählart;Datum;Knotenarmnummer;;;;;\n " ;
388+ const metaData = ` ${zaehlstelleNummer };${zaehlart };${zaehlungDatum };<knotenarmnummer>;;;;;\n ` ;
389+ const zaehlungHeader =
390+ " Intervallnummer;nach;Strassenseite;Richtung;Pkw;Lkw;Lz;Bus;Krad;Rad;Fuss\n " ;
391+ return metaHeader + metaData + zaehlungHeader ;
392+ }
393+
368394function openChatDialog() {
369395 zaehlung .value .unreadMessagesDienstleister = false ;
370396 emits (" openChatDialog" , zaehlung .value );
371397}
398+
399+ function openCsvDokumentation(): void {
400+ const linkCsvFile =
401+ configurationStore .getZaehlstelleConfiguration
402+ .linkDocumentationCsvFileForUploadZaehlung ;
403+ if (! isEmpty (linkCsvFile )) {
404+ window .open (linkCsvFile );
405+ }
406+ }
372407 </script >
0 commit comments