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