Changes
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
<script setup>
|
||||
import {useTempStore} from "~/stores/temp.js";
|
||||
import FloatingActionButton from "~/components/mobile/FloatingActionButton.vue";
|
||||
|
||||
const props = defineProps({
|
||||
type: {
|
||||
@@ -9,6 +10,9 @@ const props = defineProps({
|
||||
items: {
|
||||
required: true,
|
||||
type: Array
|
||||
},
|
||||
platform: {
|
||||
required: true,
|
||||
}
|
||||
})
|
||||
|
||||
@@ -104,6 +108,12 @@ const filteredRows = computed(() => {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<FloatingActionButton
|
||||
:label="`+ ${dataType.labelSingle}`"
|
||||
variant="outline"
|
||||
v-if="platform === 'mobile'"
|
||||
@click="router.push(`/mobile/standardEntity/${type}/create`)"
|
||||
/>
|
||||
<UDashboardNavbar :title="dataType.label" :badge="filteredRows.length">
|
||||
<template #right>
|
||||
<UInput
|
||||
@@ -129,7 +139,7 @@ const filteredRows = computed(() => {
|
||||
/>
|
||||
|
||||
<UButton
|
||||
v-if="useRole().checkRight(`${type}-create`)"
|
||||
v-if="platform !== 'mobile' && useRole().checkRight(`${type}-create`)"
|
||||
@click="router.push(`/standardEntity/${type}/create`)"
|
||||
class="ml-3"
|
||||
>+ {{dataType.labelSingle}}</UButton>
|
||||
|
||||
26
components/displayWelcome.vue
Normal file
26
components/displayWelcome.vue
Normal file
@@ -0,0 +1,26 @@
|
||||
<script setup>
|
||||
|
||||
const supabase = useSupabaseClient()
|
||||
const router = useRouter()
|
||||
const profileStore = useProfileStore()
|
||||
|
||||
const tenant = ref({})
|
||||
|
||||
const setupPage = async () => {
|
||||
tenant.value = (await supabase.from("tenants").select().eq("id",profileStore.currentTenant).single()).data
|
||||
}
|
||||
|
||||
setupPage()
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<h1 class="font-bold text-xl">Willkommen zurück {{profileStore.activeProfile.fullName}}</h1>
|
||||
<span v-if="tenant.id">bei {{tenant.name}}</span>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
41
components/mobile/FloatingActionButton.vue
Normal file
41
components/mobile/FloatingActionButton.vue
Normal file
@@ -0,0 +1,41 @@
|
||||
<script setup>
|
||||
const props = defineProps({
|
||||
label: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
icon: {
|
||||
type: String,
|
||||
},
|
||||
variant: {
|
||||
type: String,
|
||||
default: 'solid'
|
||||
},
|
||||
color: {
|
||||
type: String,
|
||||
default: 'primary'
|
||||
}
|
||||
})
|
||||
|
||||
const emit = defineEmits(['click'])
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<UButton
|
||||
id="fab"
|
||||
:icon="props.icon"
|
||||
:label="props.label"
|
||||
:variant="props.variant"
|
||||
:color="props.color"
|
||||
@click="emit('click')"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
#fab {
|
||||
position: fixed;
|
||||
right: 15px;
|
||||
bottom: 10vh;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user