Mercurial > gemma
changeset 3205:bf571429515f
client: fairway availability: moved component's type property to store to manipulate it from outside
author | Markus Kottlaender <markus@intevation.de> |
---|---|
date | Wed, 08 May 2019 17:15:08 +0200 |
parents | 1253fe15e3e3 |
children | dffcf1cc8a8b |
files | client/src/components/Statistics.vue client/src/store/diagram.js |
diffstat | 2 files changed, 12 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/client/src/components/Statistics.vue Wed May 08 17:10:17 2019 +0200 +++ b/client/src/components/Statistics.vue Wed May 08 17:15:08 2019 +0200 @@ -142,7 +142,6 @@ export default { data() { return { - type: this.$options.BOTTLENECKS, loading: false }; }, @@ -225,6 +224,14 @@ this.selectedFairwayAvailabilityFeature == null ); }, + type: { + get() { + return this.$store.state.diagram.type; + }, + set(type) { + this.$store.commit("diagram/type", type); + } + }, los: { get() { return this.LOS;
--- a/client/src/store/diagram.js Wed May 08 17:10:17 2019 +0200 +++ b/client/src/store/diagram.js Wed May 08 17:15:08 2019 +0200 @@ -16,6 +16,7 @@ const init = () => { return { + type: "bottlenecks", selectedFairwayAvailabilityFeature: null, from: null, to: null, @@ -31,6 +32,9 @@ namespaced: true, state: init(), mutations: { + type: (state, type) => { + state.type = type; + }, setLOS: (state, LOS) => { state.LOS = LOS; },