changeset 3577:959312a236a0

sr-import: sent 'beam-type' along
author Thomas Junk <thomas.junk@intevation.de>
date Mon, 03 Jun 2019 17:06:41 +0200
parents 1109a38f7ff1
children 5fb86c262756
files client/src/components/importconfiguration/types/Soundingresults.vue
diffstat 1 files changed, 31 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/client/src/components/importconfiguration/types/Soundingresults.vue	Mon Jun 03 16:58:02 2019 +0200
+++ b/client/src/components/importconfiguration/types/Soundingresults.vue	Mon Jun 03 17:06:41 2019 +0200
@@ -8,8 +8,8 @@
       >
         {{ message }}
       </div>
-      <div class="d-flex w-100">
-        <div class="w-50 mr-2 text-left">
+      <div class="d-flex">
+        <div class="text-left mr-3">
           <small class="text-muted">
             <translate>Bottleneck</translate>
           </small>
@@ -28,7 +28,7 @@
             </small>
           </span>
         </div>
-        <div class="w-50 ml-3 text-left">
+        <div class="text-left ml-2 mr-1">
           <small class="text-muted">
             <translate>Projection</translate>&nbsp;(EPSG)
           </small>
@@ -45,9 +45,25 @@
             </small>
           </span>
         </div>
+        <div class="text-left ml-1">
+          <small class="text-muted">
+            <translate>BeamType</translate>
+          </small>
+          <select
+            v-model="beamType"
+            class="custom-select custom-select-sm"
+            id="beamtype"
+          >
+            <option
+              v-for="option in Object.keys($options.BEAMTYPES)"
+              :key="option"
+              >{{ $options.BEAMTYPES[option] }}</option
+            >
+          </select>
+        </div>
       </div>
       <div class="d-flex flex-row w-100 mt-3">
-        <div class="w-50 mr-2 text-left">
+        <div class="mr-2 text-left">
           <small class="text-muted">
             <translate>Depthreference</translate>
           </small>
@@ -68,7 +84,7 @@
             </small>
           </span>
         </div>
-        <div class="w-50 ml-3 text-left">
+        <div class="ml-3 text-left">
           <small class="text-muted"> <translate>Date</translate> </small>
           <input
             id="importdate"
@@ -185,10 +201,11 @@
 export default {
   data() {
     return {
+      beamType: this.$options.BEAMTYPES.MULTIBEAM,
       importState: IMPORTSTATE.UPLOAD,
       depthReference: "",
       bottleneck: "",
-      projection: "",
+      projection: "4326",
       importDate: "",
       uploadLabel: this.$gettext(this.$options.UPLOADLABEL),
       uploadFile: null,
@@ -206,7 +223,7 @@
       this.importState = IMPORTSTATE.UPLOAD;
       this.depthReference = "";
       this.bottleneck = null;
-      this.projection = "";
+      this.projection = "4326";
       this.importDate = "";
       this.uploadLabel = this.$gettext(this.$options.UPLOADLABEL);
       this.uploadFile = null;
@@ -285,6 +302,7 @@
       if (this.depthReference)
         formData.append("depth-reference", this.depthReference);
       if (this.projection) formData.append("epsg", this.projection);
+      if (this.beamType) formData.append("beam-type", this.beamType);
 
       HTTP.post("/imports/sr", formData, {
         headers: {
@@ -358,7 +376,8 @@
             JSON.stringify({
               depthReference: this.depthReference,
               bottleneck: this.bottleneck.properties.objnam,
-              date: this.importDate
+              date: this.importDate,
+              beamType: this.beamType
             })
           )
         );
@@ -376,6 +395,10 @@
       return [];
     }
   },
+  BEAMTYPES: {
+    MULTIBEAM: "multibeam",
+    SINGLEBEAM: "singlebeam"
+  },
   UPLOADLABEL: "choose a .zip or .txt file",
   on: "on",
   off: "off"