0
0
Fork 0

fix: accountList create

This commit is contained in:
Carlos Satorres 2024-12-04 13:58:59 +01:00
parent a6a21f3925
commit f5c6810d9e
1 changed files with 54 additions and 7 deletions

View File

@ -22,10 +22,27 @@ const columns = computed(() => [
field: 'id',
cardVisible: true,
},
{
align: 'left',
name: 'name',
label: t('Name'),
component: 'input',
columnField: {
component: null,
},
cardVisible: true,
create: true,
},
{
align: 'left',
name: 'roleFk',
label: t('role'),
component: 'select',
attrs: {
url: 'VnRoles',
optionValue: 'id',
optionLabel: 'name',
},
columnFilter: {
component: 'select',
name: 'roleFk',
@ -35,7 +52,11 @@ const columns = computed(() => [
optionLabel: 'name',
},
},
columnField: {
component: null,
},
format: ({ role }, dashIfEmpty) => dashIfEmpty(role?.name),
create: true,
},
{
align: 'left',
@ -51,20 +72,36 @@ const columns = computed(() => [
},
{
align: 'left',
name: 'name',
label: t('Name'),
name: 'email',
label: t('email'),
component: 'input',
columnField: {
component: null,
},
cardVisible: true,
create: true,
visible: false,
},
{
align: 'left',
name: 'email',
label: t('email'),
component: 'input',
name: 'password',
label: t('password'),
columnField: {
component: null,
},
columnCreate: {
component: 'input',
type: 'password',
},
attrs: {},
create: true,
visible: false,
},
{
align: 'left',
name: 'active',
label: t('active'),
component: 'checkbox',
create: true,
visible: false,
},
@ -101,7 +138,6 @@ const exprBuilder = (param, value) => {
}
};
</script>
<template>
<VnSearchbar
data-key="AccountList"
@ -119,6 +155,14 @@ const exprBuilder = (param, value) => {
ref="tableRef"
data-key="AccountList"
url="VnUsers/preview"
:create="{
urlCreate: 'VnUsers',
title: t('Create user'),
onDataSaved: ({ id }) => tableRef.redirect(id),
formInitialData: {
password: null,
},
}"
:filter="filter"
order="id DESC"
:columns="columns"
@ -135,4 +179,7 @@ const exprBuilder = (param, value) => {
Id: Id
Nickname: Nickname
Name: Nombre
password: Contraseña
active: Activo
role: Rol
</i18n>