flaschengeist-frontend/src/views/FinanzerView.vue

83 lines
3.2 KiB
Vue
Raw Normal View History

2019-12-21 07:20:25 +00:00
<template>
<div>
<TitleBar/>
<v-navigation-drawer mini-variant expand-on-hover app clipped permanent overflow>
<v-list>
<v-list-item class="title" link @click="setActiveUser(activeUser)">
<v-list-item-icon>
<v-icon>home</v-icon>
</v-list-item-icon>
<v-list-item-title>
Gesamtübersicht
</v-list-item-title>
2019-12-21 07:20:25 +00:00
</v-list-item>
</v-list>
<v-divider/>
<v-list>
<v-list-item v-for="user in users" v-bind:key="users.indexOf(user)" :class="user.username === activeUser.username ? 'v-list-item--highlighted' : ''" link @click="setActiveUser(user)">
<v-list-item-title>{{user.lastname}}, {{user.firstname}}</v-list-item-title>
</v-list-item>
</v-list>
<template v-slot:append>
<v-list>
<v-list-item>
<v-list-item-icon><v-icon>search</v-icon></v-list-item-icon>
<v-list-item-title>
<v-autocomplete outlined return-object v-model="user" style="margin-top: 3px"
placeholder="Suche Person" :items="allUsers" item-text="fullName"
prepend-inner-icon="search" full-width/>
</v-list-item-title>
</v-list-item>
<v-list-item>
<v-list-item-icon><v-icon>person_add</v-icon></v-list-item-icon>
<v-list-item-title>
<v-btn text block @click="addUser(user)">Hinzufügen</v-btn>
</v-list-item-title>
</v-list-item>
</v-list>
</template>
</v-navigation-drawer>
<v-content v-if="!activeUser.username">
<Overview/>
</v-content>
<v-content v-else>
<User/>
2019-12-21 07:20:25 +00:00
</v-content>
</div>
</template>
<script>
import TitleBar from "@/components/TitleBar";
import Overview from "../components/finanzer/Overview";
import User from "../components/finanzer/User";
// eslint-disable-next-line no-unused-vars
import { mapGetters } from 'vuex';
import { mapActions } from 'vuex';
2019-12-21 07:20:25 +00:00
export default {
name: "FinanzerView",
components: {User, Overview, TitleBar},
2019-12-21 07:20:25 +00:00
created() {
this.getAllUsers()
this.getUsers()
2019-12-21 07:20:25 +00:00
},
data () {
return {
user: null,
2019-12-21 07:20:25 +00:00
}
},
methods: mapActions({ getAllUsers: 'finanzerUsers/getAllUsers',
setActiveUser: 'finanzerUsers/setActiveUser',
getUsers: 'finanzerUsers/getUsers',
finanzerUsers: 'finanzerUsers/addUser'}),
computed: mapGetters({users: 'finanzerUsers/users',
activeUser: 'finanzerUsers/activeUser',
allUsers: 'finanzerUsers/allUsers'})
2019-12-21 07:20:25 +00:00
}
</script>
<style scoped>
</style>