Mercurial > gemma
diff client/src/components/gauge/Gauges.vue @ 4456:acb21e7362ce
client: pdf-gen: fix diagram title for pdf (waterlevels, hydrologicalconditions)
* refactor diagram title for pdf-generation
* move isrsIfo function to mixins.js
* remove unused gauginfo function
author | Fadi Abbud <fadi.abbud@intevation.de> |
---|---|
date | Mon, 23 Sep 2019 09:55:48 +0200 |
parents | 4a5ed371011f |
children | 51dc4811a0e6 |
line wrap: on
line diff
--- a/client/src/components/gauge/Gauges.vue Mon Sep 23 09:22:03 2019 +0200 +++ b/client/src/components/gauge/Gauges.vue Mon Sep 23 09:55:48 2019 +0200 @@ -109,11 +109,13 @@ * Author(s): * Markus Kottländer <markus.kottlaender@intevation.de> */ -/*eslint no-unused-vars: ["error", { "varsIgnorePattern": "_" }]*/ + import { mapState, mapGetters } from "vuex"; import { displayError } from "@/lib/errors"; +import { pdfgen } from "@/lib/mixins"; export default { + mixins: [pdfgen], data() { return { loading: false @@ -244,27 +246,6 @@ }, gaugeLabel(gauge) { return `${gauge.properties.objname} (${this.isrsInfo(gauge).orc})`; - }, - isrsInfo(gauge) { - // See https://www.elwis.de/DE/Service/Daten-und-Fakten/RIS-Index/RIS-Index-node.html - const [ - _, - countryCode, - loCode, - fairwaySection, - orc, - hectometre - ] = gauge.properties.isrs_code.match( - /(\w{2})(\w{3})(\w{5})(\w{5})(\w{5})/ - ); - - return { - countryCode: countryCode, - loCode: loCode, - fairwaySection: fairwaySection, - orc: orc, - hectometre: hectometre - }; } }, mounted() {