Mercurial > gemma
comparison client/src/components/fairway/Profiles.vue @ 2541:468c8dc796cf
client: convert lib helper functions to Vue filters
author | Markus Kottlaender <markus@intevation.de> |
---|---|
date | Thu, 07 Mar 2019 15:53:12 +0100 |
parents | 3c17d401fbd4 |
children | dc42faf90e1d |
comparison
equal
deleted
inserted
replaced
2540:3c17d401fbd4 | 2541:468c8dc796cf |
---|---|
45 <option | 45 <option |
46 v-for="wl in Object.keys(waterLevels)" | 46 v-for="wl in Object.keys(waterLevels)" |
47 :key="wl" | 47 :key="wl" |
48 :value="wl" | 48 :value="wl" |
49 > | 49 > |
50 {{ formatSurveyDate(wl) }} | 50 {{ wl | surveyDate }} |
51 </option> | 51 </option> |
52 </select> | 52 </select> |
53 </div> | 53 </div> |
54 <div class="flex-fill ml-2"> | 54 <div class="flex-fill ml-2"> |
55 <small class="text-muted"> <translate>Survey</translate>: </small> | 55 <small class="text-muted"> <translate>Survey</translate>: </small> |
59 > | 59 > |
60 <option | 60 <option |
61 v-for="survey in surveys" | 61 v-for="survey in surveys" |
62 :key="survey.date_info" | 62 :key="survey.date_info" |
63 :value="survey" | 63 :value="survey" |
64 >{{ formatSurveyDate(survey.date_info) }}</option | 64 >{{ survey.date_info | surveyDate }}</option |
65 > | 65 > |
66 </select> | 66 </select> |
67 </div> | 67 </div> |
68 <div | 68 <div |
69 class="flex-fill ml-2" | 69 class="flex-fill ml-2" |
79 <option :value="null">None</option> | 79 <option :value="null">None</option> |
80 <option | 80 <option |
81 v-for="survey in additionalSurveys" | 81 v-for="survey in additionalSurveys" |
82 :key="survey.date_info" | 82 :key="survey.date_info" |
83 :value="survey" | 83 :value="survey" |
84 >{{ formatSurveyDate(survey.date_info) }}</option | 84 >{{ survey.date_info | surveyDate }}</option |
85 > | 85 > |
86 </select> | 86 </select> |
87 </div> | 87 </div> |
88 </div> | 88 </div> |
89 <hr class="w-100 mb-0" /> | 89 <hr class="w-100 mb-0" /> |
242 */ | 242 */ |
243 import { mapState, mapGetters } from "vuex"; | 243 import { mapState, mapGetters } from "vuex"; |
244 import Feature from "ol/Feature"; | 244 import Feature from "ol/Feature"; |
245 import LineString from "ol/geom/LineString"; | 245 import LineString from "ol/geom/LineString"; |
246 import { displayError, displayInfo } from "@/lib/errors.js"; | 246 import { displayError, displayInfo } from "@/lib/errors.js"; |
247 import { formatSurveyDate } from "@/lib/date.js"; | |
248 import { LAYERS } from "@/store/map.js"; | 247 import { LAYERS } from "@/store/map.js"; |
249 | 248 |
250 export default { | 249 export default { |
251 name: "profiles", | 250 name: "profiles", |
252 data() { | 251 data() { |
364 }, | 363 }, |
365 methods: { | 364 methods: { |
366 close() { | 365 close() { |
367 this.$store.commit("application/showProfiles", false); | 366 this.$store.commit("application/showProfiles", false); |
368 }, | 367 }, |
369 formatSurveyDate(date) { | |
370 return formatSurveyDate(date); | |
371 }, | |
372 loadProfile(survey) { | 368 loadProfile(survey) { |
373 if (survey) { | 369 if (survey) { |
374 this.$store.commit("fairwayprofile/profileLoading", true); | 370 this.$store.commit("fairwayprofile/profileLoading", true); |
375 this.$store | 371 this.$store |
376 .dispatch("fairwayprofile/loadProfile", survey) | 372 .dispatch("fairwayprofile/loadProfile", survey) |