Mercurial > gemma
annotate client/src/components/importoverview/BottleneckDetail.vue @ 2945:ab771ea5e4fe
client: importoverview: improved display of date interval
author | Markus Kottlaender <markus@intevation.de> |
---|---|
date | Fri, 05 Apr 2019 10:37:58 +0200 |
parents | 73f537379203 |
children | f6cd4ebd8562 |
rev | line source |
---|---|
2602
5d0e5159190f
overview2: detail components for unified log
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
1 <template> |
2717
5b990f612420
import_review: rename overview to review. More space for logs
Thomas Junk <thomas.junk@intevation.de>
parents:
2708
diff
changeset
|
2 <div |
5b990f612420
import_review: rename overview to review. More space for logs
Thomas Junk <thomas.junk@intevation.de>
parents:
2708
diff
changeset
|
3 :class="{ |
5b990f612420
import_review: rename overview to review. More space for logs
Thomas Junk <thomas.junk@intevation.de>
parents:
2708
diff
changeset
|
4 bottleneckdetails: true, |
2880
c40540889b53
client: code cleanup, slight style improvements
Markus Kottlaender <markus@intevation.de>
parents:
2732
diff
changeset
|
5 full: !showLogs, |
c40540889b53
client: code cleanup, slight style improvements
Markus Kottlaender <markus@intevation.de>
parents:
2732
diff
changeset
|
6 split: showLogs |
2717
5b990f612420
import_review: rename overview to review. More space for logs
Thomas Junk <thomas.junk@intevation.de>
parents:
2708
diff
changeset
|
7 }" |
5b990f612420
import_review: rename overview to review. More space for logs
Thomas Junk <thomas.junk@intevation.de>
parents:
2708
diff
changeset
|
8 > |
2944
73f537379203
client: importoverview: improved style
Markus Kottlaender <markus@intevation.de>
parents:
2942
diff
changeset
|
9 <div v-for="(bottleneck, index) in bottlenecks" :key="index"> |
73f537379203
client: importoverview: improved style
Markus Kottlaender <markus@intevation.de>
parents:
2942
diff
changeset
|
10 <div class="d-flex pl-2"> |
2942
30c906733154
client: importsoverview: improved bottleneck details style and fixed bug when toggeling the first item
Markus Kottlaender <markus@intevation.de>
parents:
2935
diff
changeset
|
11 <div |
30c906733154
client: importsoverview: improved bottleneck details style and fixed bug when toggeling the first item
Markus Kottlaender <markus@intevation.de>
parents:
2935
diff
changeset
|
12 @click="showBottleneckDetails(index)" |
30c906733154
client: importsoverview: improved bottleneck details style and fixed bug when toggeling the first item
Markus Kottlaender <markus@intevation.de>
parents:
2935
diff
changeset
|
13 class="mt-auto mb-auto text-info text-left" |
30c906733154
client: importsoverview: improved bottleneck details style and fixed bug when toggeling the first item
Markus Kottlaender <markus@intevation.de>
parents:
2935
diff
changeset
|
14 > |
30c906733154
client: importsoverview: improved bottleneck details style and fixed bug when toggeling the first item
Markus Kottlaender <markus@intevation.de>
parents:
2935
diff
changeset
|
15 <UISpinnerButton |
30c906733154
client: importsoverview: improved bottleneck details style and fixed bug when toggeling the first item
Markus Kottlaender <markus@intevation.de>
parents:
2935
diff
changeset
|
16 :state="showBottleneckDetail === index" |
30c906733154
client: importsoverview: improved bottleneck details style and fixed bug when toggeling the first item
Markus Kottlaender <markus@intevation.de>
parents:
2935
diff
changeset
|
17 :icons="['angle-right', 'angle-down']" |
30c906733154
client: importsoverview: improved bottleneck details style and fixed bug when toggeling the first item
Markus Kottlaender <markus@intevation.de>
parents:
2935
diff
changeset
|
18 class="text-info" |
30c906733154
client: importsoverview: improved bottleneck details style and fixed bug when toggeling the first item
Markus Kottlaender <markus@intevation.de>
parents:
2935
diff
changeset
|
19 /> |
30c906733154
client: importsoverview: improved bottleneck details style and fixed bug when toggeling the first item
Markus Kottlaender <markus@intevation.de>
parents:
2935
diff
changeset
|
20 </div> |
30c906733154
client: importsoverview: improved bottleneck details style and fixed bug when toggeling the first item
Markus Kottlaender <markus@intevation.de>
parents:
2935
diff
changeset
|
21 <a @click="moveToBottleneck(index)" href="#"> |
30c906733154
client: importsoverview: improved bottleneck details style and fixed bug when toggeling the first item
Markus Kottlaender <markus@intevation.de>
parents:
2935
diff
changeset
|
22 {{ bottleneck.properties.objnam }} |
30c906733154
client: importsoverview: improved bottleneck details style and fixed bug when toggeling the first item
Markus Kottlaender <markus@intevation.de>
parents:
2935
diff
changeset
|
23 </a> |
30c906733154
client: importsoverview: improved bottleneck details style and fixed bug when toggeling the first item
Markus Kottlaender <markus@intevation.de>
parents:
2935
diff
changeset
|
24 </div> |
30c906733154
client: importsoverview: improved bottleneck details style and fixed bug when toggeling the first item
Markus Kottlaender <markus@intevation.de>
parents:
2935
diff
changeset
|
25 |
2944
73f537379203
client: importoverview: improved style
Markus Kottlaender <markus@intevation.de>
parents:
2942
diff
changeset
|
26 <div class="d-flex properties" v-if="showBottleneckDetail === index"> |
73f537379203
client: importoverview: improved style
Markus Kottlaender <markus@intevation.de>
parents:
2942
diff
changeset
|
27 <table class="w-100"> |
2942
30c906733154
client: importsoverview: improved bottleneck details style and fixed bug when toggeling the first item
Markus Kottlaender <markus@intevation.de>
parents:
2935
diff
changeset
|
28 <tr |
30c906733154
client: importsoverview: improved bottleneck details style and fixed bug when toggeling the first item
Markus Kottlaender <markus@intevation.de>
parents:
2935
diff
changeset
|
29 v-for="(info, index) in Object.keys(bottleneck.properties)" |
30c906733154
client: importsoverview: improved bottleneck details style and fixed bug when toggeling the first item
Markus Kottlaender <markus@intevation.de>
parents:
2935
diff
changeset
|
30 :key="index" |
2647
c52bf6f994c0
overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents:
2602
diff
changeset
|
31 > |
2944
73f537379203
client: importoverview: improved style
Markus Kottlaender <markus@intevation.de>
parents:
2942
diff
changeset
|
32 <td class="pl-4">{{ info }}</td> |
73f537379203
client: importoverview: improved style
Markus Kottlaender <markus@intevation.de>
parents:
2942
diff
changeset
|
33 <td> |
2942
30c906733154
client: importsoverview: improved bottleneck details style and fixed bug when toggeling the first item
Markus Kottlaender <markus@intevation.de>
parents:
2935
diff
changeset
|
34 {{ bottleneck.properties[info] }} |
30c906733154
client: importsoverview: improved bottleneck details style and fixed bug when toggeling the first item
Markus Kottlaender <markus@intevation.de>
parents:
2935
diff
changeset
|
35 </td> |
30c906733154
client: importsoverview: improved bottleneck details style and fixed bug when toggeling the first item
Markus Kottlaender <markus@intevation.de>
parents:
2935
diff
changeset
|
36 </tr> |
30c906733154
client: importsoverview: improved bottleneck details style and fixed bug when toggeling the first item
Markus Kottlaender <markus@intevation.de>
parents:
2935
diff
changeset
|
37 </table> |
2647
c52bf6f994c0
overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents:
2602
diff
changeset
|
38 </div> |
c52bf6f994c0
overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents:
2602
diff
changeset
|
39 </div> |
c52bf6f994c0
overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents:
2602
diff
changeset
|
40 </div> |
2602
5d0e5159190f
overview2: detail components for unified log
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
41 </template> |
5d0e5159190f
overview2: detail components for unified log
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
42 |
2882
6538ee93df72
client: moved style blocks below template blocks
Markus Kottlaender <markus@intevation.de>
parents:
2880
diff
changeset
|
43 <style lang="sass" scoped> |
6538ee93df72
client: moved style blocks below template blocks
Markus Kottlaender <markus@intevation.de>
parents:
2880
diff
changeset
|
44 .bottleneckdetails |
6538ee93df72
client: moved style blocks below template blocks
Markus Kottlaender <markus@intevation.de>
parents:
2880
diff
changeset
|
45 width: 100% |
6538ee93df72
client: moved style blocks below template blocks
Markus Kottlaender <markus@intevation.de>
parents:
2880
diff
changeset
|
46 overflow-y: auto |
2942
30c906733154
client: importsoverview: improved bottleneck details style and fixed bug when toggeling the first item
Markus Kottlaender <markus@intevation.de>
parents:
2935
diff
changeset
|
47 > div |
30c906733154
client: importsoverview: improved bottleneck details style and fixed bug when toggeling the first item
Markus Kottlaender <markus@intevation.de>
parents:
2935
diff
changeset
|
48 border-top: dashed 1px #dee2e6 |
30c906733154
client: importsoverview: improved bottleneck details style and fixed bug when toggeling the first item
Markus Kottlaender <markus@intevation.de>
parents:
2935
diff
changeset
|
49 &:first-child |
30c906733154
client: importsoverview: improved bottleneck details style and fixed bug when toggeling the first item
Markus Kottlaender <markus@intevation.de>
parents:
2935
diff
changeset
|
50 border-top: none |
2944
73f537379203
client: importoverview: improved style
Markus Kottlaender <markus@intevation.de>
parents:
2942
diff
changeset
|
51 .properties |
73f537379203
client: importoverview: improved style
Markus Kottlaender <markus@intevation.de>
parents:
2942
diff
changeset
|
52 position: relative |
73f537379203
client: importoverview: improved style
Markus Kottlaender <markus@intevation.de>
parents:
2942
diff
changeset
|
53 overflow: hidden |
73f537379203
client: importoverview: improved style
Markus Kottlaender <markus@intevation.de>
parents:
2942
diff
changeset
|
54 &::after |
73f537379203
client: importoverview: improved style
Markus Kottlaender <markus@intevation.de>
parents:
2942
diff
changeset
|
55 content: '' |
73f537379203
client: importoverview: improved style
Markus Kottlaender <markus@intevation.de>
parents:
2942
diff
changeset
|
56 position: absolute |
73f537379203
client: importoverview: improved style
Markus Kottlaender <markus@intevation.de>
parents:
2942
diff
changeset
|
57 top: 0 |
73f537379203
client: importoverview: improved style
Markus Kottlaender <markus@intevation.de>
parents:
2942
diff
changeset
|
58 right: -5px |
73f537379203
client: importoverview: improved style
Markus Kottlaender <markus@intevation.de>
parents:
2942
diff
changeset
|
59 bottom: 0 |
73f537379203
client: importoverview: improved style
Markus Kottlaender <markus@intevation.de>
parents:
2942
diff
changeset
|
60 left: -5px |
73f537379203
client: importoverview: improved style
Markus Kottlaender <markus@intevation.de>
parents:
2942
diff
changeset
|
61 box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.4) |
73f537379203
client: importoverview: improved style
Markus Kottlaender <markus@intevation.de>
parents:
2942
diff
changeset
|
62 tr |
73f537379203
client: importoverview: improved style
Markus Kottlaender <markus@intevation.de>
parents:
2942
diff
changeset
|
63 font-size: 0.7rem |
73f537379203
client: importoverview: improved style
Markus Kottlaender <markus@intevation.de>
parents:
2942
diff
changeset
|
64 &:nth-child(odd) |
73f537379203
client: importoverview: improved style
Markus Kottlaender <markus@intevation.de>
parents:
2942
diff
changeset
|
65 background-color: #f8f9fa |
2882
6538ee93df72
client: moved style blocks below template blocks
Markus Kottlaender <markus@intevation.de>
parents:
2880
diff
changeset
|
66 |
6538ee93df72
client: moved style blocks below template blocks
Markus Kottlaender <markus@intevation.de>
parents:
2880
diff
changeset
|
67 .split |
6538ee93df72
client: moved style blocks below template blocks
Markus Kottlaender <markus@intevation.de>
parents:
2880
diff
changeset
|
68 max-height: 35vh |
6538ee93df72
client: moved style blocks below template blocks
Markus Kottlaender <markus@intevation.de>
parents:
2880
diff
changeset
|
69 |
6538ee93df72
client: moved style blocks below template blocks
Markus Kottlaender <markus@intevation.de>
parents:
2880
diff
changeset
|
70 .full |
6538ee93df72
client: moved style blocks below template blocks
Markus Kottlaender <markus@intevation.de>
parents:
2880
diff
changeset
|
71 max-height: 70vh |
6538ee93df72
client: moved style blocks below template blocks
Markus Kottlaender <markus@intevation.de>
parents:
2880
diff
changeset
|
72 </style> |
6538ee93df72
client: moved style blocks below template blocks
Markus Kottlaender <markus@intevation.de>
parents:
2880
diff
changeset
|
73 |
2602
5d0e5159190f
overview2: detail components for unified log
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
74 <script> |
5d0e5159190f
overview2: detail components for unified log
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
75 /* This is Free Software under GNU Affero General Public License v >= 3.0 |
5d0e5159190f
overview2: detail components for unified log
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
76 * without warranty, see README.md and license for details. |
5d0e5159190f
overview2: detail components for unified log
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
77 * |
5d0e5159190f
overview2: detail components for unified log
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
78 * SPDX-License-Identifier: AGPL-3.0-or-later |
5d0e5159190f
overview2: detail components for unified log
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
79 * License-Filename: LICENSES/AGPL-3.0.txt |
5d0e5159190f
overview2: detail components for unified log
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
80 * |
5d0e5159190f
overview2: detail components for unified log
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
81 * Copyright (C) 2018 by via donau |
5d0e5159190f
overview2: detail components for unified log
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
82 * – Österreichische Wasserstraßen-Gesellschaft mbH |
5d0e5159190f
overview2: detail components for unified log
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
83 * Software engineering by Intevation GmbH |
5d0e5159190f
overview2: detail components for unified log
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
84 * |
5d0e5159190f
overview2: detail components for unified log
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
85 * Author(s): |
5d0e5159190f
overview2: detail components for unified log
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
86 * Thomas Junk <thomas.junk@intevation.de> |
5d0e5159190f
overview2: detail components for unified log
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
87 */ |
2647
c52bf6f994c0
overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents:
2602
diff
changeset
|
88 |
c52bf6f994c0
overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents:
2602
diff
changeset
|
89 import { LAYERS } from "@/store/map.js"; |
c52bf6f994c0
overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents:
2602
diff
changeset
|
90 import { HTTP } from "@/lib/http"; |
c52bf6f994c0
overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents:
2602
diff
changeset
|
91 import { WFS } from "ol/format.js"; |
c52bf6f994c0
overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents:
2602
diff
changeset
|
92 import { or as orFilter, equalTo as equalToFilter } from "ol/format/filter.js"; |
c52bf6f994c0
overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents:
2602
diff
changeset
|
93 import { displayError } from "@/lib/errors.js"; |
2717
5b990f612420
import_review: rename overview to review. More space for logs
Thomas Junk <thomas.junk@intevation.de>
parents:
2708
diff
changeset
|
94 import { mapState } from "vuex"; |
2647
c52bf6f994c0
overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents:
2602
diff
changeset
|
95 |
2602
5d0e5159190f
overview2: detail components for unified log
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
96 export default { |
2647
c52bf6f994c0
overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents:
2602
diff
changeset
|
97 data() { |
c52bf6f994c0
overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents:
2602
diff
changeset
|
98 return { |
c52bf6f994c0
overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents:
2602
diff
changeset
|
99 bottlenecks: [], |
2942
30c906733154
client: importsoverview: improved bottleneck details style and fixed bug when toggeling the first item
Markus Kottlaender <markus@intevation.de>
parents:
2935
diff
changeset
|
100 showBottleneckDetail: null |
2647
c52bf6f994c0
overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents:
2602
diff
changeset
|
101 }; |
c52bf6f994c0
overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents:
2602
diff
changeset
|
102 }, |
c52bf6f994c0
overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents:
2602
diff
changeset
|
103 mounted() { |
c52bf6f994c0
overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents:
2602
diff
changeset
|
104 this.loadBottlenecks(); |
c52bf6f994c0
overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents:
2602
diff
changeset
|
105 }, |
2717
5b990f612420
import_review: rename overview to review. More space for logs
Thomas Junk <thomas.junk@intevation.de>
parents:
2708
diff
changeset
|
106 computed: { |
2732
0ab7985ef008
import_review: fixed flakey display of logs
Thomas Junk <thomas.junk@intevation.de>
parents:
2717
diff
changeset
|
107 ...mapState("imports", ["showLogs", "details"]) |
2717
5b990f612420
import_review: rename overview to review. More space for logs
Thomas Junk <thomas.junk@intevation.de>
parents:
2708
diff
changeset
|
108 }, |
2647
c52bf6f994c0
overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents:
2602
diff
changeset
|
109 methods: { |
c52bf6f994c0
overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents:
2602
diff
changeset
|
110 loadBottlenecks() { |
c52bf6f994c0
overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents:
2602
diff
changeset
|
111 const generateFilter = () => { |
2685
39a05f8c34e6
import_overview: Refactoring of detailed information.
Thomas Junk <thomas.junk@intevation.de>
parents:
2647
diff
changeset
|
112 const { bottlenecks } = this.details.summary; |
2647
c52bf6f994c0
overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents:
2602
diff
changeset
|
113 if (bottlenecks.length === 1) |
c52bf6f994c0
overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents:
2602
diff
changeset
|
114 return equalToFilter("bottleneck_id", bottlenecks[0]); |
c52bf6f994c0
overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents:
2602
diff
changeset
|
115 const orExpressions = bottlenecks.map(x => { |
c52bf6f994c0
overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents:
2602
diff
changeset
|
116 return equalToFilter("bottleneck_id", x); |
c52bf6f994c0
overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents:
2602
diff
changeset
|
117 }); |
c52bf6f994c0
overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents:
2602
diff
changeset
|
118 return orFilter(...orExpressions); |
c52bf6f994c0
overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents:
2602
diff
changeset
|
119 }; |
c52bf6f994c0
overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents:
2602
diff
changeset
|
120 const filterExpression = generateFilter(); |
c52bf6f994c0
overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents:
2602
diff
changeset
|
121 const bottleneckFeatureCollectionRequest = new WFS().writeGetFeature({ |
c52bf6f994c0
overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents:
2602
diff
changeset
|
122 srsName: "EPSG:4326", |
c52bf6f994c0
overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents:
2602
diff
changeset
|
123 featureNS: "gemma", |
c52bf6f994c0
overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents:
2602
diff
changeset
|
124 featurePrefix: "gemma", |
c52bf6f994c0
overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents:
2602
diff
changeset
|
125 featureTypes: ["bottlenecks_geoserver"], |
c52bf6f994c0
overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents:
2602
diff
changeset
|
126 outputFormat: "application/json", |
c52bf6f994c0
overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents:
2602
diff
changeset
|
127 filter: filterExpression |
c52bf6f994c0
overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents:
2602
diff
changeset
|
128 }); |
c52bf6f994c0
overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents:
2602
diff
changeset
|
129 HTTP.post( |
c52bf6f994c0
overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents:
2602
diff
changeset
|
130 "/internal/wfs", |
c52bf6f994c0
overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents:
2602
diff
changeset
|
131 new XMLSerializer().serializeToString( |
c52bf6f994c0
overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents:
2602
diff
changeset
|
132 bottleneckFeatureCollectionRequest |
c52bf6f994c0
overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents:
2602
diff
changeset
|
133 ), |
c52bf6f994c0
overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents:
2602
diff
changeset
|
134 { |
c52bf6f994c0
overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents:
2602
diff
changeset
|
135 headers: { |
c52bf6f994c0
overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents:
2602
diff
changeset
|
136 "X-Gemma-Auth": localStorage.getItem("token"), |
c52bf6f994c0
overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents:
2602
diff
changeset
|
137 "Content-type": "text/xml; charset=UTF-8" |
c52bf6f994c0
overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents:
2602
diff
changeset
|
138 } |
c52bf6f994c0
overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents:
2602
diff
changeset
|
139 } |
c52bf6f994c0
overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents:
2602
diff
changeset
|
140 ) |
c52bf6f994c0
overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents:
2602
diff
changeset
|
141 .then(response => { |
c52bf6f994c0
overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents:
2602
diff
changeset
|
142 this.bottlenecks = response.data.features; |
c52bf6f994c0
overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents:
2602
diff
changeset
|
143 }) |
c52bf6f994c0
overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents:
2602
diff
changeset
|
144 .catch(error => { |
c52bf6f994c0
overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents:
2602
diff
changeset
|
145 const { status, data } = error.response; |
c52bf6f994c0
overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents:
2602
diff
changeset
|
146 displayError({ |
c52bf6f994c0
overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents:
2602
diff
changeset
|
147 title: this.$gettext("Backend Error"), |
c52bf6f994c0
overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents:
2602
diff
changeset
|
148 message: `${status}: ${data.message || data}` |
c52bf6f994c0
overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents:
2602
diff
changeset
|
149 }); |
c52bf6f994c0
overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents:
2602
diff
changeset
|
150 }); |
c52bf6f994c0
overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents:
2602
diff
changeset
|
151 }, |
c52bf6f994c0
overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents:
2602
diff
changeset
|
152 moveToBottleneck(index) { |
c52bf6f994c0
overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents:
2602
diff
changeset
|
153 this.$store.commit("map/setLayerVisible", LAYERS.BOTTLENECKS); |
c52bf6f994c0
overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents:
2602
diff
changeset
|
154 this.moveToExtent(this.bottlenecks[index]); |
c52bf6f994c0
overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents:
2602
diff
changeset
|
155 }, |
c52bf6f994c0
overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents:
2602
diff
changeset
|
156 moveToExtent(feature) { |
c52bf6f994c0
overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents:
2602
diff
changeset
|
157 this.$store.commit("map/moveToExtent", { |
c52bf6f994c0
overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents:
2602
diff
changeset
|
158 feature: feature, |
c52bf6f994c0
overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents:
2602
diff
changeset
|
159 zoom: 17, |
c52bf6f994c0
overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents:
2602
diff
changeset
|
160 preventZoomOut: true |
c52bf6f994c0
overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents:
2602
diff
changeset
|
161 }); |
c52bf6f994c0
overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents:
2602
diff
changeset
|
162 }, |
c52bf6f994c0
overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents:
2602
diff
changeset
|
163 showBottleneckDetails(index) { |
2942
30c906733154
client: importsoverview: improved bottleneck details style and fixed bug when toggeling the first item
Markus Kottlaender <markus@intevation.de>
parents:
2935
diff
changeset
|
164 if (index === this.showBottleneckDetail) { |
30c906733154
client: importsoverview: improved bottleneck details style and fixed bug when toggeling the first item
Markus Kottlaender <markus@intevation.de>
parents:
2935
diff
changeset
|
165 this.showBottleneckDetail = null; |
30c906733154
client: importsoverview: improved bottleneck details style and fixed bug when toggeling the first item
Markus Kottlaender <markus@intevation.de>
parents:
2935
diff
changeset
|
166 } else { |
30c906733154
client: importsoverview: improved bottleneck details style and fixed bug when toggeling the first item
Markus Kottlaender <markus@intevation.de>
parents:
2935
diff
changeset
|
167 this.showBottleneckDetail = index; |
2647
c52bf6f994c0
overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents:
2602
diff
changeset
|
168 } |
c52bf6f994c0
overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents:
2602
diff
changeset
|
169 } |
2880
c40540889b53
client: code cleanup, slight style improvements
Markus Kottlaender <markus@intevation.de>
parents:
2732
diff
changeset
|
170 } |
2602
5d0e5159190f
overview2: detail components for unified log
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
171 }; |
5d0e5159190f
overview2: detail components for unified log
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
172 </script> |