restructure urls again
This commit is contained in:
parent
31c7272893
commit
0f07f8b517
4 changed files with 25 additions and 13 deletions
|
@ -67,7 +67,7 @@ export default {
|
|||
views: [
|
||||
{'title':'items','path':'items'},
|
||||
{'title':'boxes','path':'boxes'},
|
||||
{'title':'mass-edit','path':'/#'},
|
||||
//{'title':'mass-edit','path':'massedit'},
|
||||
],
|
||||
links: [
|
||||
{'title':'howto engel','path':'/howto/'}
|
||||
|
|
|
@ -9,9 +9,10 @@ import Vue from 'vue';
|
|||
Vue.use(VueRouter);
|
||||
|
||||
const routes = [
|
||||
{ path: '/', redirect: '/items/36C3' },
|
||||
{ path: '/boxes/:event', component: Boxes},
|
||||
{ path: '/items/:event', component: Items},
|
||||
{ path: '/', redirect: '/36C3/items' },
|
||||
{ path: '/howto', component: Error},
|
||||
{ path: '/:event/boxes', name: 'boxes', component: Boxes},
|
||||
{ path: '/:event/items', name: 'items', component: Items},
|
||||
{ path: '*', component: Error},
|
||||
];
|
||||
|
||||
|
|
|
@ -14,23 +14,22 @@ const store = new Vuex.Store({
|
|||
events: Array,
|
||||
layout: 'cards',
|
||||
loadedItems: Array,
|
||||
currentview: 'items',
|
||||
loadedBoxes: Array,
|
||||
},
|
||||
getters: {
|
||||
getEventSlug: state => state.route.params.event,
|
||||
getActiveView: state => state.currentview,
|
||||
getActiveView: state => state.route.name,
|
||||
},
|
||||
mutations: {
|
||||
replaceEvents(state, events) {
|
||||
state.events = events;
|
||||
//if (!state.activeEvent || !events.includes(state.activeEvent))
|
||||
// state.activeEvent = _.reverse(events)[0];
|
||||
},
|
||||
changeEvent(state, event) {
|
||||
router.push({path: `/${state.currentview}/${event.slug}`});
|
||||
router.push({path: `/${event.slug}/${state.currentview}`});
|
||||
},
|
||||
changeView(state, link) {
|
||||
router.push({path: `/${link.path}/${state.route.params.event}`});
|
||||
router.push({path: `/${state.route.params.event}/${link.path}`});
|
||||
state.currentview = link.path;
|
||||
},
|
||||
replaceLoadedItems(state, newItems) {
|
||||
state.loadedItems = newItems;
|
||||
|
@ -59,8 +58,6 @@ const store = new Vuex.Store({
|
|||
auth: getAuth(),
|
||||
});
|
||||
|
||||
console.log(resp.data);
|
||||
|
||||
commit('replaceLoadedItems', resp.data);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,10 +1,24 @@
|
|||
<template>
|
||||
<p>boxes</p>
|
||||
<div class="container-fluid px-xl-5 mt-3">
|
||||
<div class="row">
|
||||
<div class="col-xl-8 offset-xl-2">
|
||||
<Table
|
||||
:columns="['iid', 'item_uid', 'bezeichnung', 'container']"
|
||||
:items="[]"
|
||||
:keyName="'item_uid'"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapState } from 'vuex';
|
||||
import Table from '@/components/Table';
|
||||
export default {
|
||||
name: 'Boxes',
|
||||
components: {Table},
|
||||
computed: mapState(['loadedBoxes', 'layout']),
|
||||
};
|
||||
</script>
|
||||
|
||||
|
|
Loading…
Reference in a new issue