annotate client/src/components/Statistics.vue @ 3207:ba7bc3740fb3

client: renamed store modules to better reflect their context
author Markus Kottlaender <markus@intevation.de>
date Wed, 08 May 2019 17:43:18 +0200
parents bf571429515f
children 861329d535b2
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" />
3199
25a26f666ee8 statistics: layout
Thomas Junk <thomas.junk@intevation.de>
parents: 3198
diff changeset
12 <div
25a26f666ee8 statistics: layout
Thomas Junk <thomas.junk@intevation.de>
parents: 3198
diff changeset
13 class="mb-3 d-flex flex-row justify-content-between align-items-center"
25a26f666ee8 statistics: layout
Thomas Junk <thomas.junk@intevation.de>
parents: 3198
diff changeset
14 >
3172
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
15 <div>
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
16 <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
17 <small class="ml-1 text-muted">
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
18 <translate>Bottlenecks</translate>
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
19 </small>
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
20 </div>
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
21 <div>
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
22 <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
23 <small class="ml-1 text-muted">
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
24 <translate>Stretches</translate>
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
25 </small>
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
26 </div>
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
27 <div>
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
28 <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
29 <small class="ml-1 text-muted">
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
30 <translate>Sections</translate>
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
31 </small>
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
32 </div>
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
33 </div>
3159
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
34 <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
35 <select
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
36 @change="entrySelected"
3199
25a26f666ee8 statistics: layout
Thomas Junk <thomas.junk@intevation.de>
parents: 3198
diff changeset
37 class="form-control form-control-sm font-weight-bold"
3172
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
38 v-model="selectedEntry"
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
39 >
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
40 <option :value="null">{{ empty }}</option>
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
41 <option
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
42 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
43 :value="entry"
3172
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
44 :key="index"
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
45 >{{ entry.properties.name }}</option
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
46 >
3159
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
47 </select>
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
48 </div>
3185
505414dfe3e7 available_fairway_depth: move statistic dialog to store
Thomas Junk <thomas.junk@intevation.de>
parents: 3184
diff changeset
49 <div class="d-flex flex-column mt-3">
3199
25a26f666ee8 statistics: layout
Thomas Junk <thomas.junk@intevation.de>
parents: 3198
diff changeset
50 <div class="d-flex flex-row w-100">
25a26f666ee8 statistics: layout
Thomas Junk <thomas.junk@intevation.de>
parents: 3198
diff changeset
51 <div class="d-flex flex-column mb-3 w-50 mr-1">
25a26f666ee8 statistics: layout
Thomas Junk <thomas.junk@intevation.de>
parents: 3198
diff changeset
52 <small class="my-auto text-muted"
25a26f666ee8 statistics: layout
Thomas Junk <thomas.junk@intevation.de>
parents: 3198
diff changeset
53 ><translate>Type</translate></small
25a26f666ee8 statistics: layout
Thomas Junk <thomas.junk@intevation.de>
parents: 3198
diff changeset
54 >
25a26f666ee8 statistics: layout
Thomas Junk <thomas.junk@intevation.de>
parents: 3198
diff changeset
55 <select
25a26f666ee8 statistics: layout
Thomas Junk <thomas.junk@intevation.de>
parents: 3198
diff changeset
56 v-model="selectedFrequency"
25a26f666ee8 statistics: layout
Thomas Junk <thomas.junk@intevation.de>
parents: 3198
diff changeset
57 class="form-control form-control-sm"
3191
c0cd5dfec153 statistics: persist fields to vuex
Thomas Junk <thomas.junk@intevation.de>
parents: 3185
diff changeset
58 >
3199
25a26f666ee8 statistics: layout
Thomas Junk <thomas.junk@intevation.de>
parents: 3198
diff changeset
59 <option
25a26f666ee8 statistics: layout
Thomas Junk <thomas.junk@intevation.de>
parents: 3198
diff changeset
60 v-for="(option, index) in $options.FREQUENCIES"
25a26f666ee8 statistics: layout
Thomas Junk <thomas.junk@intevation.de>
parents: 3198
diff changeset
61 :value="option"
25a26f666ee8 statistics: layout
Thomas Junk <thomas.junk@intevation.de>
parents: 3198
diff changeset
62 :key="index"
25a26f666ee8 statistics: layout
Thomas Junk <thomas.junk@intevation.de>
parents: 3198
diff changeset
63 ><translate>{{ option }}</translate></option
25a26f666ee8 statistics: layout
Thomas Junk <thomas.junk@intevation.de>
parents: 3198
diff changeset
64 >
25a26f666ee8 statistics: layout
Thomas Junk <thomas.junk@intevation.de>
parents: 3198
diff changeset
65 </select>
25a26f666ee8 statistics: layout
Thomas Junk <thomas.junk@intevation.de>
parents: 3198
diff changeset
66 </div>
25a26f666ee8 statistics: layout
Thomas Junk <thomas.junk@intevation.de>
parents: 3198
diff changeset
67 <div class="d-flex flex-column mb-3 w-50 ml-1">
25a26f666ee8 statistics: layout
Thomas Junk <thomas.junk@intevation.de>
parents: 3198
diff changeset
68 <small class="my-auto text-muted"
25a26f666ee8 statistics: layout
Thomas Junk <thomas.junk@intevation.de>
parents: 3198
diff changeset
69 ><translate>LOS</translate></small
25a26f666ee8 statistics: layout
Thomas Junk <thomas.junk@intevation.de>
parents: 3198
diff changeset
70 >
25a26f666ee8 statistics: layout
Thomas Junk <thomas.junk@intevation.de>
parents: 3198
diff changeset
71 <select v-model="los" class="form-control form-control-sm">
25a26f666ee8 statistics: layout
Thomas Junk <thomas.junk@intevation.de>
parents: 3198
diff changeset
72 <option value="1">1</option>
25a26f666ee8 statistics: layout
Thomas Junk <thomas.junk@intevation.de>
parents: 3198
diff changeset
73 <option value="2">2</option>
25a26f666ee8 statistics: layout
Thomas Junk <thomas.junk@intevation.de>
parents: 3198
diff changeset
74 <option value="3">3</option>
25a26f666ee8 statistics: layout
Thomas Junk <thomas.junk@intevation.de>
parents: 3198
diff changeset
75 </select>
25a26f666ee8 statistics: layout
Thomas Junk <thomas.junk@intevation.de>
parents: 3198
diff changeset
76 </div>
3185
505414dfe3e7 available_fairway_depth: move statistic dialog to store
Thomas Junk <thomas.junk@intevation.de>
parents: 3184
diff changeset
77 </div>
3199
25a26f666ee8 statistics: layout
Thomas Junk <thomas.junk@intevation.de>
parents: 3198
diff changeset
78 <div class="d-flex flex-row w-100">
25a26f666ee8 statistics: layout
Thomas Junk <thomas.junk@intevation.de>
parents: 3198
diff changeset
79 <div class="d-flex flex-column w-50 mr-1">
25a26f666ee8 statistics: layout
Thomas Junk <thomas.junk@intevation.de>
parents: 3198
diff changeset
80 <small for="from" class="my-auto text-muted"
25a26f666ee8 statistics: layout
Thomas Junk <thomas.junk@intevation.de>
parents: 3198
diff changeset
81 ><translate>Date from</translate></small
25a26f666ee8 statistics: layout
Thomas Junk <thomas.junk@intevation.de>
parents: 3198
diff changeset
82 ><input
25a26f666ee8 statistics: layout
Thomas Junk <thomas.junk@intevation.de>
parents: 3198
diff changeset
83 id="from"
25a26f666ee8 statistics: layout
Thomas Junk <thomas.junk@intevation.de>
parents: 3198
diff changeset
84 v-model="fromDate"
25a26f666ee8 statistics: layout
Thomas Junk <thomas.junk@intevation.de>
parents: 3198
diff changeset
85 class="form-control form-control-sm"
25a26f666ee8 statistics: layout
Thomas Junk <thomas.junk@intevation.de>
parents: 3198
diff changeset
86 type="date"
25a26f666ee8 statistics: layout
Thomas Junk <thomas.junk@intevation.de>
parents: 3198
diff changeset
87 />
25a26f666ee8 statistics: layout
Thomas Junk <thomas.junk@intevation.de>
parents: 3198
diff changeset
88 </div>
25a26f666ee8 statistics: layout
Thomas Junk <thomas.junk@intevation.de>
parents: 3198
diff changeset
89 <div class="d-flex flex-column w-50 ml-1">
25a26f666ee8 statistics: layout
Thomas Junk <thomas.junk@intevation.de>
parents: 3198
diff changeset
90 <small for="to" class="my-auto text-muted"
25a26f666ee8 statistics: layout
Thomas Junk <thomas.junk@intevation.de>
parents: 3198
diff changeset
91 ><translate>Date to</translate></small
25a26f666ee8 statistics: layout
Thomas Junk <thomas.junk@intevation.de>
parents: 3198
diff changeset
92 ><input
25a26f666ee8 statistics: layout
Thomas Junk <thomas.junk@intevation.de>
parents: 3198
diff changeset
93 id="to"
25a26f666ee8 statistics: layout
Thomas Junk <thomas.junk@intevation.de>
parents: 3198
diff changeset
94 v-model="toDate"
25a26f666ee8 statistics: layout
Thomas Junk <thomas.junk@intevation.de>
parents: 3198
diff changeset
95 class="form-control form-control-sm"
25a26f666ee8 statistics: layout
Thomas Junk <thomas.junk@intevation.de>
parents: 3198
diff changeset
96 type="date"
25a26f666ee8 statistics: layout
Thomas Junk <thomas.junk@intevation.de>
parents: 3198
diff changeset
97 />
25a26f666ee8 statistics: layout
Thomas Junk <thomas.junk@intevation.de>
parents: 3198
diff changeset
98 </div>
3185
505414dfe3e7 available_fairway_depth: move statistic dialog to store
Thomas Junk <thomas.junk@intevation.de>
parents: 3184
diff changeset
99 </div>
505414dfe3e7 available_fairway_depth: move statistic dialog to store
Thomas Junk <thomas.junk@intevation.de>
parents: 3184
diff changeset
100 </div>
3172
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
101 <div class="mt-3">
3173
1287b031424c statistics: sprinkled fairy dust on to bottleneck selection
Thomas Junk <thomas.junk@intevation.de>
parents: 3172
diff changeset
102 <button
3178
5ec34e08b01d available_fairway_depth: display mock
Thomas Junk <thomas.junk@intevation.de>
parents: 3175
diff changeset
103 @click="openFairwaydepth"
3191
c0cd5dfec153 statistics: persist fields to vuex
Thomas Junk <thomas.junk@intevation.de>
parents: 3185
diff changeset
104 :disabled="isComplete"
3173
1287b031424c statistics: sprinkled fairy dust on to bottleneck selection
Thomas Junk <thomas.junk@intevation.de>
parents: 3172
diff changeset
105 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
106 >
3172
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
107 <translate>Available Fairway Depth</translate>
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
108 </button>
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
109 </div>
3159
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
110 </div>
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
111 </div>
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
112 </div>
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
113 </template>
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
114
3199
25a26f666ee8 statistics: layout
Thomas Junk <thomas.junk@intevation.de>
parents: 3198
diff changeset
115 <style lang="scss" scoped>
25a26f666ee8 statistics: layout
Thomas Junk <thomas.junk@intevation.de>
parents: 3198
diff changeset
116 input,
25a26f666ee8 statistics: layout
Thomas Junk <thomas.junk@intevation.de>
parents: 3198
diff changeset
117 select {
25a26f666ee8 statistics: layout
Thomas Junk <thomas.junk@intevation.de>
parents: 3198
diff changeset
118 font-size: 0.8em;
25a26f666ee8 statistics: layout
Thomas Junk <thomas.junk@intevation.de>
parents: 3198
diff changeset
119 }
25a26f666ee8 statistics: layout
Thomas Junk <thomas.junk@intevation.de>
parents: 3198
diff changeset
120 </style>
25a26f666ee8 statistics: layout
Thomas Junk <thomas.junk@intevation.de>
parents: 3198
diff changeset
121
3159
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
122 <script>
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
123 /* 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
124 * without warranty, see README.md and license for details.
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 * SPDX-License-Identifier: AGPL-3.0-or-later
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
127 * License-Filename: LICENSES/AGPL-3.0.txt
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
128 *
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
129 * Copyright (C) 2018 by via donau
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
130 * – Österreichische Wasserstraßen-Gesellschaft mbH
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
131 * Software engineering by Intevation GmbH
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
132 *
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
133 * Author(s):
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
134 * Markus Kottländer <markus.kottlaender@intevation.de>
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
135 * Thomas Junk <thomas.junk@intevation.de>
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
136 */
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
137
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
138 import app from "@/main";
3191
c0cd5dfec153 statistics: persist fields to vuex
Thomas Junk <thomas.junk@intevation.de>
parents: 3185
diff changeset
139 import { displayError } from "@/lib/errors";
3172
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
140 import { mapState, mapGetters } from "vuex";
3159
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
141
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
142 export default {
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
143 data() {
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
144 return {
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
145 loading: false
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 },
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
148 methods: {
3178
5ec34e08b01d available_fairway_depth: display mock
Thomas Junk <thomas.junk@intevation.de>
parents: 3175
diff changeset
149 openFairwaydepth() {
3191
c0cd5dfec153 statistics: persist fields to vuex
Thomas Junk <thomas.junk@intevation.de>
parents: 3185
diff changeset
150 this.loading = true;
c0cd5dfec153 statistics: persist fields to vuex
Thomas Junk <thomas.junk@intevation.de>
parents: 3185
diff changeset
151 this.$store
3207
ba7bc3740fb3 client: renamed store modules to better reflect their context
Markus Kottlaender <markus@intevation.de>
parents: 3205
diff changeset
152 .dispatch("fairwayavailability/loadAvailableFairwayDepth", {
3191
c0cd5dfec153 statistics: persist fields to vuex
Thomas Junk <thomas.junk@intevation.de>
parents: 3185
diff changeset
153 feature: this.selectedFairwayAvailabilityFeature,
c0cd5dfec153 statistics: persist fields to vuex
Thomas Junk <thomas.junk@intevation.de>
parents: 3185
diff changeset
154 from: this.from,
c0cd5dfec153 statistics: persist fields to vuex
Thomas Junk <thomas.junk@intevation.de>
parents: 3185
diff changeset
155 to: this.to,
3198
b0328646e34f statistics: include los selection
Thomas Junk <thomas.junk@intevation.de>
parents: 3191
diff changeset
156 frequency: this.frequency,
b0328646e34f statistics: include los selection
Thomas Junk <thomas.junk@intevation.de>
parents: 3191
diff changeset
157 LOS: this.los
3191
c0cd5dfec153 statistics: persist fields to vuex
Thomas Junk <thomas.junk@intevation.de>
parents: 3185
diff changeset
158 })
c0cd5dfec153 statistics: persist fields to vuex
Thomas Junk <thomas.junk@intevation.de>
parents: 3185
diff changeset
159 .then(() => {
c0cd5dfec153 statistics: persist fields to vuex
Thomas Junk <thomas.junk@intevation.de>
parents: 3185
diff changeset
160 this.loading = false;
c0cd5dfec153 statistics: persist fields to vuex
Thomas Junk <thomas.junk@intevation.de>
parents: 3185
diff changeset
161 this.$store.commit("application/paneSetup", "AVAILABLEFAIRWAYDEPTH");
c0cd5dfec153 statistics: persist fields to vuex
Thomas Junk <thomas.junk@intevation.de>
parents: 3185
diff changeset
162 })
c0cd5dfec153 statistics: persist fields to vuex
Thomas Junk <thomas.junk@intevation.de>
parents: 3185
diff changeset
163 .catch(error => {
c0cd5dfec153 statistics: persist fields to vuex
Thomas Junk <thomas.junk@intevation.de>
parents: 3185
diff changeset
164 console.log(error);
c0cd5dfec153 statistics: persist fields to vuex
Thomas Junk <thomas.junk@intevation.de>
parents: 3185
diff changeset
165 const { status, data } = error.response;
c0cd5dfec153 statistics: persist fields to vuex
Thomas Junk <thomas.junk@intevation.de>
parents: 3185
diff changeset
166 displayError({
c0cd5dfec153 statistics: persist fields to vuex
Thomas Junk <thomas.junk@intevation.de>
parents: 3185
diff changeset
167 title: this.$gettext("Backend Error"),
c0cd5dfec153 statistics: persist fields to vuex
Thomas Junk <thomas.junk@intevation.de>
parents: 3185
diff changeset
168 message: `${status}: ${data.message || data}`
c0cd5dfec153 statistics: persist fields to vuex
Thomas Junk <thomas.junk@intevation.de>
parents: 3185
diff changeset
169 });
c0cd5dfec153 statistics: persist fields to vuex
Thomas Junk <thomas.junk@intevation.de>
parents: 3185
diff changeset
170 });
3178
5ec34e08b01d available_fairway_depth: display mock
Thomas Junk <thomas.junk@intevation.de>
parents: 3175
diff changeset
171 },
3159
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
172 close() {
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
173 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
174 },
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
175 entrySelected() {
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
176 if (this.type === this.$options.BOTTLENECKS) {
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
177 this.openLayersMap()
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
178 .getLayer("BOTTLENECKS")
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
179 .setVisible(true);
3178
5ec34e08b01d available_fairway_depth: display mock
Thomas Junk <thomas.junk@intevation.de>
parents: 3175
diff changeset
180 if (this.showProfiles) {
5ec34e08b01d available_fairway_depth: display mock
Thomas Junk <thomas.junk@intevation.de>
parents: 3175
diff changeset
181 this.$store.dispatch(
5ec34e08b01d available_fairway_depth: display mock
Thomas Junk <thomas.junk@intevation.de>
parents: 3175
diff changeset
182 "bottlenecks/setSelectedBottleneck",
3183
f64cc98746a1 statistics: put selected feature in fairwaystore
Thomas Junk <thomas.junk@intevation.de>
parents: 3178
diff changeset
183 this.selectedFairwayAvailabilityFeature.properties.name
3178
5ec34e08b01d available_fairway_depth: display mock
Thomas Junk <thomas.junk@intevation.de>
parents: 3175
diff changeset
184 );
5ec34e08b01d available_fairway_depth: display mock
Thomas Junk <thomas.junk@intevation.de>
parents: 3175
diff changeset
185 }
3172
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
186 }
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
187 if (this.type === this.$options.STRETCHES) {
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
188 this.openLayersMap()
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
189 .getLayer("STRETCHES")
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
190 .setVisible(true);
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
191 }
3183
f64cc98746a1 statistics: put selected feature in fairwaystore
Thomas Junk <thomas.junk@intevation.de>
parents: 3178
diff changeset
192 if (this.selectedFairwayAvailabilityFeature) {
3172
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
193 this.$store.dispatch("map/moveToFeauture", {
3183
f64cc98746a1 statistics: put selected feature in fairwaystore
Thomas Junk <thomas.junk@intevation.de>
parents: 3178
diff changeset
194 feature: this.selectedFairwayAvailabilityFeature,
3172
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
195 zoom: 17,
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
196 preventZoomOut: true
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
197 });
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
198 }
3173
1287b031424c statistics: sprinkled fairy dust on to bottleneck selection
Thomas Junk <thomas.junk@intevation.de>
parents: 3172
diff changeset
199 },
1287b031424c statistics: sprinkled fairy dust on to bottleneck selection
Thomas Junk <thomas.junk@intevation.de>
parents: 3172
diff changeset
200 setSelectedBottleneck() {
1287b031424c statistics: sprinkled fairy dust on to bottleneck selection
Thomas Junk <thomas.junk@intevation.de>
parents: 3172
diff changeset
201 const bn = this.bottlenecksList.filter(
1287b031424c statistics: sprinkled fairy dust on to bottleneck selection
Thomas Junk <thomas.junk@intevation.de>
parents: 3172
diff changeset
202 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
203 )[0];
3207
ba7bc3740fb3 client: renamed store modules to better reflect their context
Markus Kottlaender <markus@intevation.de>
parents: 3205
diff changeset
204 this.$store.commit(
ba7bc3740fb3 client: renamed store modules to better reflect their context
Markus Kottlaender <markus@intevation.de>
parents: 3205
diff changeset
205 "fairwayavailability/setSelectedFairwayAvailability",
ba7bc3740fb3 client: renamed store modules to better reflect their context
Markus Kottlaender <markus@intevation.de>
parents: 3205
diff changeset
206 bn
ba7bc3740fb3 client: renamed store modules to better reflect their context
Markus Kottlaender <markus@intevation.de>
parents: 3205
diff changeset
207 );
3159
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
208 }
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
209 },
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
210 computed: {
3178
5ec34e08b01d available_fairway_depth: display mock
Thomas Junk <thomas.junk@intevation.de>
parents: 3175
diff changeset
211 ...mapState("application", ["showStatistics", "paneSetup", "showProfiles"]),
3207
ba7bc3740fb3 client: renamed store modules to better reflect their context
Markus Kottlaender <markus@intevation.de>
parents: 3205
diff changeset
212 ...mapState("fairwayavailability", [
3191
c0cd5dfec153 statistics: persist fields to vuex
Thomas Junk <thomas.junk@intevation.de>
parents: 3185
diff changeset
213 "selectedFairwayAvailabilityFeature",
c0cd5dfec153 statistics: persist fields to vuex
Thomas Junk <thomas.junk@intevation.de>
parents: 3185
diff changeset
214 "from",
c0cd5dfec153 statistics: persist fields to vuex
Thomas Junk <thomas.junk@intevation.de>
parents: 3185
diff changeset
215 "to",
3198
b0328646e34f statistics: include los selection
Thomas Junk <thomas.junk@intevation.de>
parents: 3191
diff changeset
216 "frequency",
b0328646e34f statistics: include los selection
Thomas Junk <thomas.junk@intevation.de>
parents: 3191
diff changeset
217 "LOS"
3191
c0cd5dfec153 statistics: persist fields to vuex
Thomas Junk <thomas.junk@intevation.de>
parents: 3185
diff changeset
218 ]),
3172
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
219 ...mapState("imports", ["stretches"]),
3173
1287b031424c statistics: sprinkled fairy dust on to bottleneck selection
Thomas Junk <thomas.junk@intevation.de>
parents: 3172
diff changeset
220 ...mapState("bottlenecks", ["bottlenecksList", "selectedBottleneck"]),
3172
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
221 ...mapGetters("map", ["openLayersMap"]),
3191
c0cd5dfec153 statistics: persist fields to vuex
Thomas Junk <thomas.junk@intevation.de>
parents: 3185
diff changeset
222 isComplete() {
c0cd5dfec153 statistics: persist fields to vuex
Thomas Junk <thomas.junk@intevation.de>
parents: 3185
diff changeset
223 return (
c0cd5dfec153 statistics: persist fields to vuex
Thomas Junk <thomas.junk@intevation.de>
parents: 3185
diff changeset
224 this.from == null ||
c0cd5dfec153 statistics: persist fields to vuex
Thomas Junk <thomas.junk@intevation.de>
parents: 3185
diff changeset
225 this.to == null ||
c0cd5dfec153 statistics: persist fields to vuex
Thomas Junk <thomas.junk@intevation.de>
parents: 3185
diff changeset
226 this.frequency == null ||
c0cd5dfec153 statistics: persist fields to vuex
Thomas Junk <thomas.junk@intevation.de>
parents: 3185
diff changeset
227 this.selectedFairwayAvailabilityFeature == null
c0cd5dfec153 statistics: persist fields to vuex
Thomas Junk <thomas.junk@intevation.de>
parents: 3185
diff changeset
228 );
c0cd5dfec153 statistics: persist fields to vuex
Thomas Junk <thomas.junk@intevation.de>
parents: 3185
diff changeset
229 },
3205
bf571429515f client: fairway availability: moved component's type property to store to manipulate it from outside
Markus Kottlaender <markus@intevation.de>
parents: 3199
diff changeset
230 type: {
bf571429515f client: fairway availability: moved component's type property to store to manipulate it from outside
Markus Kottlaender <markus@intevation.de>
parents: 3199
diff changeset
231 get() {
3207
ba7bc3740fb3 client: renamed store modules to better reflect their context
Markus Kottlaender <markus@intevation.de>
parents: 3205
diff changeset
232 return this.$store.state.fairwayavailability.type;
3205
bf571429515f client: fairway availability: moved component's type property to store to manipulate it from outside
Markus Kottlaender <markus@intevation.de>
parents: 3199
diff changeset
233 },
bf571429515f client: fairway availability: moved component's type property to store to manipulate it from outside
Markus Kottlaender <markus@intevation.de>
parents: 3199
diff changeset
234 set(type) {
3207
ba7bc3740fb3 client: renamed store modules to better reflect their context
Markus Kottlaender <markus@intevation.de>
parents: 3205
diff changeset
235 this.$store.commit("fairwayavailability/type", type);
3205
bf571429515f client: fairway availability: moved component's type property to store to manipulate it from outside
Markus Kottlaender <markus@intevation.de>
parents: 3199
diff changeset
236 }
bf571429515f client: fairway availability: moved component's type property to store to manipulate it from outside
Markus Kottlaender <markus@intevation.de>
parents: 3199
diff changeset
237 },
3198
b0328646e34f statistics: include los selection
Thomas Junk <thomas.junk@intevation.de>
parents: 3191
diff changeset
238 los: {
b0328646e34f statistics: include los selection
Thomas Junk <thomas.junk@intevation.de>
parents: 3191
diff changeset
239 get() {
b0328646e34f statistics: include los selection
Thomas Junk <thomas.junk@intevation.de>
parents: 3191
diff changeset
240 return this.LOS;
b0328646e34f statistics: include los selection
Thomas Junk <thomas.junk@intevation.de>
parents: 3191
diff changeset
241 },
b0328646e34f statistics: include los selection
Thomas Junk <thomas.junk@intevation.de>
parents: 3191
diff changeset
242 set(value) {
3207
ba7bc3740fb3 client: renamed store modules to better reflect their context
Markus Kottlaender <markus@intevation.de>
parents: 3205
diff changeset
243 this.$store.commit("fairwayavailability/setLOS", value);
3198
b0328646e34f statistics: include los selection
Thomas Junk <thomas.junk@intevation.de>
parents: 3191
diff changeset
244 }
b0328646e34f statistics: include los selection
Thomas Junk <thomas.junk@intevation.de>
parents: 3191
diff changeset
245 },
3191
c0cd5dfec153 statistics: persist fields to vuex
Thomas Junk <thomas.junk@intevation.de>
parents: 3185
diff changeset
246 fromDate: {
c0cd5dfec153 statistics: persist fields to vuex
Thomas Junk <thomas.junk@intevation.de>
parents: 3185
diff changeset
247 get() {
c0cd5dfec153 statistics: persist fields to vuex
Thomas Junk <thomas.junk@intevation.de>
parents: 3185
diff changeset
248 return this.from;
c0cd5dfec153 statistics: persist fields to vuex
Thomas Junk <thomas.junk@intevation.de>
parents: 3185
diff changeset
249 },
c0cd5dfec153 statistics: persist fields to vuex
Thomas Junk <thomas.junk@intevation.de>
parents: 3185
diff changeset
250 set(value) {
3207
ba7bc3740fb3 client: renamed store modules to better reflect their context
Markus Kottlaender <markus@intevation.de>
parents: 3205
diff changeset
251 this.$store.commit("fairwayavailability/setFrom", value);
3191
c0cd5dfec153 statistics: persist fields to vuex
Thomas Junk <thomas.junk@intevation.de>
parents: 3185
diff changeset
252 }
c0cd5dfec153 statistics: persist fields to vuex
Thomas Junk <thomas.junk@intevation.de>
parents: 3185
diff changeset
253 },
c0cd5dfec153 statistics: persist fields to vuex
Thomas Junk <thomas.junk@intevation.de>
parents: 3185
diff changeset
254 toDate: {
c0cd5dfec153 statistics: persist fields to vuex
Thomas Junk <thomas.junk@intevation.de>
parents: 3185
diff changeset
255 get() {
c0cd5dfec153 statistics: persist fields to vuex
Thomas Junk <thomas.junk@intevation.de>
parents: 3185
diff changeset
256 return this.to;
c0cd5dfec153 statistics: persist fields to vuex
Thomas Junk <thomas.junk@intevation.de>
parents: 3185
diff changeset
257 },
c0cd5dfec153 statistics: persist fields to vuex
Thomas Junk <thomas.junk@intevation.de>
parents: 3185
diff changeset
258 set(value) {
3207
ba7bc3740fb3 client: renamed store modules to better reflect their context
Markus Kottlaender <markus@intevation.de>
parents: 3205
diff changeset
259 this.$store.commit("fairwayavailability/setTo", value);
3191
c0cd5dfec153 statistics: persist fields to vuex
Thomas Junk <thomas.junk@intevation.de>
parents: 3185
diff changeset
260 }
c0cd5dfec153 statistics: persist fields to vuex
Thomas Junk <thomas.junk@intevation.de>
parents: 3185
diff changeset
261 },
c0cd5dfec153 statistics: persist fields to vuex
Thomas Junk <thomas.junk@intevation.de>
parents: 3185
diff changeset
262 selectedFrequency: {
c0cd5dfec153 statistics: persist fields to vuex
Thomas Junk <thomas.junk@intevation.de>
parents: 3185
diff changeset
263 get() {
c0cd5dfec153 statistics: persist fields to vuex
Thomas Junk <thomas.junk@intevation.de>
parents: 3185
diff changeset
264 return this.frequency;
c0cd5dfec153 statistics: persist fields to vuex
Thomas Junk <thomas.junk@intevation.de>
parents: 3185
diff changeset
265 },
c0cd5dfec153 statistics: persist fields to vuex
Thomas Junk <thomas.junk@intevation.de>
parents: 3185
diff changeset
266 set(value) {
3207
ba7bc3740fb3 client: renamed store modules to better reflect their context
Markus Kottlaender <markus@intevation.de>
parents: 3205
diff changeset
267 this.$store.commit("fairwayavailability/setFrequency", value);
3191
c0cd5dfec153 statistics: persist fields to vuex
Thomas Junk <thomas.junk@intevation.de>
parents: 3185
diff changeset
268 }
c0cd5dfec153 statistics: persist fields to vuex
Thomas Junk <thomas.junk@intevation.de>
parents: 3185
diff changeset
269 },
3183
f64cc98746a1 statistics: put selected feature in fairwaystore
Thomas Junk <thomas.junk@intevation.de>
parents: 3178
diff changeset
270 selectedEntry: {
f64cc98746a1 statistics: put selected feature in fairwaystore
Thomas Junk <thomas.junk@intevation.de>
parents: 3178
diff changeset
271 get() {
f64cc98746a1 statistics: put selected feature in fairwaystore
Thomas Junk <thomas.junk@intevation.de>
parents: 3178
diff changeset
272 return this.selectedFairwayAvailabilityFeature;
f64cc98746a1 statistics: put selected feature in fairwaystore
Thomas Junk <thomas.junk@intevation.de>
parents: 3178
diff changeset
273 },
f64cc98746a1 statistics: put selected feature in fairwaystore
Thomas Junk <thomas.junk@intevation.de>
parents: 3178
diff changeset
274 set(feature) {
3207
ba7bc3740fb3 client: renamed store modules to better reflect their context
Markus Kottlaender <markus@intevation.de>
parents: 3205
diff changeset
275 this.$store.commit(
ba7bc3740fb3 client: renamed store modules to better reflect their context
Markus Kottlaender <markus@intevation.de>
parents: 3205
diff changeset
276 "fairwayavailability/setSelectedFairwayAvailability",
ba7bc3740fb3 client: renamed store modules to better reflect their context
Markus Kottlaender <markus@intevation.de>
parents: 3205
diff changeset
277 feature
ba7bc3740fb3 client: renamed store modules to better reflect their context
Markus Kottlaender <markus@intevation.de>
parents: 3205
diff changeset
278 );
3183
f64cc98746a1 statistics: put selected feature in fairwaystore
Thomas Junk <thomas.junk@intevation.de>
parents: 3178
diff changeset
279 }
f64cc98746a1 statistics: put selected feature in fairwaystore
Thomas Junk <thomas.junk@intevation.de>
parents: 3178
diff changeset
280 },
3172
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
281 entries() {
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
282 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
283 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
284 return [];
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
285 },
3159
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
286 label() {
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
287 return this.$gettext("Statistics");
3172
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
288 },
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
289 empty() {
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
290 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
291 return this.$gettext("Select bottleneck");
3172
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
292 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
293 return this.$gettext("Select strectch");
1287b031424c statistics: sprinkled fairy dust on to bottleneck selection
Thomas Junk <thomas.junk@intevation.de>
parents: 3172
diff changeset
294 return this.$gettext("Select section");
3159
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
295 }
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
296 },
3172
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
297 watch: {
3173
1287b031424c statistics: sprinkled fairy dust on to bottleneck selection
Thomas Junk <thomas.junk@intevation.de>
parents: 3172
diff changeset
298 selectedBottleneck() {
3174
aeb9d6fc640a statistics: sprinkled more fairy dust on to bottleneck selection
Thomas Junk <thomas.junk@intevation.de>
parents: 3173
diff changeset
299 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
300 this.setSelectedBottleneck();
1287b031424c statistics: sprinkled fairy dust on to bottleneck selection
Thomas Junk <thomas.junk@intevation.de>
parents: 3172
diff changeset
301 },
3172
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
302 type() {
3175
296392d4539c client: statistics dialog: fix resetting selectedEntry
Markus Kottlaender <markus@intevation.de>
parents: 3174
diff changeset
303 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
304 this.setSelectedBottleneck();
1287b031424c statistics: sprinkled fairy dust on to bottleneck selection
Thomas Junk <thomas.junk@intevation.de>
parents: 3172
diff changeset
305 } else {
3207
ba7bc3740fb3 client: renamed store modules to better reflect their context
Markus Kottlaender <markus@intevation.de>
parents: 3205
diff changeset
306 this.$store.commit(
ba7bc3740fb3 client: renamed store modules to better reflect their context
Markus Kottlaender <markus@intevation.de>
parents: 3205
diff changeset
307 "fairwayavailability/setSelectedFairwayAvailability",
ba7bc3740fb3 client: renamed store modules to better reflect their context
Markus Kottlaender <markus@intevation.de>
parents: 3205
diff changeset
308 null
ba7bc3740fb3 client: renamed store modules to better reflect their context
Markus Kottlaender <markus@intevation.de>
parents: 3205
diff changeset
309 );
3173
1287b031424c statistics: sprinkled fairy dust on to bottleneck selection
Thomas Junk <thomas.junk@intevation.de>
parents: 3172
diff changeset
310 }
3172
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
311 this.openLayersMap()
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
312 .getLayer("STRETCHES")
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
313 .setVisible(true);
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
314 },
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
315 showStatistics() {
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
316 if (this.showStatistics) {
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
317 this.loading = true;
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
318 this.$store.dispatch("bottlenecks/loadBottlenecksList").then(() => {
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
319 this.$store.dispatch("imports/loadStretches").then(() => {
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
320 this.loading = false;
3173
1287b031424c statistics: sprinkled fairy dust on to bottleneck selection
Thomas Junk <thomas.junk@intevation.de>
parents: 3172
diff changeset
321 if (this.selectedBottleneck) this.setSelectedBottleneck();
3172
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
322 });
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
323 });
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
324 }
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
325 }
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
326 },
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
327 BOTTLENECKS: "bottlenecks",
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
328 SECTIONS: "sections",
975efa874acf statistic: choice between bottlenecks and stretches implemented
Thomas Junk <thomas.junk@intevation.de>
parents: 3159
diff changeset
329 STRETCHES: "stretches",
3191
c0cd5dfec153 statistics: persist fields to vuex
Thomas Junk <thomas.junk@intevation.de>
parents: 3185
diff changeset
330 AVAILABLEFAIRWAYDEPTH: app.$gettext("Available Fairway Depth"),
c0cd5dfec153 statistics: persist fields to vuex
Thomas Junk <thomas.junk@intevation.de>
parents: 3185
diff changeset
331 FREQUENCIES: {
c0cd5dfec153 statistics: persist fields to vuex
Thomas Junk <thomas.junk@intevation.de>
parents: 3185
diff changeset
332 MONTHLY: "monthly",
c0cd5dfec153 statistics: persist fields to vuex
Thomas Junk <thomas.junk@intevation.de>
parents: 3185
diff changeset
333 QUARTERLY: "quarterly",
c0cd5dfec153 statistics: persist fields to vuex
Thomas Junk <thomas.junk@intevation.de>
parents: 3185
diff changeset
334 YEARLY: "yearly"
c0cd5dfec153 statistics: persist fields to vuex
Thomas Junk <thomas.junk@intevation.de>
parents: 3185
diff changeset
335 }
3159
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
336 };
4f4905b57fcf toolbar: added statistics dialog component
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
337 </script>