62 lines
1.5 KiB
Vue
62 lines
1.5 KiB
Vue
<script setup>
|
|
import { computed } from 'vue';
|
|
import { useRoute } from 'vue-router';
|
|
import { useI18n } from 'vue-i18n';
|
|
import CardDescriptor from 'components/ui/CardDescriptor.vue';
|
|
import VnLv from 'src/components/ui/VnLv.vue';
|
|
import axios from 'axios';
|
|
import useNotify from 'src/composables/useNotify.js';
|
|
const $props = defineProps({
|
|
id: {
|
|
type: Number,
|
|
required: false,
|
|
default: null,
|
|
},
|
|
summary: {
|
|
type: Object,
|
|
default: null,
|
|
},
|
|
});
|
|
|
|
const route = useRoute();
|
|
|
|
const { notify } = useNotify();
|
|
const { t } = useI18n();
|
|
const entityId = computed(() => {
|
|
return $props.id || route.params.id;
|
|
});
|
|
const removeRole = async () => {
|
|
await axios.delete(`VnRoles/${entityId.value}`);
|
|
notify(t('Role removed'), 'positive');
|
|
};
|
|
</script>
|
|
|
|
<template>
|
|
<CardDescriptor
|
|
url="VnRoles"
|
|
:filter="{ where: { id: entityId } }"
|
|
data-key="Role"
|
|
:summary="$props.summary"
|
|
>
|
|
<template #menu>
|
|
<QItem v-ripple clickable @click="removeRole()">
|
|
<QItemSection>{{ t('globals.delete') }}</QItemSection>
|
|
</QItem>
|
|
</template>
|
|
<template #body="{ entity }">
|
|
<VnLv :label="t('role.description')" :value="entity.description" />
|
|
</template>
|
|
</CardDescriptor>
|
|
</template>
|
|
<style scoped>
|
|
.q-item__label {
|
|
margin-top: 0;
|
|
}
|
|
</style>
|
|
<i18n>
|
|
en:
|
|
accountRate: Claming rate
|
|
es:
|
|
accountRate: Ratio de reclamación
|
|
</i18n>
|