changes in Cache & Station Editpages, added cacheCollector Store
This commit is contained in:
parent
47aeec7a7c
commit
239dc92b58
@ -64,6 +64,8 @@ module.exports = function (ctx) {
|
||||
'QExpansionItem',
|
||||
'QParallax',
|
||||
'QEditor',
|
||||
'QSelect',
|
||||
'QField',
|
||||
],
|
||||
|
||||
directives: [
|
||||
|
||||
@ -1,18 +1,75 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="q-pa-md">
|
||||
<p class="text-h6">Cache erstellen/bearbeiten</p>
|
||||
<p>Cache Name</p>
|
||||
<p>Cache Beschreibung</p>
|
||||
<p>Cache Punkte</p>
|
||||
<p>Stationen</p>
|
||||
<form>
|
||||
<div class="q-pa-md q-gutter-y-md">
|
||||
<p class="text-h5">Cache erstellen/bearbeiten</p>
|
||||
<q-input class="col" dense stack-label filled v-model="text" label="Name"/>
|
||||
<q-input
|
||||
v-model="description"
|
||||
dense
|
||||
stack-label
|
||||
filled
|
||||
autogrow
|
||||
type="textarea"
|
||||
label="Beschreibung"
|
||||
/>
|
||||
<q-input class="col" dense stack-label filled v-model="text" label="Punktewert"/>
|
||||
<p class="text-h6">Stationen</p>
|
||||
<q-list bordered separator class="rounded-borders" >
|
||||
|
||||
<q-item>
|
||||
<q-item-section avatar>
|
||||
<q-avatar color="primary" text-color="white">
|
||||
1
|
||||
</q-avatar>
|
||||
</q-item-section>
|
||||
|
||||
<q-item-section top>
|
||||
<q-item-label lines="1">
|
||||
<!--<span class="text-weight-medium">[quasarframework/quasar]</span>-->
|
||||
<span class="text-grey-8">Beschreibung:</span>
|
||||
</q-item-label>
|
||||
<q-item-label lines="1" class="q-mt-xs text-body2">
|
||||
<span class="cursor-pointer">Dies ist der Anfang der Beschreibung...</span>
|
||||
</q-item-label>
|
||||
</q-item-section>
|
||||
|
||||
<q-item-section side>
|
||||
<div class="text-grey-8 q-gutter-xs">
|
||||
<q-btn class="" color="" flat dense round icon="delete" />
|
||||
<q-btn class="" color="" flat dense round icon="edit" />
|
||||
</div>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
|
||||
</q-list>
|
||||
<div class="row reverse">
|
||||
<q-btn @click="addStation" unelevated color="primary" label="Station hinzufügen" icon-right="add"/>
|
||||
</div>
|
||||
<div class="row q-mt-xl">
|
||||
<q-btn @click="saveCache" class="full-width" unelevated stack color="positive" label="Cache speichern" icon="save_alt"/>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "Cache"
|
||||
name: "Cache",
|
||||
data() {
|
||||
return {
|
||||
text: ""
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
addStation() {
|
||||
|
||||
},
|
||||
saveCache() {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@ -119,7 +119,9 @@
|
||||
this.$axios.get('http://localhost:8080/api/startCache', { params })
|
||||
.then((response) => {
|
||||
console.log("Angefangen: " + response.data);
|
||||
this.$router.push({ path: `/station/${cacheID}` })
|
||||
let stationID = response.data.aktuelleStation.id;
|
||||
console.log(stationID);
|
||||
this.$router.push({ path: `/station/${stationID}` })
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,33 +1,38 @@
|
||||
<template>
|
||||
<q-page class="q-ma-md">
|
||||
<h4 class="text-h4">Neue Station</h4>
|
||||
<div class="q-ma-md">
|
||||
<p class="text-h5">Neue Station</p>
|
||||
<q-editor
|
||||
:toolbar="[
|
||||
['bold', 'italic', 'strike', 'underline'],
|
||||
['undo', 'redo']
|
||||
]"
|
||||
v-model="description" min-height="10rem" />
|
||||
v-model="station.description" min-height="10rem" />
|
||||
<!--<q-input-->
|
||||
<!--v-model="description"-->
|
||||
<!--filled-->
|
||||
<!--type="textarea"-->
|
||||
<!--/>-->
|
||||
<p class="text-h5 q-mt-md">Location</p>
|
||||
<p class="text-h6 q-mt-md">Location</p>
|
||||
<q-img transition="fade"
|
||||
class="q-mb-md "
|
||||
:ratio="16/9"
|
||||
src="https://www.buga2019.de/we-bilder/3.Gartenausstellung/Gelaendeplan/190320_Gelaendeplan-quadratisch.jpg"
|
||||
></q-img>
|
||||
<div class="row q-col-gutter-md">
|
||||
<q-input class="col" dense stack-label filled v-model="text" label="Längengrad/Breitengrad" />
|
||||
<q-input class="col" dense stack-label filled v-model="latlang" @input="separateLatlang" label="Längengrad/Breitengrad" />
|
||||
<div class="col-shrink">
|
||||
<q-btn unelevated color="primary" class="full-height" icon="my_location"/>
|
||||
</div>
|
||||
</div>
|
||||
<p class="text-h5 q-mt-md">Lösung</p>
|
||||
<q-input class="col" dense stack-label filled v-model="text" label="Lösung" />
|
||||
<q-input class="col q-mt-md" dense stack-label filled v-model="text" label="Code" readonly/>
|
||||
</q-page>
|
||||
<p class="text-h6 q-mt-md">Lösung</p>
|
||||
<q-input class="col" dense stack-label filled v-model="station.solution" label="Lösung" />
|
||||
<q-input class="col q-mt-md" dense stack-label filled v-model="station.code" label="Code" readonly/>
|
||||
<div class="row reverse q-mt-md q-gutter-x-md">
|
||||
<q-btn @click="addStation" unelevated color="primary" label="Speichern" icon-right="add"/>
|
||||
<q-btn @click="dismiss" unelevated color="negative" label="verwerfen" icon-right="delete"/>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@ -37,7 +42,15 @@
|
||||
data() {
|
||||
return {
|
||||
description: "Rätsel, Aufgabe und Informationen zur Station.",
|
||||
text:"v-model !!"
|
||||
text:"v-model !!",
|
||||
latlang: "",
|
||||
station: {
|
||||
description: "description",
|
||||
lattitude: 0.06470,
|
||||
longitude: 0.05551,
|
||||
solution: "solution",
|
||||
code: 357547
|
||||
},
|
||||
}
|
||||
},
|
||||
created: function() {
|
||||
@ -45,11 +58,33 @@
|
||||
beforeMount: function() {
|
||||
},
|
||||
mounted: function() {
|
||||
console.log("'id' from url: "+this.$route.params.id)
|
||||
console.log("'id' from url: "+this.$route.params.id);
|
||||
this.concatLatlang();
|
||||
},
|
||||
computed: {
|
||||
// concatLatlang() {
|
||||
// return this.station.lattitude+", "+this.station.longitude
|
||||
// }
|
||||
},
|
||||
methods: {
|
||||
separateLatlang() {
|
||||
//console.log("separateLatlang()");
|
||||
if (this.latlang.includes(',')) {
|
||||
this.station.lattitude = this.latlang.substr(0, this.latlang.indexOf(',')).trim();
|
||||
this.station.longitude = this.latlang.substr(this.latlang.indexOf(',')+1, this.latlang.length).trim();
|
||||
console.log(this.latlang);
|
||||
console.log(this.station.lattitude + ", " + this.station.longitude);
|
||||
}
|
||||
},
|
||||
concatLatlang() {
|
||||
this.latlang = this.station.lattitude+", "+this.station.longitude;
|
||||
},
|
||||
addStation() {
|
||||
|
||||
},
|
||||
dismiss() {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
4
frontend/src/store/cacheCollector/actions.js
Normal file
4
frontend/src/store/cacheCollector/actions.js
Normal file
@ -0,0 +1,4 @@
|
||||
/*
|
||||
export function someAction (context) {
|
||||
}
|
||||
*/
|
||||
4
frontend/src/store/cacheCollector/getters.js
Normal file
4
frontend/src/store/cacheCollector/getters.js
Normal file
@ -0,0 +1,4 @@
|
||||
/*
|
||||
export function someGetter (state) {
|
||||
}
|
||||
*/
|
||||
12
frontend/src/store/cacheCollector/index.js
Normal file
12
frontend/src/store/cacheCollector/index.js
Normal file
@ -0,0 +1,12 @@
|
||||
import state from './state'
|
||||
import * as getters from './getters'
|
||||
import * as mutations from './mutations'
|
||||
import * as actions from './actions'
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
state,
|
||||
getters,
|
||||
mutations,
|
||||
actions
|
||||
}
|
||||
4
frontend/src/store/cacheCollector/mutations.js
Normal file
4
frontend/src/store/cacheCollector/mutations.js
Normal file
@ -0,0 +1,4 @@
|
||||
/*
|
||||
export function someMutation (state) {
|
||||
}
|
||||
*/
|
||||
3
frontend/src/store/cacheCollector/state.js
Normal file
3
frontend/src/store/cacheCollector/state.js
Normal file
@ -0,0 +1,3 @@
|
||||
export default {
|
||||
//
|
||||
}
|
||||
@ -2,6 +2,7 @@ import Vue from "vue";
|
||||
import Vuex from "vuex";
|
||||
import Axios from "axios";
|
||||
import auth from "./auth"
|
||||
import cacheCollector from "./cacheCollector"
|
||||
|
||||
// import example from './module-example'
|
||||
|
||||
@ -12,24 +13,11 @@ Vue.use(Vuex, Axios);
|
||||
* directly export the Store instantiation
|
||||
*/
|
||||
|
||||
// export default function(/* { ssrContext } */) {
|
||||
// const Store = new Vuex.Store({
|
||||
// modules: {
|
||||
// // example
|
||||
// },
|
||||
//
|
||||
// // enable strict mode (adds overhead!)
|
||||
// // for dev mode only
|
||||
// strict: process.env.DEV
|
||||
// });
|
||||
//
|
||||
// return Store;
|
||||
// }
|
||||
|
||||
export default function (/* { ssrContext } */) {
|
||||
const Store = new Vuex.Store({
|
||||
modules: {
|
||||
auth
|
||||
auth,
|
||||
cacheCollector
|
||||
},
|
||||
|
||||
// enable strict mode (adds overhead!)
|
||||
@ -47,6 +35,10 @@ export default function (/* { ssrContext } */) {
|
||||
module.hot.accept(['./auth'], () => {
|
||||
const auth = require('./auth').default;
|
||||
store.hotUpdate({ modules: { auth: newAuth } })
|
||||
});
|
||||
module.hot.accept(['./cacheCollector'], () => {
|
||||
const cacheCollector = require('./cacheCollector').default;
|
||||
store.hotUpdate({ modules: { cacheCollector: newCacheCollector } })
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user