comparison client/src/components/map/contextbox/ImportSoundingresults.vue @ 1302:3c10c868cba7

import sounding results: display messages as text
author Thomas Junk <thomas.junk@intevation.de>
date Fri, 23 Nov 2018 11:05:29 +0100
parents 2738a6ae9ad8
children 0e9dd3cd7b53
comparison
equal deleted inserted replaced
1301:2304778c4432 1302:3c10c868cba7
42 <option 42 <option
43 v-for="option in this.$options.depthReferenceOptions" 43 v-for="option in this.$options.depthReferenceOptions"
44 :key="option" 44 :key="option"
45 >{{option}}</option> 45 >{{option}}</option>
46 </select> 46 </select>
47 </div>
48 <div class="text-left">
49 <small v-for="(message, index) in messages" :key="index">{{message}}</small>
47 </div> 50 </div>
48 </div> 51 </div>
49 <div class="w-95 ml-auto mr-auto mt-4 mb-4"> 52 <div class="w-95 ml-auto mr-auto mt-4 mb-4">
50 <div v-if="uploadState" class="d-flex flex-row input-group mb-4"> 53 <div v-if="uploadState" class="d-flex flex-row input-group mb-4">
51 <div class="custom-file"> 54 <div class="custom-file">
112 bottleneck: "", 115 bottleneck: "",
113 importDate: "", 116 importDate: "",
114 uploadLabel: defaultLabel, 117 uploadLabel: defaultLabel,
115 uploadFile: null, 118 uploadFile: null,
116 disableUpload: false, 119 disableUpload: false,
117 token: null 120 token: null,
121 messages: []
118 }; 122 };
119 }, 123 },
120 methods: { 124 methods: {
121 initialState() { 125 initialState() {
122 this.importState = IMPORTSTATE.UPLOAD; 126 this.importState = IMPORTSTATE.UPLOAD;
125 this.importDate = ""; 129 this.importDate = "";
126 this.uploadLabel = defaultLabel; 130 this.uploadLabel = defaultLabel;
127 this.uploadFile = null; 131 this.uploadFile = null;
128 this.disableUpload = false; 132 this.disableUpload = false;
129 this.token = null; 133 this.token = null;
134 this.messages = [];
130 }, 135 },
131 fileSelected(e) { 136 fileSelected(e) {
132 const files = e.target.files || e.dataTransfer.files; 137 const files = e.target.files || e.dataTransfer.files;
133 if (!files) return; 138 if (!files) return;
134 this.uploadLabel = files[0].name; 139 this.uploadLabel = files[0].name;
174 this.importState = IMPORTSTATE.EDIT; 179 this.importState = IMPORTSTATE.EDIT;
175 this.bottleneck = bottleneck; 180 this.bottleneck = bottleneck;
176 this.depthReference = depthReference; 181 this.depthReference = depthReference;
177 this.importDate = new Date(date).toISOString().split("T")[0]; 182 this.importDate = new Date(date).toISOString().split("T")[0];
178 this.token = response.data.token; 183 this.token = response.data.token;
184 this.messages = response.data.messages;
179 }) 185 })
180 .catch(error => { 186 .catch(error => {
181 const { status, data } = error.response; 187 const { status, data } = error.response;
182 const messages = data.messages ? data.messages.join(", ") : ""; 188 const messages = data.messages ? data.messages.join(", ") : "";
183 displayError({ 189 displayError({