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-if="$props.source === 'card'">
<template v-for="item in items" :key="item.name"> <template v-for="item in items" :key="item.name">
<LeftMenuItem v-if="!item.children" :item="item" /> <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>
</template> </template>
</QList> </QList>

View File

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

View File

@ -131,6 +131,8 @@ export default {
log: 'Historial', log: 'Historial',
sms: 'Sms', sms: 'Sms',
creditManagement: 'Gestión de crédito', creditManagement: 'Gestión de crédito',
creditContracts: 'Contratos de crédito',
creditOpinion: 'Opinión de crédito',
others: 'Otros', others: 'Otros',
}, },
list: { 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: { meta: {
title: 'creditManagement', title: 'creditManagement',
icon: 'paid', icon: 'paid',
children: [
{
name: 'CustomerCreditContracts',
title: 'creditContracts',
icon: 'paid',
},
{
name: 'CustomerCreditOpinion',
title: 'creditOpinion',
icon: 'paid',
},
],
}, },
component: () => component: () =>
import('src/pages/Customer/Card/CustomerCreditManagement.vue'), 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', path: 'others',
name: 'CustomerOthers', name: 'CustomerOthers',

View File

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