Changes
This commit is contained in:
@@ -174,7 +174,7 @@ const renderText = (text) => {
|
||||
+ Eintrag
|
||||
</UButton>
|
||||
</div>
|
||||
<UDivider class="mt-3"/>
|
||||
<UDivider class="my-3"/>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
@@ -52,7 +52,25 @@ setupPage()
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<UDashboardNavbar :title="currentItem ? `Kunde: ${currentItem.name}` : (mode === 'create' ? 'Kunde erstellen' : 'Kunde bearbeiten')">
|
||||
<UDashboardNavbar
|
||||
:title="currentItem ? `Kunde: ${currentItem.name}` : (mode === 'create' ? 'Kunde erstellen' : 'Kunde bearbeiten')"
|
||||
:ui="{center: 'flex items-stretch gap-1.5 min-w-0'}"
|
||||
>
|
||||
<template #left>
|
||||
<UButton
|
||||
icon="i-heroicons-chevron-left"
|
||||
variant="outline"
|
||||
@click="router.push(`/customers`)"
|
||||
>
|
||||
Kunden
|
||||
</UButton>
|
||||
</template>
|
||||
<template #center>
|
||||
<h1
|
||||
v-if="currentItem"
|
||||
:class="['text-xl','font-medium', ... currentItem.active ? ['text-primary'] : ['text-rose-500']]"
|
||||
>{{currentItem ? `Kunde: ${currentItem.name}` : (mode === 'create' ? 'Kunde erstellen' : 'Kunde bearbeiten')}}</h1>
|
||||
</template>
|
||||
<template #right>
|
||||
<UButton
|
||||
v-if="mode === 'edit'"
|
||||
|
||||
@@ -507,8 +507,8 @@ export const useDataStore = defineStore('data', () => {
|
||||
|
||||
const createHistoryItem = (key,prop) => {
|
||||
|
||||
console.log("OLD: " + prop.data.o)
|
||||
console.log("NEW: " + prop.data.n)
|
||||
//console.log("OLD: " + prop.data.o)
|
||||
//console.log("NEW: " + prop.data.n)
|
||||
|
||||
let name = "" || key
|
||||
let oldVal = prop.data.o || "-"
|
||||
@@ -659,11 +659,11 @@ export const useDataStore = defineStore('data', () => {
|
||||
const checkIfNaN = (x) => {
|
||||
return typeof x === "number" && x !== x;
|
||||
}
|
||||
console.log(key)
|
||||
console.log(checkIfNaN(key))
|
||||
//console.log(key)
|
||||
//console.log(checkIfNaN(key))
|
||||
|
||||
if(key !== "fullName" && key !== "phases") {
|
||||
console.log(historyItem)
|
||||
//console.log(historyItem)
|
||||
itemsToCreate.push(historyItem)
|
||||
}
|
||||
|
||||
@@ -672,28 +672,15 @@ export const useDataStore = defineStore('data', () => {
|
||||
if(oldData) {
|
||||
let result = deepDiffMapper.map(oldData,newData)
|
||||
|
||||
console.log(result)
|
||||
//console.log(result)
|
||||
|
||||
for (let prop in result) {
|
||||
//console.log(prop)
|
||||
checkPropState(prop,result[prop])
|
||||
|
||||
|
||||
|
||||
//console.log(prop)
|
||||
//console.log(result[prop])
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
|
||||
|
||||
let historyItem = {
|
||||
text: `${dataTypes[dataType].labelSingle} erstellt`,
|
||||
createdBy: activeProfile.value.id,
|
||||
@@ -702,7 +689,7 @@ export const useDataStore = defineStore('data', () => {
|
||||
|
||||
historyItem[dataTypes[dataType].historyItemHolder] = newData.id
|
||||
|
||||
console.log(historyItem)
|
||||
//console.log(historyItem)
|
||||
itemsToCreate.push(historyItem)
|
||||
}
|
||||
|
||||
@@ -803,7 +790,6 @@ export const useDataStore = defineStore('data', () => {
|
||||
|
||||
const {tenants, ...newData} = data
|
||||
|
||||
console.log(newData)
|
||||
|
||||
await generateHistoryItems(dataType,data,oldData)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user