Mercurial > gemma
comparison client/src/components/importconfiguration/types/Soundingresults.vue @ 3695:5754793ff9b0
import_configuration: adapt backend notation 'single-beam'
author | Thomas Junk <thomas.junk@intevation.de> |
---|---|
date | Wed, 19 Jun 2019 08:53:48 +0200 |
parents | 3138836bf840 |
children | 2d77a7447d09 |
comparison
equal
deleted
inserted
replaced
3694:6f5297dc6039 | 3695:5754793ff9b0 |
---|---|
277 }) | 277 }) |
278 .then(response => { | 278 .then(response => { |
279 if (response.data.meta) { | 279 if (response.data.meta) { |
280 const { bottleneck, date, epsg } = response.data.meta; | 280 const { bottleneck, date, epsg } = response.data.meta; |
281 const depthReference = response.data.meta["depth-reference"]; | 281 const depthReference = response.data.meta["depth-reference"]; |
282 const singlebeam = response.data.meta["single-beam"]; | |
282 this.bottleneck = this.bottlenecks.find( | 283 this.bottleneck = this.bottlenecks.find( |
283 bn => bn.properties.objnam === bottleneck | 284 bn => bn.properties.objnam === bottleneck |
284 ); | 285 ); |
285 this.depthReference = depthReference; | 286 this.depthReference = depthReference; |
286 this.importDate = new Date(date).toISOString().split("T")[0]; | 287 this.importDate = new Date(date).toISOString().split("T")[0]; |
287 this.projection = epsg; | 288 this.projection = epsg; |
289 this.beamType = singlebeam | |
290 ? this.$options.BEAMTYPES.SINGLEBEAM | |
291 : this.$options.BEAMTYPES.MULTIBEAM; | |
288 } | 292 } |
289 this.importState = IMPORTSTATE.EDIT; | 293 this.importState = IMPORTSTATE.EDIT; |
290 this.token = response.data.token; | 294 this.token = response.data.token; |
291 this.messages = response.data.messages; | 295 this.messages = response.data.messages; |
292 }) | 296 }) |
307 if (this.importDate) | 311 if (this.importDate) |
308 formData.append("date", this.importDate.split("T")[0]); | 312 formData.append("date", this.importDate.split("T")[0]); |
309 if (this.depthReference) | 313 if (this.depthReference) |
310 formData.append("depth-reference", this.depthReference); | 314 formData.append("depth-reference", this.depthReference); |
311 if (this.projection) formData.append("epsg", this.projection); | 315 if (this.projection) formData.append("epsg", this.projection); |
312 if (this.beamType) formData.append("beam-type", this.beamType); | 316 if (this.beamType) |
317 formData.append("single-beam", this.$options.BEAMTYPES.SINGLEBEAM); | |
313 | 318 |
314 HTTP.post("/imports/sr", formData, { | 319 HTTP.post("/imports/sr", formData, { |
315 headers: { | 320 headers: { |
316 "X-Gemma-Auth": localStorage.getItem("token"), | 321 "X-Gemma-Auth": localStorage.getItem("token"), |
317 "Content-Type": "multipart/form-data" | 322 "Content-Type": "multipart/form-data" |
412 encodeURIComponent( | 417 encodeURIComponent( |
413 JSON.stringify({ | 418 JSON.stringify({ |
414 "depth-reference": this.depthReference, | 419 "depth-reference": this.depthReference, |
415 bottleneck: this.bottleneck.properties.objnam, | 420 bottleneck: this.bottleneck.properties.objnam, |
416 date: this.importDate, | 421 date: this.importDate, |
417 beamType: this.beamType, | 422 "single-beam": |
423 this.beamType === this.$options.BEAMTYPES.SINGLEBEAM, | |
418 projection: this.projection | 424 projection: this.projection |
419 }) | 425 }) |
420 ) | 426 ) |
421 ); | 427 ); |
422 } | 428 } |