This commit is contained in:
2024-04-10 10:09:56 +02:00
parent 9fa1059301
commit bf04b9c563
12 changed files with 230 additions and 241 deletions

View File

@@ -13,7 +13,7 @@ const links = [{
shortcuts.value = true shortcuts.value = true
} }
}, { }, {
label: 'Homepage', label: 'Webseite',
icon: 'i-heroicons-book-open', icon: 'i-heroicons-book-open',
to: 'https://fedeo.de', to: 'https://fedeo.de',
target: '_blank' target: '_blank'

View File

@@ -63,11 +63,11 @@ const historyItems = computed(() => {
}) })
const addHistoryItemData = ref({ const addHistoryItemData = ref({
text: "", text: "",
user: ""
}) })
const addHistoryItem = async () => { const addHistoryItem = async () => {
addHistoryItemData.value.user = user.value.id console.log(addHistoryItemData.value)
addHistoryItemData.value.createdBy = dataStore.activeProfile.id
if(type === "customer") { if(type === "customer") {
addHistoryItemData.value.customer = elementId addHistoryItemData.value.customer = elementId
@@ -197,7 +197,7 @@ const renderText = (text) => {
/> />
<div> <div>
<h3 v-if="item.createdBy">{{dataStore.getProfileById(item.createdBy) ? dataStore.getProfileById(item.createdBy).fullName : ""}}</h3> <h3 v-if="item.createdBy">{{dataStore.getProfileById(item.createdBy) ? dataStore.getProfileById(item.createdBy).fullName : ""}}</h3>
<h3 v-else>Spaces Bot</h3> <h3 v-else>FEDEO Bot</h3>
<span v-html="renderText(item.text)"/><br> <span v-html="renderText(item.text)"/><br>
<span class="text-gray-500">{{dayjs(item.created_at).format("DD.MM.YY HH:mm")}}</span> <span class="text-gray-500">{{dayjs(item.created_at).format("DD.MM.YY HH:mm")}}</span>
</div> </div>

View File

@@ -13,33 +13,6 @@ const items = computed(() => [
label: '', label: '',
disabled: true disabled: true
}], [{ }], [{
label: 'Suche',
icon: 'i-heroicons-command-line',
shortcuts: [metaSymbol.value, 'K'],
click: () => {
isDashboardSearchModalOpen.value = true
}
}, {
label: 'Hilfe & Support',
icon: 'i-heroicons-question-mark-circle',
shortcuts: ['?'],
click: () => isHelpSlideoverOpen.value = true
}], [{
label: 'Webseite',
icon: 'i-heroicons-book-open',
to: 'https://fedeo.de',
target: '_blank'
},/* {
label: 'GitHub repository',
icon: 'i-simple-icons-github',
to: 'https://github.com/nuxt/ui-pro',
target: '_blank'
}, {
label: 'Buy Nuxt UI Pro',
icon: 'i-heroicons-credit-card',
to: 'https://ui.nuxt.com/pro/purchase',
target: '_blank'
}*/], [{
label: 'Abmelden', label: 'Abmelden',
icon: 'i-heroicons-arrow-left-on-rectangle', icon: 'i-heroicons-arrow-left-on-rectangle',
click: async () => { click: async () => {

View File

@@ -270,7 +270,7 @@ let links = computed(() => {
defaultOpen: false, defaultOpen: false,
children: [ children: [
{ {
label: "Steuerung", label: "Vorgänge",
to: "/inventory", to: "/inventory",
icon: "i-heroicons-square-3-stack-3d" icon: "i-heroicons-square-3-stack-3d"
}, },
@@ -456,7 +456,16 @@ const footerLinks = [/*{
<UDashboardSearchButton label="Suche..."/> <UDashboardSearchButton label="Suche..."/>
</template> </template>
<UDashboardSidebarLinks :links="links" /> <UDashboardSidebarLinks :links="links" >
</UDashboardSidebarLinks>
<!-- <UAccordion
:items="links"
>
</UAccordion>-->
<div class="flex-1" /> <div class="flex-1" />

View File

@@ -116,7 +116,7 @@ setupPage()
<UTabs <UTabs
v-if="currentItem && mode == 'show'" v-if="currentItem && mode == 'show'"
:items="[{label: 'Informationen'}, /*{label: 'Logbuch'},*/ {label: 'Projekte'},{label: 'Objekte'},{label: 'Verträge'}, {label: 'Ansprechpartner'}]" :items="[{label: 'Informationen'},{label: 'Projekte'},{label: 'Objekte'},{label: 'Verträge'}]"
class="p-5" class="p-5"
> >
<template #item="{item}"> <template #item="{item}">
@@ -223,7 +223,7 @@ setupPage()
<UButton <UButton
@click="router.push(`/contracts/create?customer=${currentItem.id}`)" @click="router.push(`/contracts/create?customer=${currentItem.id}`)"
> >
+ Objekt + Vertrag
</UButton> </UButton>
</Toolbar> </Toolbar>
<UTable <UTable

View File

@@ -134,7 +134,7 @@ function changeFocusToQuantity() {
<USelectMenu <USelectMenu
:options="dataStore.spaces" :options="dataStore.spaces"
searchable searchable
option-attribute="description" option-attribute="spaceNumber"
:color="checkSpaceId(inventoryChangeData.spaceId) ? 'primary' : 'rose'" :color="checkSpaceId(inventoryChangeData.spaceId) ? 'primary' : 'rose'"
v-model="inventoryChangeData.spaceId" v-model="inventoryChangeData.spaceId"
v-on:select="changeFocusToQuantity" v-on:select="changeFocusToQuantity"

View File

@@ -9,6 +9,7 @@ const user = useSupabaseUser()
const router = useRouter() const router = useRouter()
const colorMode = useColorMode() const colorMode = useColorMode()
const dataStore = useDataStore() const dataStore = useDataStore()
const toast = useToast()
const isLight = computed({ const isLight = computed({
get () { get () {
@@ -43,9 +44,12 @@ const onSubmit = async (data) => {
password: data.password password: data.password
}) })
if(error) { if(error) {
console.log(error.toString()) if(error.toString().toLowerCase().includes("invalid")){
toast.add({title:"Zugangsdaten falsch",color:"rose"})
}
} else { } else {
console.log("Login Successful") //console.log("Login Successful")
dataStore.initializeData(user.id) dataStore.initializeData(user.id)
router.push("/") router.push("/")

View File

@@ -13,7 +13,9 @@ let currentItem = ref(null)
//Working //Working
const mode = ref(route.params.mode || "show") const mode = ref(route.params.mode || "show")
const itemInfo = ref({}) const itemInfo = ref({
profile: dataStore.activeProfile.id
})
const oldItemInfo = ref({}) const oldItemInfo = ref({})
const categories = ["Offen", "In Bearbeitung", "Dringed", "Erledigt"] const categories = ["Offen", "In Bearbeitung", "Dringed", "Erledigt"]

View File

@@ -65,7 +65,7 @@ const setupPage = () => {
} }
if(mode.value === "edit") itemInfo.value = currentItem.value if(mode.value === "edit") itemInfo.value = currentItem.value
if(currentItem.value.id) oldItemInfo.value = JSON.parse(JSON.stringify(currentItem.value)) if(currentItem.value) oldItemInfo.value = JSON.parse(JSON.stringify(currentItem.value))
} }
const cancelEditorCreate = () => { const cancelEditorCreate = () => {

View File

@@ -55,6 +55,7 @@ setupPage()
</UButton> </UButton>
<UButton <UButton
v-else-if="mode === 'edit' && !itemInfo.id" v-else-if="mode === 'edit' && !itemInfo.id"
@click="dataStore.createNewItem('workingtimes',itemInfo)"
> >
Erstellen Erstellen
</UButton> </UButton>

View File

@@ -490,6 +490,7 @@ export const useDataStore = defineStore('data', () => {
//console.log(oldData) //console.log(oldData)
//console.log(newData) //console.log(newData)
if(dataTypes[dataType].historyItemHolder){
let itemsToCreate = [] let itemsToCreate = []
const checkPropState = (key,propContent) => { const checkPropState = (key,propContent) => {
@@ -518,7 +519,7 @@ export const useDataStore = defineStore('data', () => {
if(key === "project") { if(key === "project") {
name = "Projekt" name = "Projekt"
oldVal = projects.value.find(i => i.id === prop.data.o).name oldVal = oldVal !== "-" ? projects.value.find(i => i.id === prop.data.o).name : "-"
newVal = projects.value.find(i => i.id === prop.data.n).name newVal = projects.value.find(i => i.id === prop.data.n).name
} else if (key === "title") { } else if (key === "title") {
name = "Titel" name = "Titel"
@@ -700,8 +701,7 @@ export const useDataStore = defineStore('data', () => {
} else { } else {
fetchHistoryItems() fetchHistoryItems()
} }
}
} }