annotate client/src/components/Statistics.vue @ 3174:aeb9d6fc640a

statistics: sprinkled more fairy dust on to bottleneck selection
author Thomas Junk <thomas.junk@intevation.de>
date Mon, 06 May 2019 17:39:55 +0200
parents 1287b031424c
children 296392d4539c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3159
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
1 <template>
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
2 <div
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
3 :class="[
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
4 'box ui-element rounded bg-white text-nowrap',
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
5 { expanded: showStatistics }
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
6 ]"
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
7 >
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
8 <div style="width: 18rem">
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
9 <UIBoxHeader icon="chart-line" :title="label" :closeCallback="close" />
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
10 <div class="box-body">
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
11 <UISpinnerOverlay v-if="loading" />
3172
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
12 <div class="mb-3 d-flex flex-row justify-content-between">
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
13 <div>
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
14 <input :value="$options.BOTTLENECKS" type="radio" v-model="type" />
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
15 <small class="ml-1 text-muted">
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
16 <translate>Bottlenecks</translate>
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
17 </small>
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
18 </div>
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
19 <div>
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
20 <input :value="$options.STRETCHES" type="radio" v-model="type" />
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
21 <small class="ml-1 text-muted">
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
22 <translate>Stretches</translate>
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
23 </small>
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
24 </div>
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
25 <div>
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
26 <input :value="$options.SECTIONS" type="radio" v-model="type" />
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
27 <small class="ml-1 text-muted">
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
28 <translate>Sections</translate>
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
29 </small>
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
30 </div>
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
31 </div>
3159
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
32 <div class="d-flex flex-column">
3172
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
33 <select
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
34 @change="entrySelected"
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
35 class="form-control font-weight-bold"
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
36 v-model="selectedEntry"
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
37 >
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
38 <option :value="null">{{ empty }}</option>
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
39 <option
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
40 v-for="(entry, index) in entries"
3173
1287b031424c statistics: sprinkled fairy dust on to bottleneck selection
Thomas Junk <thomas.junk@intevation.de>
parents: 3172
diff changeset
41 :value="entry"
3172
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
42 :key="index"
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
43 >{{ entry.properties.name }}</option
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
44 >
3159
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
45 </select>
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
46 </div>
3172
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
47 <div class="mt-3">
3173
1287b031424c statistics: sprinkled fairy dust on to bottleneck selection
Thomas Junk <thomas.junk@intevation.de>
parents: 3172
diff changeset
48 <button
1287b031424c statistics: sprinkled fairy dust on to bottleneck selection
Thomas Junk <thomas.junk@intevation.de>
parents: 3172
diff changeset
49 :disabled="selectedEntry == null"
1287b031424c statistics: sprinkled fairy dust on to bottleneck selection
Thomas Junk <thomas.junk@intevation.de>
parents: 3172
diff changeset
50 class="btn btn-info btn-sm w-100"
1287b031424c statistics: sprinkled fairy dust on to bottleneck selection
Thomas Junk <thomas.junk@intevation.de>
parents: 3172
diff changeset
51 >
3172
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
52 <translate>Available Fairway Depth</translate>
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
53 </button>
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
54 </div>
3159
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
55 </div>
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
56 </div>
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
57 </div>
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
58 </template>
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
59
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
60 <script>
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
61 /* This is Free Software under GNU Affero General Public License v >= 3.0
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
62 * without warranty, see README.md and license for details.
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
63 *
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
64 * SPDX-License-Identifier: AGPL-3.0-or-later
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
65 * License-Filename: LICENSES/AGPL-3.0.txt
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
66 *
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
67 * Copyright (C) 2018 by via donau
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
68 * – Österreichische Wasserstraßen-Gesellschaft mbH
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
69 * Software engineering by Intevation GmbH
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
70 *
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
71 * Author(s):
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
72 * Markus Kottländer <markus.kottlaender@intevation.de>
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
73 * Thomas Junk <thomas.junk@intevation.de>
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
74 */
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
75
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
76 import app from "@/main";
3172
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
77 import { mapState, mapGetters } from "vuex";
3159
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
78
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
79 export default {
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
80 data() {
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
81 return {
3172
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
82 type: this.$options.BOTTLENECKS,
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
83 selectedEntry: null,
3159
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
84 loading: false
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
85 };
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
86 },
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
87 methods: {
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
88 close() {
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
89 this.$store.commit("application/showStatistics", false);
3172
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
90 },
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
91 entrySelected() {
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
92 if (this.type === this.$options.BOTTLENECKS) {
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
93 this.openLayersMap()
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
94 .getLayer("BOTTLENECKS")
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
95 .setVisible(true);
3173
1287b031424c statistics: sprinkled fairy dust on to bottleneck selection
Thomas Junk <thomas.junk@intevation.de>
parents: 3172
diff changeset
96 this.$store.dispatch(
1287b031424c statistics: sprinkled fairy dust on to bottleneck selection
Thomas Junk <thomas.junk@intevation.de>
parents: 3172
diff changeset
97 "bottlenecks/setSelectedBottleneck",
1287b031424c statistics: sprinkled fairy dust on to bottleneck selection
Thomas Junk <thomas.junk@intevation.de>
parents: 3172
diff changeset
98 this.selectedEntry.properties.name
1287b031424c statistics: sprinkled fairy dust on to bottleneck selection
Thomas Junk <thomas.junk@intevation.de>
parents: 3172
diff changeset
99 );
3172
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
100 }
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
101 if (this.type === this.$options.STRETCHES) {
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
102 this.openLayersMap()
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
103 .getLayer("STRETCHES")
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
104 .setVisible(true);
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
105 }
3173
1287b031424c statistics: sprinkled fairy dust on to bottleneck selection
Thomas Junk <thomas.junk@intevation.de>
parents: 3172
diff changeset
106 if (this.selectedEntry) {
3172
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
107 this.$store.dispatch("map/moveToFeauture", {
3173
1287b031424c statistics: sprinkled fairy dust on to bottleneck selection
Thomas Junk <thomas.junk@intevation.de>
parents: 3172
diff changeset
108 feature: this.selectedEntry,
3172
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
109 zoom: 17,
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
110 preventZoomOut: true
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
111 });
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
112 }
3173
1287b031424c statistics: sprinkled fairy dust on to bottleneck selection
Thomas Junk <thomas.junk@intevation.de>
parents: 3172
diff changeset
113 },
1287b031424c statistics: sprinkled fairy dust on to bottleneck selection
Thomas Junk <thomas.junk@intevation.de>
parents: 3172
diff changeset
114 setSelectedBottleneck() {
1287b031424c statistics: sprinkled fairy dust on to bottleneck selection
Thomas Junk <thomas.junk@intevation.de>
parents: 3172
diff changeset
115 const bn = this.bottlenecksList.filter(
1287b031424c statistics: sprinkled fairy dust on to bottleneck selection
Thomas Junk <thomas.junk@intevation.de>
parents: 3172
diff changeset
116 x => x.properties.name === this.selectedBottleneck
1287b031424c statistics: sprinkled fairy dust on to bottleneck selection
Thomas Junk <thomas.junk@intevation.de>
parents: 3172
diff changeset
117 )[0];
1287b031424c statistics: sprinkled fairy dust on to bottleneck selection
Thomas Junk <thomas.junk@intevation.de>
parents: 3172
diff changeset
118 this.selectedEntry = bn;
3159
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
119 }
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
120 },
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
121 computed: {
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
122 ...mapState("application", ["showStatistics", "paneSetup"]),
3172
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
123 ...mapState("imports", ["stretches"]),
3173
1287b031424c statistics: sprinkled fairy dust on to bottleneck selection
Thomas Junk <thomas.junk@intevation.de>
parents: 3172
diff changeset
124 ...mapState("bottlenecks", ["bottlenecksList", "selectedBottleneck"]),
3172
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
125 ...mapGetters("map", ["openLayersMap"]),
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
126 entries() {
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
127 if (this.type === this.$options.BOTTLENECKS) return this.bottlenecksList;
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
128 if (this.type === this.$options.STRETCHES) return this.stretches;
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
129 return [];
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
130 },
3159
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
131 label() {
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
132 return this.$gettext("Statistics");
3172
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
133 },
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
134 empty() {
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
135 if (this.type === this.$options.BOTTLENECKS)
3173
1287b031424c statistics: sprinkled fairy dust on to bottleneck selection
Thomas Junk <thomas.junk@intevation.de>
parents: 3172
diff changeset
136 return this.$gettext("Select bottleneck");
3172
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
137 if (this.type === this.$options.STRETCHES)
3173
1287b031424c statistics: sprinkled fairy dust on to bottleneck selection
Thomas Junk <thomas.junk@intevation.de>
parents: 3172
diff changeset
138 return this.$gettext("Select strectch");
1287b031424c statistics: sprinkled fairy dust on to bottleneck selection
Thomas Junk <thomas.junk@intevation.de>
parents: 3172
diff changeset
139 return this.$gettext("Select section");
3159
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
140 }
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
141 },
3172
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
142 watch: {
3173
1287b031424c statistics: sprinkled fairy dust on to bottleneck selection
Thomas Junk <thomas.junk@intevation.de>
parents: 3172
diff changeset
143 selectedBottleneck() {
3174
aeb9d6fc640a statistics: sprinkled more fairy dust on to bottleneck selection
Thomas Junk <thomas.junk@intevation.de>
parents: 3173
diff changeset
144 this.type = this.$options.BOTTLENECKS;
3173
1287b031424c statistics: sprinkled fairy dust on to bottleneck selection
Thomas Junk <thomas.junk@intevation.de>
parents: 3172
diff changeset
145 this.setSelectedBottleneck();
1287b031424c statistics: sprinkled fairy dust on to bottleneck selection
Thomas Junk <thomas.junk@intevation.de>
parents: 3172
diff changeset
146 },
3172
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
147 type() {
3173
1287b031424c statistics: sprinkled fairy dust on to bottleneck selection
Thomas Junk <thomas.junk@intevation.de>
parents: 3172
diff changeset
148 if (this.selectedBottleneck) {
1287b031424c statistics: sprinkled fairy dust on to bottleneck selection
Thomas Junk <thomas.junk@intevation.de>
parents: 3172
diff changeset
149 this.setSelectedBottleneck();
1287b031424c statistics: sprinkled fairy dust on to bottleneck selection
Thomas Junk <thomas.junk@intevation.de>
parents: 3172
diff changeset
150 } else {
1287b031424c statistics: sprinkled fairy dust on to bottleneck selection
Thomas Junk <thomas.junk@intevation.de>
parents: 3172
diff changeset
151 this.selectedEntry = null;
1287b031424c statistics: sprinkled fairy dust on to bottleneck selection
Thomas Junk <thomas.junk@intevation.de>
parents: 3172
diff changeset
152 }
3172
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
153 this.openLayersMap()
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
154 .getLayer("STRETCHES")
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
155 .setVisible(true);
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
156 },
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
157 showStatistics() {
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
158 if (this.showStatistics) {
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
159 this.loading = true;
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
160 this.$store.dispatch("bottlenecks/loadBottlenecksList").then(() => {
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
161 this.$store.dispatch("imports/loadStretches").then(() => {
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
162 this.loading = false;
3173
1287b031424c statistics: sprinkled fairy dust on to bottleneck selection
Thomas Junk <thomas.junk@intevation.de>
parents: 3172
diff changeset
163 if (this.selectedBottleneck) this.setSelectedBottleneck();
3172
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
164 });
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
165 });
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
166 }
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
167 }
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
168 },
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
169 BOTTLENECKS: "bottlenecks",
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
170 SECTIONS: "sections",
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
171 STRETCHES: "stretches",
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
172 AVAILABLEFAIRWAYDEPTH: app.$gettext("Available Fairway Depth")
3159
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
173 };
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
174 </script>
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
175
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
176 <style></style>