0
0
Fork 0

refs #7355 fix create Rol

This commit is contained in:
Carlos Satorres 2024-07-08 07:32:50 +02:00
parent 2e3970c0cc
commit e1a25e3cf4
1 changed files with 20 additions and 2 deletions

View File

@ -3,6 +3,7 @@ import { useI18n } from 'vue-i18n';
import { useRouter } from 'vue-router';
import { computed, ref } from 'vue';
import VnTable from 'components/VnTable/VnTable.vue';
import { useRoute } from 'vue-router';
import VnPaginate from 'src/components/ui/VnPaginate.vue';
import VnLv from 'src/components/ui/VnLv.vue';
@ -14,12 +15,18 @@ import AccountRolesFilter from './AccountRolesFilter.vue';
import { useStateStore } from 'stores/useStateStore';
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
const route = useRoute();
const stateStore = useStateStore();
const router = useRouter();
const { t } = useI18n();
const { viewSummary } = useSummaryDialog();
const $props = defineProps({
id: {
type: Number,
default: 0,
},
});
const entityId = computed(() => $props.id || route.params.id);
const roleCreateDialogRef = ref(null);
const columns = computed(() => [
@ -37,6 +44,7 @@ const columns = computed(() => [
label: t('name'),
field: 'name',
cardVisible: true,
create: true,
},
{
align: 'left',
@ -44,6 +52,7 @@ const columns = computed(() => [
label: t('description'),
field: 'description',
cardVisible: true,
create: true,
},
]);
const exprBuilder = (param, value) => {
@ -109,10 +118,19 @@ const navigate = (event, id) => {
ref="tableRef"
data-key="Roles"
:url="`VnRoles`"
:create="{
urlCreate: 'VnRoles',
title: t('Create rol'),
onDataSaved: ({ id }) => tableRef.redirect(id),
formInitialData: {
editorFk: entityId,
},
}"
order="id ASC"
:columns="columns"
default-mode="table"
auto-load
redirect="role"
:right-search="false"
:is-editable="true"
/>