Many Changes
Introduced Plants Some Polishing Some Resources got Query Params Extended GlobalSearch.vue Removed Jobs
This commit is contained in:
50
spaces/pages/plants/index.vue
Normal file
50
spaces/pages/plants/index.vue
Normal file
@@ -0,0 +1,50 @@
|
||||
<template>
|
||||
<div id="main">
|
||||
|
||||
<UButton @click="router.push(`/plants/create/`)">+ Anlage</UButton>
|
||||
|
||||
<UTable
|
||||
:rows="dataStore.plants"
|
||||
:columns="columns"
|
||||
@select="selectItem"
|
||||
:empty-state="{ icon: 'i-heroicons-circle-stack-20-solid', label: 'Noch keine Einträge' }"
|
||||
>
|
||||
<template #customer-data="{row}">
|
||||
{{dataStore.customers.find(customer => customer.id === row.customer) ? dataStore.customers.find(customer => customer.id === row.customer).name : "" }}
|
||||
</template>
|
||||
</UTable>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
|
||||
definePageMeta({
|
||||
middleware: "auth"
|
||||
})
|
||||
|
||||
const dataStore = useDataStore()
|
||||
const router = useRouter()
|
||||
const mode = ref("show")
|
||||
|
||||
const columns = [
|
||||
{
|
||||
key: "name",
|
||||
label: "Name",
|
||||
sortable: true
|
||||
},{
|
||||
key: "customer",
|
||||
label: "Kunde",
|
||||
sortable: true
|
||||
}
|
||||
]
|
||||
|
||||
|
||||
const selectItem = (item) => {
|
||||
router.push(`/plants/show/${item.id} `)
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
Reference in New Issue
Block a user