fix: refs #6919 roles
gitea/salix-front/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Jorge Penadés 2025-01-08 10:46:21 +01:00
parent d573389871
commit 618d358256
3 changed files with 13 additions and 11 deletions

View File

@ -3,5 +3,10 @@ import VnCardBeta from 'components/common/VnCardBeta.vue';
import RoleDescriptor from './RoleDescriptor.vue'; import RoleDescriptor from './RoleDescriptor.vue';
</script> </script>
<template> <template>
<VnCardBeta data-key="Role" :id-in-where="true" :descriptor="RoleDescriptor" /> <VnCardBeta
url="VnRoles"
data-key="Role"
:id-in-where="true"
:descriptor="RoleDescriptor"
/>
</template> </template>

View File

@ -1,10 +1,9 @@
<script setup> <script setup>
import { ref, computed } from 'vue'; import { computed } from 'vue';
import { useRoute } from 'vue-router'; import { useRoute } from 'vue-router';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import CardSummary from 'components/ui/CardSummary.vue'; import CardSummary from 'components/ui/CardSummary.vue';
import VnLv from 'src/components/ui/VnLv.vue'; import VnLv from 'src/components/ui/VnLv.vue';
import { useArrayData } from 'src/composables/useArrayData';
const route = useRoute(); const route = useRoute();
const { t } = useI18n(); const { t } = useI18n();
@ -16,8 +15,6 @@ const $props = defineProps({
}, },
}); });
const { store } = useArrayData('Role');
const role = ref(store.data);
const entityId = computed(() => $props.id || route.params.id); const entityId = computed(() => $props.id || route.params.id);
</script> </script>
@ -26,11 +23,10 @@ const entityId = computed(() => $props.id || route.params.id);
ref="summary" ref="summary"
url="VnRoles" url="VnRoles"
:filter="{ where: { id: entityId } }" :filter="{ where: { id: entityId } }"
@on-fetch="(data) => (role = data)"
data-key="Role" data-key="Role"
> >
<template #header> {{ role.id }} - {{ role.name }} </template> <template #header="{ entity }"> {{ entity.id }} - {{ entity.name }} </template>
<template #body> <template #body="{ entity }">
<QCard class="vn-one"> <QCard class="vn-one">
<QCardSection class="q-pa-none"> <QCardSection class="q-pa-none">
<a <a
@ -41,9 +37,9 @@ const entityId = computed(() => $props.id || route.params.id);
<QIcon name="open_in_new" /> <QIcon name="open_in_new" />
</a> </a>
</QCardSection> </QCardSection>
<VnLv :label="t('role.id')" :value="role.id" /> <VnLv :label="t('role.id')" :value="entity.id" />
<VnLv :label="t('globals.name')" :value="role.name" /> <VnLv :label="t('globals.name')" :value="entity.name" />
<VnLv :label="t('role.description')" :value="role.description" /> <VnLv :label="t('role.description')" :value="entity.description" />
</QCard> </QCard>
</template> </template>
</CardSummary> </CardSummary>

View File

@ -4,6 +4,7 @@ export default {
component: () => import('src/pages/Account/Role/Card/RoleCard.vue'), component: () => import('src/pages/Account/Role/Card/RoleCard.vue'),
redirect: { name: 'RoleSummary' }, redirect: { name: 'RoleSummary' },
meta: { meta: {
moduleName: 'Role',
menu: ['RoleBasicData', 'SubRoles', 'InheritedRoles', 'RoleLog'], menu: ['RoleBasicData', 'SubRoles', 'InheritedRoles', 'RoleLog'],
}, },
children: [ children: [