updated model editors to composable and base template

This commit is contained in:
vabene1111
2024-09-28 13:07:46 +02:00
parent 67fff17f06
commit 143eafa24a
43 changed files with 531 additions and 522 deletions

View File

@@ -0,0 +1,41 @@
<template>
<v-card :loading="loading">
<v-card-title>
{{ modelName }}
<v-btn class="float-right" icon="$close" variant="plain" @click="emit('close')" v-if="dialog"></v-btn>
<v-card-subtitle class="pa-0">{{ objectName }}</v-card-subtitle>
</v-card-title>
<v-divider></v-divider>
<slot name="default">
</slot>
<v-divider></v-divider>
<v-card-actions>
<v-btn color="delete" prepend-icon="$delete" v-if="isUpdate">{{ $t('Delete') }}
<delete-confirm-dialog :object-name="objectName" :model-name="modelName" @delete="emit('delete')"></delete-confirm-dialog>
</v-btn>
<v-btn color="save" prepend-icon="$save" @click="emit('save')">{{ isUpdate ? $t('Save') : $t('Create') }}</v-btn>
</v-card-actions>
</v-card>
</template>
<script setup lang="ts">
import DeleteConfirmDialog from "@/components/dialogs/DeleteConfirmDialog.vue";
const emit = defineEmits(['save', 'delete', 'close'])
const props = defineProps({
loading: {type: Boolean, default: false},
dialog: {type: Boolean, default: false},
objectName: {type: String, default: ''},
modelName: {type: String, default: ''},
isUpdate: {type: Boolean, default: false}
})
</script>
<style scoped>
</style>