Added Automatic HistoryItems to Events,Customers,Vendors

This commit is contained in:
2024-04-08 15:41:28 +02:00
parent 3a0f3f75b4
commit 44a0e10a94
5 changed files with 282 additions and 15 deletions

View File

@@ -11,9 +11,10 @@ const mode = ref(route.params.mode || "show")
const itemInfo = ref({
resources: []
})
const oldItemInfo = ref({})
const resourceToAdd = ref(dataStore.activeProfile.id)
const mapResources = () => {
/*const mapResources = () => {
console.log(itemInfo.value.resources)
itemInfo.value.resources.map(resource => {
console.log(resource)
@@ -22,7 +23,7 @@ const mapResources = () => {
type: resource.type
}
})
}
}*/
const setupPage = () => {
@@ -39,6 +40,7 @@ const setupPage = () => {
})
}
if(route.query.project) itemInfo.value.project = route.query.project
if(itemInfo.value.id) oldItemInfo.value = JSON.parse(JSON.stringify(itemInfo.value))
@@ -65,7 +67,7 @@ setupPage()
Erstellen
</UButton>
<UButton
@click="dataStore.updateItem('events',itemInfo)"
@click="dataStore.updateItem('events',itemInfo,oldItemInfo)"
v-else-if="mode === 'edit' && route.params.id"
>
Speichern
@@ -92,7 +94,11 @@ setupPage()
{{itemInfo}}
</div>
<div v-if="item.label === 'Logbuch'">
<HistoryDisplay
type="event"
v-if="itemInfo"
:element-id="itemInfo.id"
/>
</div>
</UCard>
</template>