Mercurial > gemma
comparison client/src/components/map/fairway/Profiles.vue @ 1394:b350b0b5cb6c
refactored fairwayprofile cross cuts
moved all profile relevant data into Fairwayprofile.vue
fixed width calculation of diagram
fix bug when switching between sounding data
fixed display/styling issue
code cleanup
author | Markus Kottlaender <markus@intevation.de> |
---|---|
date | Wed, 28 Nov 2018 11:48:45 +0100 |
parents | 801ae5f4bc5b |
children | 210e9f16f8a0 |
comparison
equal
deleted
inserted
replaced
1393:efd77496de75 | 1394:b350b0b5cb6c |
---|---|
183 selectedBottleneck: { | 183 selectedBottleneck: { |
184 get() { | 184 get() { |
185 return this.$store.state.bottlenecks.selectedBottleneck; | 185 return this.$store.state.bottlenecks.selectedBottleneck; |
186 }, | 186 }, |
187 set(name) { | 187 set(name) { |
188 this.loading = true; | |
189 this.$store.dispatch("bottlenecks/setSelectedBottleneck", name); | 188 this.$store.dispatch("bottlenecks/setSelectedBottleneck", name); |
190 } | 189 } |
191 }, | 190 }, |
192 selectedSurvey: { | 191 selectedSurvey: { |
193 get() { | 192 get() { |
194 return this.$store.state.bottlenecks.selectedSurvey; | 193 return this.$store.state.bottlenecks.selectedSurvey; |
195 }, | 194 }, |
196 set(survey) { | 195 set(survey) { |
197 this.$store.commit("bottlenecks/setSelectedSurvey", survey); | 196 this.$store.commit("fairwayprofile/additionalSurvey", null); |
197 this.$store.commit("bottlenecks/selectedSurvey", survey); | |
198 } | 198 } |
199 }, | 199 }, |
200 additionalSurvey: { | 200 additionalSurvey: { |
201 get() { | 201 get() { |
202 return this.$store.state.fairwayprofile.additionalSurvey; | 202 return this.$store.state.fairwayprofile.additionalSurvey; |
232 this.$store.dispatch("fairwayprofile/previousCuts"); | 232 this.$store.dispatch("fairwayprofile/previousCuts"); |
233 this.cutLabel = | 233 this.cutLabel = |
234 this.selectedBottleneck + " (" + new Date().toISOString() + ")"; | 234 this.selectedBottleneck + " (" + new Date().toISOString() + ")"; |
235 }, | 235 }, |
236 selectedSurvey(survey) { | 236 selectedSurvey(survey) { |
237 this.$store.commit("fairwayprofile/additionalSurvey", null); | 237 this.loadProfile(survey); |
238 if (survey) { | |
239 this.$store.dispatch("fairwayprofile/loadProfile", survey); | |
240 } | |
241 }, | 238 }, |
242 additionalSurvey(survey) { | 239 additionalSurvey(survey) { |
243 if (survey) this.$store.dispatch("fairwayprofile/loadProfile", survey); | 240 this.loadProfile(survey); |
244 }, | 241 }, |
245 coordinatesSelect(newValue) { | 242 coordinatesSelect(newValue) { |
246 if (newValue) { | 243 if (newValue) { |
247 this.applyCoordinates(newValue); | 244 this.applyCoordinates(newValue); |
248 this.coordinatesSelect = null; | 245 this.coordinatesSelect = null; |
249 } | 246 } |
250 } | 247 } |
251 }, | 248 }, |
252 methods: { | 249 methods: { |
250 loadProfile(survey) { | |
251 if (survey) { | |
252 this.$store.commit("fairwayprofile/profileLoading", true); | |
253 this.$store | |
254 .dispatch("fairwayprofile/loadProfile", survey) | |
255 .finally(() => | |
256 this.$store.commit("fairwayprofile/profileLoading", false) | |
257 ); | |
258 } | |
259 }, | |
253 toggleCutTool() { | 260 toggleCutTool() { |
254 if (this.selectedSurvey) { | 261 if (this.selectedSurvey) { |
255 this.cutTool.setActive(!this.cutTool.getActive()); | 262 this.cutTool.setActive(!this.cutTool.getActive()); |
256 this.lineTool.setActive(false); | 263 this.lineTool.setActive(false); |
257 this.polygonTool.setActive(false); | 264 this.polygonTool.setActive(false); |