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
}
}, {
label: 'Homepage',
label: 'Webseite',
icon: 'i-heroicons-book-open',
to: 'https://fedeo.de',
target: '_blank'

View File

@@ -63,11 +63,11 @@ const historyItems = computed(() => {
})
const addHistoryItemData = ref({
text: "",
user: ""
})
const addHistoryItem = async () => {
addHistoryItemData.value.user = user.value.id
console.log(addHistoryItemData.value)
addHistoryItemData.value.createdBy = dataStore.activeProfile.id
if(type === "customer") {
addHistoryItemData.value.customer = elementId
@@ -197,7 +197,7 @@ const renderText = (text) => {
/>
<div>
<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 class="text-gray-500">{{dayjs(item.created_at).format("DD.MM.YY HH:mm")}}</span>
</div>

View File

@@ -13,33 +13,6 @@ const items = computed(() => [
label: '',
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',
icon: 'i-heroicons-arrow-left-on-rectangle',
click: async () => {

View File

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

View File

@@ -116,7 +116,7 @@ setupPage()
<UTabs
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"
>
<template #item="{item}">
@@ -223,7 +223,7 @@ setupPage()
<UButton
@click="router.push(`/contracts/create?customer=${currentItem.id}`)"
>
+ Objekt
+ Vertrag
</UButton>
</Toolbar>
<UTable

View File

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

View File

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

View File

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

View File

@@ -65,7 +65,7 @@ const setupPage = () => {
}
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 = () => {

View File

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

View File

@@ -490,6 +490,7 @@ export const useDataStore = defineStore('data', () => {
//console.log(oldData)
//console.log(newData)
if(dataTypes[dataType].historyItemHolder){
let itemsToCreate = []
const checkPropState = (key,propContent) => {
@@ -518,7 +519,7 @@ export const useDataStore = defineStore('data', () => {
if(key === "project") {
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
} else if (key === "title") {
name = "Titel"
@@ -700,8 +701,7 @@ export const useDataStore = defineStore('data', () => {
} else {
fetchHistoryItems()
}
}
}