comparison client/src/components/fairway/Fairwayprofile.vue @ 5572:3b842e951317 surveysperbottleneckid

change use from name of bottleneck to its id.
author Thomas Junk <thomas.junk@intevation.de>
date Tue, 20 Jul 2021 17:07:51 +0200
parents de86a96d55c3
children f54932eec5c0
comparison
equal deleted inserted replaced
5472:9321d9fb719f 5572:3b842e951317
237 dates.map(d => this.$options.filters.dateTime(d, true)); 237 dates.map(d => this.$options.filters.dateTime(d, true));
238 const waterlevelMeasurement = 238 const waterlevelMeasurement =
239 this.waterlevelValid && this.refWaterlevelValid 239 this.waterlevelValid && this.refWaterlevelValid
240 ? `${this.$options.filters.waterlevel(this.waterlevel)} m` 240 ? `${this.$options.filters.waterlevel(this.waterlevel)} m`
241 : this.$gettext("No valid value available"); 241 : this.$gettext("No valid value available");
242 return `${this.$gettext("Fairwayprofile")}: ${ 242 return `${this.$gettext("Fairwayprofile")}: ${this.bottleneck.get(
243 this.selectedBottleneck 243 "objnam"
244 } (${dates.join( 244 )} (${dates.join(
245 ", " 245 ", "
246 )}) WL: ${waterlevelLabel} ( ${waterlevelMeasurement} )`; 246 )}) WL: ${waterlevelLabel} ( ${waterlevelMeasurement} )`;
247 }, 247 },
248 currentData() { 248 currentData() {
249 if ( 249 if (
264 bottleneck() { 264 bottleneck() {
265 return this.openLayersMap() 265 return this.openLayersMap()
266 .getLayer("BOTTLENECKS") 266 .getLayer("BOTTLENECKS")
267 .getSource() 267 .getSource()
268 .getFeatures() 268 .getFeatures()
269 .find(f => f.get("objnam") === this.selectedBottleneck); 269 .find(f => f.get("bottleneck_id") === this.selectedBottleneck);
270 }, 270 },
271 waterlevel() { 271 waterlevel() {
272 return this.selectedWaterLevel === "ref" 272 return this.selectedWaterLevel === "ref"
273 ? this.refWaterlevel 273 ? this.refWaterlevel
274 : this.bottleneck.get("gm_waterlevel"); 274 : this.bottleneck.get("gm_waterlevel");
284 return isNumber(this.refWaterlevel); 284 return isNumber(this.refWaterlevel);
285 }, 285 },
286 fileName() { 286 fileName() {
287 return this.downloadFilename( 287 return this.downloadFilename(
288 this.$gettext("Fairwayprofile"), 288 this.$gettext("Fairwayprofile"),
289 this.selectedBottleneck 289 this.bottleneck.get("objnam")
290 ); 290 );
291 } 291 }
292 }, 292 },
293 watch: { 293 watch: {
294 depth() { 294 depth() {
444 }); 444 });
445 } 445 }
446 }, 446 },
447 downloadPDF() { 447 downloadPDF() {
448 let fairwayInfo = 448 let fairwayInfo =
449 this.selectedBottleneck + " (" + this.selectedSurvey.date_info + ")"; 449 this.bottleneck.get("objnam") +
450 " (" +
451 this.selectedSurvey.date_info +
452 ")";
450 this.generatePDF({ 453 this.generatePDF({
451 templateData: this.templateData, 454 templateData: this.templateData,
452 diagramTitle: fairwayInfo 455 diagramTitle: fairwayInfo
453 }); 456 });
454 this.pdf.doc.save(this.fileName + ".pdf"); 457 this.pdf.doc.save(this.fileName + ".pdf");