Deprecated following as non standardEntity tasks, products, productcategories, services, servicecategories

This commit is contained in:
2024-12-22 22:13:34 +01:00
parent 61110da453
commit 1ba3d9c3e9
20 changed files with 287 additions and 63 deletions

View File

@@ -79,6 +79,8 @@ const loadOptions = async () => {
for await(const option of optionsToLoad) {
if(option.option === "countrys") {
loadedOptions.value[option.option] = (await supabase.from("countrys").select()).data
} else if(option.option === "units") {
loadedOptions.value[option.option] = (await supabase.from("units").select()).data
} else {
loadedOptions.value[option.option] = (await useSupabaseSelect(option.option))
@@ -87,6 +89,8 @@ const loadOptions = async () => {
}
}
}
console.log(loadedOptions.value)
}
loadOptions()
@@ -174,7 +178,11 @@ const contentChanged = (content, datapoint) => {
:searchable="datapoint.selectSearchAttributes"
:search-attributes="datapoint.selectSearchAttributes"
:multiple="datapoint.selectMultiple"
/>
>
<template #empty>
Keine Optionen verfügbar
</template>
</USelectMenu>
<UTextarea
v-else-if="datapoint.inputType === 'textarea'"
v-model="props.item[datapoint.key.split('.')[0]][datapoint.key.split('.')[1]]"
@@ -218,7 +226,11 @@ const contentChanged = (content, datapoint) => {
:search-attributes="datapoint.selectSearchAttributes"
:multiple="datapoint.selectMultiple"
searchable-placeholder="Suche..."
/>
>
<template #empty>
Keine Optionen verfügbar
</template>
</USelectMenu>
<UTextarea
v-else-if="datapoint.inputType === 'textarea'"
v-model="props.item[datapoint.key]"

View File

@@ -62,8 +62,6 @@ const searchString = ref('')
const selectableFilters = ref(dataType.filters.map(i => i.name))
const selectedFilters = ref(dataType.filters.filter(i => i.default).map(i => i.name) || [])
console.log(selectableFilters)
console.log(selectedFilters)
const filteredRows = computed(() => {
@@ -132,6 +130,7 @@ const filteredRows = computed(() => {
class="hidden lg:block"
by="key"
:color="selectedColumns.length !== dataType.templateColumns.filter(i => !i.disabledInTable).length ? 'primary' : 'white'"
:ui-menu="{ width: 'min-w-max' }"
>
<template #label>
Spalten
@@ -144,6 +143,7 @@ const filteredRows = computed(() => {
v-model="selectedFilters"
:options="selectableFilters"
:color="selectedFilters.length > 0 ? 'primary' : 'white'"
:ui-menu="{ width: 'min-w-max' }"
>
<template #label>
Filter
@@ -159,6 +159,11 @@ const filteredRows = computed(() => {
@select="(i) => router.push(`/standardEntity/${type}/show/${i.id}`) "
:empty-state="{ icon: 'i-heroicons-circle-stack-20-solid', label: `Keine ${dataType.label} anzuzeigen` }"
>
<template
v-for="column in dataType.templateColumns.filter(i => !i.disabledInTable)"
v-slot:[`${column.key}-header`]="{row}">
<span class="text-nowrap">{{column.label}}</span>
</template>
<template #name-data="{row}">
<span
v-if="row.id === filteredRows[selectedItem].id"

View File

@@ -18,11 +18,11 @@ const links = computed(() => {
icon: "i-heroicons-rectangle-stack",
defaultOpen: false,
children: [
{
... role.checkRight("tasks") ? [{
label: "Aufgaben",
to: "/tasks",
to: "/standardEntity/tasks",
icon: "i-heroicons-rectangle-stack"
},
}] : [],
... profileStore.ownTenant.features.planningBoard ? [{
label: "Plantafel",
to: "/calendar/timeline",
@@ -183,22 +183,22 @@ const links = computed(() => {
children: [
... role.checkRight("products") ? [{
label: "Artikel",
to: "/products",
to: "/standardEntity/products",
icon: "i-heroicons-puzzle-piece"
}] : [],
... role.checkRight("productcategories") ? [{
label: "Artikelkategorien",
to: "/productcategories",
to: "/standardEntity/productcategories",
icon: "i-heroicons-puzzle-piece"
}] : [],
... role.checkRight("services") ? [{
label: "Leistungen",
to: "/services",
to: "/standardEntity/services",
icon: "i-heroicons-puzzle-piece"
}] : [],
... role.checkRight("servicecategories") ? [{
label: "Leistungskategorien",
to: "/servicecategories",
to: "/standardEntity/servicecategories",
icon: "i-heroicons-puzzle-piece"
}] : [],
]

View File

@@ -0,0 +1,15 @@
<script setup>
import dayjs from "dayjs";
const props = defineProps({
row: {
type: Object,
required: true,
default: {}
}
})
</script>
<template>
<span v-if="props.row.created_at">{{dayjs(props.row.created_at).format("DD.MM.YYYY HH:mm")}}</span>
</template>

View File

@@ -0,0 +1,15 @@
<script setup>
const props = defineProps({
row: {
type: Object,
required: true,
default: {}
}
})
const profileStore = useProfileStore()
</script>
<template>
<span>{{props.row.profile ? profileStore.getProfileById(props.row.profile).fullName : ''}}</span>
</template>

View File

@@ -0,0 +1,18 @@
<script setup>
const props = defineProps({
row: {
type: Object,
required: true,
default: {}
}
})
const profileStore = useProfileStore()
const profiles = computed(() => props.row.profiles.map(id => profileStore.getProfileById(id).fullName).join(', '))
</script>
<template>
<span>{{props.row.profiles ? profiles : ''}}</span>
</template>

View File

@@ -0,0 +1,13 @@
<script setup>
const props = defineProps({
row: {
type: Object,
required: true,
default: {}
}
})
</script>
<template>
<span>{{props.row.project ? props.row.project.name : ''}}</span>
</template>

View File

@@ -0,0 +1,13 @@
<script setup>
const props = defineProps({
row: {
type: Object,
required: true,
default: {}
}
})
</script>
<template>
<span>{{props.row.purchasePrice ? useCurrency(props.row.purchasePrice) : ''}}</span>
</template>