Create child submodules feature

This commit is contained in:
William Buezas 2024-01-27 12:08:56 -03:00
parent 1f7747343c
commit a01b80703e
7 changed files with 64 additions and 2 deletions

View File

@ -206,6 +206,16 @@ async function togglePinned(item, event) {
<template v-if="$props.source === 'card'">
<template v-for="item in items" :key="item.name">
<LeftMenuItem v-if="!item.children" :item="item" />
<QList v-else>
<QExpansionItem
v-ripple
clickable
:icon="item.icon"
:label="t(item.title)"
>
<LeftMenuItemGroup :item="item" />
</QExpansionItem>
</QList>
</template>
</template>
</QList>

View File

@ -131,6 +131,8 @@ export default {
log: 'Log',
sms: 'Sms',
creditManagement: 'Credit management',
creditContracts: 'Credit contracts',
creditOpinion: 'Credit opinion',
others: 'Others',
},
list: {
@ -886,7 +888,7 @@ export default {
RouteList: 'List',
create: 'Create',
basicData: 'Basic Data',
summary: 'Summary'
summary: 'Summary',
},
cmr: {
list: {

View File

@ -131,6 +131,8 @@ export default {
log: 'Historial',
sms: 'Sms',
creditManagement: 'Gestión de crédito',
creditContracts: 'Contratos de crédito',
creditOpinion: 'Opinión de crédito',
others: 'Otros',
},
list: {

View File

@ -0,0 +1 @@
<template>Customer credit contracts</template>

View File

@ -0,0 +1 @@
<template>Customer credit opinion</template>

View File

@ -352,10 +352,49 @@ export default {
meta: {
title: 'creditManagement',
icon: 'paid',
children: [
{
name: 'CustomerCreditContracts',
title: 'creditContracts',
icon: 'paid',
},
{
name: 'CustomerCreditOpinion',
title: 'creditOpinion',
icon: 'paid',
},
],
},
component: () =>
import('src/pages/Customer/Card/CustomerCreditManagement.vue'),
children: [
{
path: 'credit-contracts',
name: 'CustomerCreditContracts',
meta: {
title: 'creditContracts',
icon: 'paid',
},
component: () =>
import(
'src/pages/Customer/Card/CustomerCreditContracts.vue'
),
},
{
path: 'credit-opinion',
name: 'CustomerCreditOpinion',
meta: {
title: 'creditOpinion',
icon: 'paid',
},
component: () =>
import(
'src/pages/Customer/Card/CustomerCreditOpinion.vue'
),
},
],
},
{
path: 'others',
name: 'CustomerOthers',

View File

@ -52,13 +52,20 @@ export const useNavigationStore = defineStore('navigationStore', () => {
function addMenuItem(module, route, parent) {
const { meta } = route;
let { children = null } = meta;
if (children)
children = children.map(({ name, title, icon }) => ({
name,
icon,
title: `${module}.pageTitles.${title}`,
}));
if (meta && meta.roles && role.hasAny(meta.roles) === false) return;
const item = {
name: route.name,
children: children,
};
if (meta) {
item.title = `${module}.pageTitles.${meta.title}`;
item.icon = meta.icon;