Mercurial > gemma
comparison client/src/components/Search.vue @ 5132:8d5e3ce27d20
client: Time based search
* Add Time parameter to the search request when Time slider is active
author | Fadi Abbud <fadi.abbud@intevation.de> |
---|---|
date | Fri, 27 Mar 2020 15:30:15 +0100 |
parents | 9f0830a1845d |
children | 19715261750e |
comparison
equal
deleted
inserted
replaced
5130:a6e5bb85f0a7 | 5132:8d5e3ce27d20 |
---|---|
186 }, | 186 }, |
187 computed: { | 187 computed: { |
188 ...mapState("application", [ | 188 ...mapState("application", [ |
189 "showSearchbar", | 189 "showSearchbar", |
190 "showContextBox", | 190 "showContextBox", |
191 "contextBoxContent" | 191 "contextBoxContent", |
192 "showTimeSlider", | |
193 "currentVisibleTime" | |
192 ]), | 194 ]), |
193 ...mapState("imports", ["startDate", "endDate"]), | 195 ...mapState("imports", ["startDate", "endDate"]), |
194 ...mapGetters("imports", ["filters"]), | 196 ...mapGetters("imports", ["filters"]), |
195 ...mapGetters("map", ["openLayersMap"]), | 197 ...mapGetters("map", ["openLayersMap"]), |
196 searchQuery: { | 198 searchQuery: { |
240 }, | 242 }, |
241 watch: { | 243 watch: { |
242 searchQuery: function() { | 244 searchQuery: function() { |
243 this.searchQueryIsDirty = true; | 245 this.searchQueryIsDirty = true; |
244 if (!this.showContextBox) this.triggerSearch(); | 246 if (!this.showContextBox) this.triggerSearch(); |
247 }, | |
248 currentVisibleTime() { | |
249 this.doSearch(); | |
245 } | 250 } |
246 }, | 251 }, |
247 methods: { | 252 methods: { |
248 loadLogs() { | 253 loadLogs() { |
249 this.$store | 254 this.$store |
284 return; | 289 return; |
285 } | 290 } |
286 | 291 |
287 HTTP.post( | 292 HTTP.post( |
288 "/search", | 293 "/search", |
289 { string: this.searchQuery }, | 294 this.showTimeSlider |
295 ? { | |
296 string: this.searchQuery, | |
297 time: this.currentVisibleTime.toISOString() | |
298 } | |
299 : { string: this.searchQuery }, | |
290 { | 300 { |
291 headers: { | 301 headers: { |
292 "X-Gemma-Auth": localStorage.getItem("token"), | 302 "X-Gemma-Auth": localStorage.getItem("token"), |
293 "Content-type": "text/xml; charset=UTF-8" | 303 "Content-type": "text/xml; charset=UTF-8" |
294 } | 304 } |