annotate client/src/components/Statistics.vue @ 3178:5ec34e08b01d

available_fairway_depth: display mock
author Thomas Junk <thomas.junk@intevation.de>
date Tue, 07 May 2019 12:59:24 +0200
parents 296392d4539c
children f64cc98746a1
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
3178
5ec34e08b01d available_fairway_depth: display mock
Thomas Junk <thomas.junk@intevation.de>
parents: 3175
diff changeset
49 @click="openFairwaydepth"
3173
1287b031424c statistics: sprinkled fairy dust on to bottleneck selection
Thomas Junk <thomas.junk@intevation.de>
parents: 3172
diff changeset
50 :disabled="selectedEntry == null"
1287b031424c statistics: sprinkled fairy dust on to bottleneck selection
Thomas Junk <thomas.junk@intevation.de>
parents: 3172
diff changeset
51 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
52 >
3172
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
53 <translate>Available Fairway Depth</translate>
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
54 </button>
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
55 </div>
3159
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 </div>
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
59 </template>
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
60
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
61 <script>
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
62 /* 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
63 * without warranty, see README.md and license for details.
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
64 *
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
65 * SPDX-License-Identifier: AGPL-3.0-or-later
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
66 * License-Filename: LICENSES/AGPL-3.0.txt
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
67 *
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
68 * Copyright (C) 2018 by via donau
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
69 * – Österreichische Wasserstraßen-Gesellschaft mbH
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
70 * Software engineering by Intevation GmbH
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
71 *
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
72 * Author(s):
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
73 * Markus Kottländer <markus.kottlaender@intevation.de>
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
74 * Thomas Junk <thomas.junk@intevation.de>
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
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
77 import app from "@/main";
3172
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
78 import { mapState, mapGetters } from "vuex";
3159
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
79
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
80 export default {
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
81 data() {
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
82 return {
3172
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
83 type: this.$options.BOTTLENECKS,
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
84 selectedEntry: null,
3159
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
85 loading: false
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 },
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
88 methods: {
3178
5ec34e08b01d available_fairway_depth: display mock
Thomas Junk <thomas.junk@intevation.de>
parents: 3175
diff changeset
89 openFairwaydepth() {
5ec34e08b01d available_fairway_depth: display mock
Thomas Junk <thomas.junk@intevation.de>
parents: 3175
diff changeset
90 this.$store.commit("application/paneSetup", "AVAILABLEFAIRWAYDEPTH");
5ec34e08b01d available_fairway_depth: display mock
Thomas Junk <thomas.junk@intevation.de>
parents: 3175
diff changeset
91 },
3159
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
92 close() {
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
93 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
94 },
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
95 entrySelected() {
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
96 if (this.type === this.$options.BOTTLENECKS) {
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
97 this.openLayersMap()
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
98 .getLayer("BOTTLENECKS")
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
99 .setVisible(true);
3178
5ec34e08b01d available_fairway_depth: display mock
Thomas Junk <thomas.junk@intevation.de>
parents: 3175
diff changeset
100 if (this.showProfiles) {
5ec34e08b01d available_fairway_depth: display mock
Thomas Junk <thomas.junk@intevation.de>
parents: 3175
diff changeset
101 this.$store.dispatch(
5ec34e08b01d available_fairway_depth: display mock
Thomas Junk <thomas.junk@intevation.de>
parents: 3175
diff changeset
102 "bottlenecks/setSelectedBottleneck",
5ec34e08b01d available_fairway_depth: display mock
Thomas Junk <thomas.junk@intevation.de>
parents: 3175
diff changeset
103 this.selectedEntry.properties.name
5ec34e08b01d available_fairway_depth: display mock
Thomas Junk <thomas.junk@intevation.de>
parents: 3175
diff changeset
104 );
5ec34e08b01d available_fairway_depth: display mock
Thomas Junk <thomas.junk@intevation.de>
parents: 3175
diff changeset
105 }
3172
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
106 }
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
107 if (this.type === this.$options.STRETCHES) {
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
108 this.openLayersMap()
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
109 .getLayer("STRETCHES")
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
110 .setVisible(true);
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
111 }
3173
1287b031424c statistics: sprinkled fairy dust on to bottleneck selection
Thomas Junk <thomas.junk@intevation.de>
parents: 3172
diff changeset
112 if (this.selectedEntry) {
3172
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
113 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
114 feature: this.selectedEntry,
3172
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
115 zoom: 17,
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
116 preventZoomOut: true
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
117 });
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
118 }
3173
1287b031424c statistics: sprinkled fairy dust on to bottleneck selection
Thomas Junk <thomas.junk@intevation.de>
parents: 3172
diff changeset
119 },
1287b031424c statistics: sprinkled fairy dust on to bottleneck selection
Thomas Junk <thomas.junk@intevation.de>
parents: 3172
diff changeset
120 setSelectedBottleneck() {
1287b031424c statistics: sprinkled fairy dust on to bottleneck selection
Thomas Junk <thomas.junk@intevation.de>
parents: 3172
diff changeset
121 const bn = this.bottlenecksList.filter(
1287b031424c statistics: sprinkled fairy dust on to bottleneck selection
Thomas Junk <thomas.junk@intevation.de>
parents: 3172
diff changeset
122 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
123 )[0];
1287b031424c statistics: sprinkled fairy dust on to bottleneck selection
Thomas Junk <thomas.junk@intevation.de>
parents: 3172
diff changeset
124 this.selectedEntry = bn;
3159
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
125 }
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
126 },
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
127 computed: {
3178
5ec34e08b01d available_fairway_depth: display mock
Thomas Junk <thomas.junk@intevation.de>
parents: 3175
diff changeset
128 ...mapState("application", ["showStatistics", "paneSetup", "showProfiles"]),
3172
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
129 ...mapState("imports", ["stretches"]),
3173
1287b031424c statistics: sprinkled fairy dust on to bottleneck selection
Thomas Junk <thomas.junk@intevation.de>
parents: 3172
diff changeset
130 ...mapState("bottlenecks", ["bottlenecksList", "selectedBottleneck"]),
3172
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
131 ...mapGetters("map", ["openLayersMap"]),
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
132 entries() {
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
133 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
134 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
135 return [];
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
136 },
3159
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
137 label() {
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
138 return this.$gettext("Statistics");
3172
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
139 },
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
140 empty() {
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
141 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
142 return this.$gettext("Select bottleneck");
3172
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
143 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
144 return this.$gettext("Select strectch");
1287b031424c statistics: sprinkled fairy dust on to bottleneck selection
Thomas Junk <thomas.junk@intevation.de>
parents: 3172
diff changeset
145 return this.$gettext("Select section");
3159
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
146 }
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
147 },
3172
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
148 watch: {
3173
1287b031424c statistics: sprinkled fairy dust on to bottleneck selection
Thomas Junk <thomas.junk@intevation.de>
parents: 3172
diff changeset
149 selectedBottleneck() {
3174
aeb9d6fc640a statistics: sprinkled more fairy dust on to bottleneck selection
Thomas Junk <thomas.junk@intevation.de>
parents: 3173
diff changeset
150 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
151 this.setSelectedBottleneck();
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 type() {
3175
296392d4539c client: statistics dialog: fix resetting selectedEntry
Markus Kottlaender <markus@intevation.de>
parents: 3174
diff changeset
154 if (this.type === this.$options.BOTTLENECKS && this.selectedBottleneck) {
3173
1287b031424c statistics: sprinkled fairy dust on to bottleneck selection
Thomas Junk <thomas.junk@intevation.de>
parents: 3172
diff changeset
155 this.setSelectedBottleneck();
1287b031424c statistics: sprinkled fairy dust on to bottleneck selection
Thomas Junk <thomas.junk@intevation.de>
parents: 3172
diff changeset
156 } else {
1287b031424c statistics: sprinkled fairy dust on to bottleneck selection
Thomas Junk <thomas.junk@intevation.de>
parents: 3172
diff changeset
157 this.selectedEntry = null;
1287b031424c statistics: sprinkled fairy dust on to bottleneck selection
Thomas Junk <thomas.junk@intevation.de>
parents: 3172
diff changeset
158 }
3172
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
159 this.openLayersMap()
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
160 .getLayer("STRETCHES")
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
161 .setVisible(true);
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
162 },
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
163 showStatistics() {
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
164 if (this.showStatistics) {
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
165 this.loading = true;
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
166 this.$store.dispatch("bottlenecks/loadBottlenecksList").then(() => {
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
167 this.$store.dispatch("imports/loadStretches").then(() => {
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
168 this.loading = false;
3173
1287b031424c statistics: sprinkled fairy dust on to bottleneck selection
Thomas Junk <thomas.junk@intevation.de>
parents: 3172
diff changeset
169 if (this.selectedBottleneck) this.setSelectedBottleneck();
3172
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
170 });
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
171 });
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
172 }
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
173 }
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
174 },
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
175 BOTTLENECKS: "bottlenecks",
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
176 SECTIONS: "sections",
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
177 STRETCHES: "stretches",
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
178 AVAILABLEFAIRWAYDEPTH: app.$gettext("Available Fairway Depth")
3159
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
179 };
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
180 </script>
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
181
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
182 <style></style>