Mercurial > gemma
annotate client/src/components/gauge/Gauges.vue @ 2647:c52bf6f994c0
overview2: bottleneckview added
author | Thomas Junk <thomas.junk@intevation.de> |
---|---|
date | Thu, 14 Mar 2019 14:07:25 +0100 |
parents | 50cfb12a54a4 |
children | cc3eee8b5d71 |
rev | line source |
---|---|
2598
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
1 <template> |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
2 <div |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
3 :class="[ |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
4 'box ui-element rounded bg-white text-nowrap', |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
5 { expanded: showGauges } |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
6 ]" |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
7 > |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
8 <div style="width: 18rem"> |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
9 <UIBoxHeader |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
10 icon="ruler-vertical" |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
11 title="Gauges" |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
12 :closeCallback="close" |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
13 /> |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
14 <div class="box-body"> |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
15 <div |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
16 class="loading d-flex justify-content-center align-items-center" |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
17 v-if="loading" |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
18 > |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
19 <font-awesome-icon icon="spinner" spin /> |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
20 </div> |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
21 <select |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
22 @change="moveToGauge" |
2643
27933e66e848
client: gauges: use isrs_code as unique id for gauges
Markus Kottlaender <markus@intevation.de>
parents:
2642
diff
changeset
|
23 v-model="selectedGaugeISRS" |
2598
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
24 class="form-control font-weight-bold" |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
25 > |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
26 <option :value="null"> |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
27 <translate>Select Gauge</translate> |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
28 </option> |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
29 <option |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
30 v-for="g in gauges" |
2643
27933e66e848
client: gauges: use isrs_code as unique id for gauges
Markus Kottlaender <markus@intevation.de>
parents:
2642
diff
changeset
|
31 :key="g.properties.isrs_code" |
27933e66e848
client: gauges: use isrs_code as unique id for gauges
Markus Kottlaender <markus@intevation.de>
parents:
2642
diff
changeset
|
32 :value="g.properties.isrs_code" |
2598
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
33 > |
2643
27933e66e848
client: gauges: use isrs_code as unique id for gauges
Markus Kottlaender <markus@intevation.de>
parents:
2642
diff
changeset
|
34 {{ gaugeLabel(g) }} |
2598
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
35 </option> |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
36 </select> |
2643
27933e66e848
client: gauges: use isrs_code as unique id for gauges
Markus Kottlaender <markus@intevation.de>
parents:
2642
diff
changeset
|
37 <div v-if="selectedGaugeISRS" class="mt-2"> |
2598
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
38 <hr class="mb-1" /> |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
39 <small class="text-muted"> |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
40 <translate>Time period</translate>: |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
41 </small> |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
42 <select |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
43 v-model="waterlevelsTimePeriod" |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
44 class="form-control form-control-sm mb-2" |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
45 > |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
46 <option value="day">last day</option> |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
47 <option value="week">last week</option> |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
48 <option value="month">last month</option> |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
49 <option value="year">last year</option> |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
50 </select> |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
51 <button |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
52 @click="showWaterlevelDiagram()" |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
53 class="btn btn-sm btn-info d-block w-100" |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
54 > |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
55 <translate>Show Waterlevels</translate> |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
56 </button> |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
57 <hr /> |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
58 <button class="btn btn-sm btn-info d-block w-100 mt-2" disabled> |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
59 <translate>Show Hydrological Conditions</translate> |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
60 </button> |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
61 </div> |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
62 </div> |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
63 </div> |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
64 </div> |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
65 </template> |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
66 |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
67 <style lang="scss" scoped> |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
68 .loading { |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
69 background: rgba(255, 255, 255, 0.9); |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
70 position: absolute; |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
71 z-index: 99; |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
72 top: 0; |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
73 right: 0; |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
74 bottom: 0; |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
75 left: 0; |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
76 } |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
77 </style> |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
78 |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
79 <script> |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
80 /* This is Free Software under GNU Affero General Public License v >= 3.0 |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
81 * without warranty, see README.md and license for details. |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
82 * |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
83 * SPDX-License-Identifier: AGPL-3.0-or-later |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
84 * License-Filename: LICENSES/AGPL-3.0.txt |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
85 * |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
86 * Copyright (C) 2018 by via donau |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
87 * – Österreichische Wasserstraßen-Gesellschaft mbH |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
88 * Software engineering by Intevation GmbH |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
89 * |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
90 * Author(s): |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
91 * Markus Kottländer <markus.kottlaender@intevation.de> |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
92 */ |
2604
85f9bf4a6eba
client: gauge waterlevel diagram: draw reference waterlevels
Markus Kottlaender <markus@intevation.de>
parents:
2598
diff
changeset
|
93 import { mapState, mapGetters } from "vuex"; |
2598
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
94 |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
95 export default { |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
96 data() { |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
97 return { |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
98 loading: false, |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
99 waterlevelsTimePeriod: "day" |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
100 }; |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
101 }, |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
102 computed: { |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
103 ...mapState("application", ["showGauges"]), |
2604
85f9bf4a6eba
client: gauge waterlevel diagram: draw reference waterlevels
Markus Kottlaender <markus@intevation.de>
parents:
2598
diff
changeset
|
104 ...mapState("gauges", ["gauges"]), |
85f9bf4a6eba
client: gauge waterlevel diagram: draw reference waterlevels
Markus Kottlaender <markus@intevation.de>
parents:
2598
diff
changeset
|
105 ...mapGetters("gauges", ["selectedGauge"]), |
2643
27933e66e848
client: gauges: use isrs_code as unique id for gauges
Markus Kottlaender <markus@intevation.de>
parents:
2642
diff
changeset
|
106 selectedGaugeISRS: { |
2598
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
107 get() { |
2643
27933e66e848
client: gauges: use isrs_code as unique id for gauges
Markus Kottlaender <markus@intevation.de>
parents:
2642
diff
changeset
|
108 return this.$store.state.gauges.selectedGaugeISRS; |
2598
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
109 }, |
2643
27933e66e848
client: gauges: use isrs_code as unique id for gauges
Markus Kottlaender <markus@intevation.de>
parents:
2642
diff
changeset
|
110 set(isrs) { |
27933e66e848
client: gauges: use isrs_code as unique id for gauges
Markus Kottlaender <markus@intevation.de>
parents:
2642
diff
changeset
|
111 this.$store.dispatch("gauges/selectedGaugeISRS", isrs); |
2598
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
112 } |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
113 } |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
114 }, |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
115 methods: { |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
116 close() { |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
117 this.$store.commit("application/showGauges", false); |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
118 }, |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
119 moveToGauge() { |
2604
85f9bf4a6eba
client: gauge waterlevel diagram: draw reference waterlevels
Markus Kottlaender <markus@intevation.de>
parents:
2598
diff
changeset
|
120 if (!this.selectedGauge) return; |
2598
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
121 this.$store.commit("map/moveToExtent", { |
2604
85f9bf4a6eba
client: gauge waterlevel diagram: draw reference waterlevels
Markus Kottlaender <markus@intevation.de>
parents:
2598
diff
changeset
|
122 feature: this.selectedGauge, |
2598
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
123 zoom: 17, |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
124 preventZoomOut: true |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
125 }); |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
126 }, |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
127 showWaterlevelDiagram() { |
2644
50cfb12a54a4
client: gauges: fixed bug with panning to gauge...
Markus Kottlaender <markus@intevation.de>
parents:
2643
diff
changeset
|
128 // for panning the map to the gauge on opening the diagram: needs to be |
50cfb12a54a4
client: gauges: fixed bug with panning to gauge...
Markus Kottlaender <markus@intevation.de>
parents:
2643
diff
changeset
|
129 // set outside of the expandCallback to not always refer to the currently |
50cfb12a54a4
client: gauges: fixed bug with panning to gauge...
Markus Kottlaender <markus@intevation.de>
parents:
2643
diff
changeset
|
130 // selectedGauge |
50cfb12a54a4
client: gauges: fixed bug with panning to gauge...
Markus Kottlaender <markus@intevation.de>
parents:
2643
diff
changeset
|
131 let coordinates = this.selectedGauge.geometry.coordinates; |
50cfb12a54a4
client: gauges: fixed bug with panning to gauge...
Markus Kottlaender <markus@intevation.de>
parents:
2643
diff
changeset
|
132 |
2598
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
133 // configure splitscreen |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
134 let splitscreenConf = { |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
135 id: "gauge-waterlevel", |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
136 component: "waterlevel", |
2643
27933e66e848
client: gauges: use isrs_code as unique id for gauges
Markus Kottlaender <markus@intevation.de>
parents:
2642
diff
changeset
|
137 title: |
27933e66e848
client: gauges: use isrs_code as unique id for gauges
Markus Kottlaender <markus@intevation.de>
parents:
2642
diff
changeset
|
138 this.$gettext("Waterlevel") + |
27933e66e848
client: gauges: use isrs_code as unique id for gauges
Markus Kottlaender <markus@intevation.de>
parents:
2642
diff
changeset
|
139 ": " + |
27933e66e848
client: gauges: use isrs_code as unique id for gauges
Markus Kottlaender <markus@intevation.de>
parents:
2642
diff
changeset
|
140 this.gaugeLabel(this.selectedGauge), |
2598
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
141 icon: "ruler-vertical", |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
142 closeCallback: () => { |
2643
27933e66e848
client: gauges: use isrs_code as unique id for gauges
Markus Kottlaender <markus@intevation.de>
parents:
2642
diff
changeset
|
143 this.$store.commit("gauges/selectedGaugeISRS", null); |
2598
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
144 this.$store.commit("gauges/waterlevels", []); |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
145 }, |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
146 expandCallback: () => { |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
147 this.$store.commit("map/moveMap", { |
2644
50cfb12a54a4
client: gauges: fixed bug with panning to gauge...
Markus Kottlaender <markus@intevation.de>
parents:
2643
diff
changeset
|
148 coordinates, |
2598
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
149 zoom: 17, |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
150 preventZoomOut: true |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
151 }); |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
152 } |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
153 }; |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
154 this.$store.commit("application/addSplitscreen", splitscreenConf); |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
155 this.$store.commit("application/activeSplitscreenId", splitscreenConf.id); |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
156 this.$store.commit("application/splitscreenLoading", true); |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
157 this.loading = true; |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
158 this.$store.commit("application/showSplitscreen", true); |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
159 this.$store |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
160 .dispatch("gauges/loadWaterlevels", this.waterlevelsTimePeriod) |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
161 .then(() => { |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
162 this.$store.commit("application/splitscreenLoading", false); |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
163 this.loading = false; |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
164 }); |
2643
27933e66e848
client: gauges: use isrs_code as unique id for gauges
Markus Kottlaender <markus@intevation.de>
parents:
2642
diff
changeset
|
165 }, |
27933e66e848
client: gauges: use isrs_code as unique id for gauges
Markus Kottlaender <markus@intevation.de>
parents:
2642
diff
changeset
|
166 gaugeLabel(gauge) { |
27933e66e848
client: gauges: use isrs_code as unique id for gauges
Markus Kottlaender <markus@intevation.de>
parents:
2642
diff
changeset
|
167 let details = gauge.id |
27933e66e848
client: gauges: use isrs_code as unique id for gauges
Markus Kottlaender <markus@intevation.de>
parents:
2642
diff
changeset
|
168 .split(".")[1] |
27933e66e848
client: gauges: use isrs_code as unique id for gauges
Markus Kottlaender <markus@intevation.de>
parents:
2642
diff
changeset
|
169 .replace(/[()]/g, "") |
27933e66e848
client: gauges: use isrs_code as unique id for gauges
Markus Kottlaender <markus@intevation.de>
parents:
2642
diff
changeset
|
170 .split(","); |
27933e66e848
client: gauges: use isrs_code as unique id for gauges
Markus Kottlaender <markus@intevation.de>
parents:
2642
diff
changeset
|
171 return `${gauge.properties.objname} (${details[3]})`; |
2598
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
172 } |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
173 }, |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
174 mounted() { |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
175 this.$store.dispatch("gauges/loadGauges"); |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
176 } |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
177 }; |
5fa1ad39e1bc
client: added missing files for Gauges dialog
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
178 </script> |