# HG changeset patch # User Thomas Junk # Date 1547568171 -3600 # Node ID b16a6db0008f2aa46e0d9863c78500a31ffba8ef # Parent 77582da3adb081ea7146e27522d3b57f429d0989 feat: define sections and stretches with targetting option diff -r 77582da3adb0 -r b16a6db0008f client/src/components/ImportStretches.vue --- a/client/src/components/ImportStretches.vue Tue Jan 15 16:51:38 2019 +0100 +++ b/client/src/components/ImportStretches.vue Tue Jan 15 17:02:51 2019 +0100 @@ -4,33 +4,58 @@ Define section and stretches -
-
- ID - - - Please enter an id - -
-
-
- Start rhm +
+
+
+ ID + + Please enter an id + + +
+
+ Function + + + + Please enter a function + + +
+
+
+
+ Start rhm +
+ + + + +
+ Please enter a start point @@ -38,23 +63,32 @@
End rhm - +
+ + + + +
- + Please enter an end point
-
+
Object name - + Please enter an objectname
-
+
National Object name @@ -83,42 +117,55 @@ v-model="nobjbn" /> - + Please enter an objectname
-
- Date info - - - Please enter a date - +
+
+ Date info + + + + Please enter a date + + +
+
+ Source + + + + Please enter a source + + +
-
- Source - - - - Please enter a source - - -
+
+
+
@@ -137,22 +184,51 @@ * Author(s): * Thomas Junk */ +import { mapState } from "vuex"; +import { displayInfo } from "@/lib/errors.js"; export default { name: "importstretches", data() { return { id: "", - function: "", - startrhm: 0, - endrhm: 0, + funktion: "", + startrhm: "", + endrhm: "", objbn: "", nobjbn: "", - date_info: null, - source: "" + date_info: new Date().toISOString().split("T")[0], + source: "", + pipetteStart: false, + pipetteEnd: false }; }, - methods: {} + methods: { + submit() { + displayInfo({ + title: this.$gettext("Sections"), + message: this.$gettext("Not implemented!") + }); + } + }, + watch: { + identifiedFeatures() { + const filterDistanceMarks = x => { + return /^distance_marks/.test(x["id_"]); + }; + const distanceMark = this.identifiedFeatures.filter(filterDistanceMarks); + if (distanceMark.length > 0) { + const value = distanceMark[0]["id_"] + .split(".")[1] + .replace(/,|\(|\)/g, ""); + this.startrhm = this.pipetteStart ? value : this.startrhm; + this.endrhm = this.pipetteEnd ? value : this.endrhm; + } + } + }, + computed: { + ...mapState("map", ["identifiedFeatures", "currentMeasurement"]) + } };