changeset 3531:804df080c826 waterlevel-in-crossprofile

client: fairway profiles: added waterlevel to title and used title as pdf filename
author Markus Kottlaender <markus@intevation.de>
date Wed, 29 May 2019 18:04:07 +0200
parents 8a9ee18de13f
children 4e4c0d2b8654
files client/src/components/fairway/Fairwayprofile.vue
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/client/src/components/fairway/Fairwayprofile.vue	Wed May 29 15:56:14 2019 +0200
+++ b/client/src/components/fairway/Fairwayprofile.vue	Wed May 29 18:04:07 2019 +0200
@@ -156,11 +156,15 @@
     ...mapState("application", ["paneSetup"]),
     title() {
       let dates = [this.selectedSurvey.date_info];
+      let waterlevelLabel =
+        this.selectedWaterLevel === "ref"
+          ? this.selectedSurvey.depth_reference
+          : "Current";
       if (this.additionalSurvey) dates.push(this.additionalSurvey.date_info);
       dates.map(d => this.$options.filters.dateTime(d, true));
       return `${this.$gettext("Fairwayprofile")}: ${
         this.selectedBottleneck
-      } (${dates.join(", ")})`;
+      } (${dates.join(", ")}) WL: ${waterlevelLabel} (${this.waterlevel} cm)`;
     },
     currentData() {
       if (
@@ -362,7 +366,7 @@
           }
         });
       }
-      this.pdf.doc.save("Fairwayprofile diagram");
+      this.pdf.doc.save(this.title.replace(/\s/g, "_").replace(/[():,]/g, ""));
     },
     addDiagram(position, offset, width, height) {
       let x = offset.x,