Deprecated following as non standardEntity checks, inventoryitems, spaces
This commit is contained in:
45
deprecated/entitys/projects/index.vue
Normal file
45
deprecated/entitys/projects/index.vue
Normal file
@@ -0,0 +1,45 @@
|
||||
<template>
|
||||
<EntityList
|
||||
type="projects"
|
||||
:items="items"
|
||||
></EntityList>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import EntityList from "~/components/EntityList.vue";
|
||||
|
||||
definePageMeta({
|
||||
middleware: "auth"
|
||||
})
|
||||
|
||||
const items = ref([])
|
||||
|
||||
const setupPage = async () => {
|
||||
let profiles = (await useSupabaseSelect("profiles"))
|
||||
items.value = (await useSupabaseSelect("projects","*, customer (name), plant(name), projecttype(name, id)","projectNumber")).map(project => {
|
||||
return {
|
||||
...project,
|
||||
//profiles: project.profiles.map(x => profiles.find(z => z.id === x).fullName).join(", "),
|
||||
phase: getActivePhaseLabel(project)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const getActivePhaseLabel = (item) => {
|
||||
if(item.phases) {
|
||||
if(item.phases.length > 0) {
|
||||
|
||||
let activePhase = item.phases.find(i => i.active)
|
||||
|
||||
if(activePhase) {
|
||||
return activePhase.label
|
||||
} else {
|
||||
return ""
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
setupPage()
|
||||
|
||||
</script>
|
||||
Reference in New Issue
Block a user