diff --git a/quasar.config.js b/quasar.config.js
index 83265295f..9aefa9fda 100644
--- a/quasar.config.js
+++ b/quasar.config.js
@@ -23,7 +23,7 @@ module.exports = configure(function (ctx) {
// app boot file (/src/boot)
// --> boot files are part of "main.js"
// https://v2.quasar.dev/quasar-cli-webpack/boot-files
- boot: ['i18n', 'axios'],
+ boot: ['i18n', 'axios', 'pinia'],
// https://v2.quasar.dev/quasar-cli-webpack/quasar-config-js#Property%3A-css
css: ['app.scss'],
diff --git a/src/boot/pinia.js b/src/boot/pinia.js
new file mode 100644
index 000000000..5c6c0da28
--- /dev/null
+++ b/src/boot/pinia.js
@@ -0,0 +1,8 @@
+import { boot } from 'quasar/wrappers';
+import { createPinia } from 'pinia';
+
+export default boot(({ app }) => {
+ const pinia = createPinia();
+
+ app.use(pinia);
+});
diff --git a/src/components/FavoriteModules.vue b/src/components/FavoriteModules.vue
index 65d070d95..26e39025c 100644
--- a/src/components/FavoriteModules.vue
+++ b/src/components/FavoriteModules.vue
@@ -1,43 +1,44 @@
-
-
-
-
+-->
+onMounted(() => {
+ navigation.fetchPinned();
+});
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+ {{ navigation.pinned }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/components/LeftMenu.vue b/src/components/LeftMenu.vue
index 38563df39..8578df9d9 100644
--- a/src/components/LeftMenu.vue
+++ b/src/components/LeftMenu.vue
@@ -1,53 +1,95 @@
- {{ t('globals.favoriteModules') }}
+
+ {{ t('globals.favoriteModules') }}
+
-
-
-
-
-
- {{ t(`${item.module}.pageTitles.${item.title}`) }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
- {{ t(`${item.module}.pageTitles.${section.title}`) }}
-
-
-
+ {{ t(item.title) }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ t(section.title) }}
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ t(item.title) }}
+
+
@@ -157,8 +224,6 @@ for (const module of navigation.modules) {
-
-
@@ -232,13 +297,13 @@ for (const module of navigation.modules) {
-
+
+
+
+
+
+
+
+
+
+
diff --git a/src/composables/useRole.js b/src/composables/useRole.js
index eb2eebd28..b8da153d3 100644
--- a/src/composables/useRole.js
+++ b/src/composables/useRole.js
@@ -6,7 +6,7 @@ export function useRole() {
async function fetch() {
const { data } = await axios.get('Accounts/acl');
- const roles = data.roles.map(userRoles => userRoles.role.name);
+ const roles = data.roles.map((userRoles) => userRoles.role.name);
const userData = {
id: data.user.id,
@@ -14,7 +14,7 @@ export function useRole() {
nickname: data.user.nickname,
lang: data.user.lang || 'es',
darkMode: data.user.userConfig.darkMode,
- }
+ };
state.setUser(userData);
state.setRoles(roles);
}
@@ -32,6 +32,6 @@ export function useRole() {
return {
fetch,
hasAny,
- state
+ state,
};
-}
\ No newline at end of file
+}
diff --git a/src/pages/Claim/Card/ClaimCard.vue b/src/pages/Claim/Card/ClaimCard.vue
index 32dd3f24e..cf8f7687c 100644
--- a/src/pages/Claim/Card/ClaimCard.vue
+++ b/src/pages/Claim/Card/ClaimCard.vue
@@ -1,9 +1,8 @@
@@ -11,20 +10,7 @@ const state = useState();
-
-
-
-
-
- {{ t('claim.pageTitles.basicData') }}
-
-
-
-
-
- {{ t('claim.pageTitles.rma') }}
-
-
+
diff --git a/src/pages/Customer/Card/CustomerCard.vue b/src/pages/Customer/Card/CustomerCard.vue
index 673ab66f0..73a436a69 100644
--- a/src/pages/Customer/Card/CustomerCard.vue
+++ b/src/pages/Customer/Card/CustomerCard.vue
@@ -1,11 +1,9 @@
@@ -13,30 +11,6 @@ const { t } = useI18n();
-
-
-
-
-
- {{ t('customer.pageTitles.basicData') }}
-
-
-
diff --git a/src/pages/Ticket/Card/TicketCard.vue b/src/pages/Ticket/Card/TicketCard.vue
index b5645c8cf..71df0dfce 100644
--- a/src/pages/Ticket/Card/TicketCard.vue
+++ b/src/pages/Ticket/Card/TicketCard.vue
@@ -1,24 +1,16 @@
-
-
-
-
-
- {{ t('ticket.pageTitles.boxing') }}
-
-
+
diff --git a/src/router/modules/claim.js b/src/router/modules/claim.js
index cbf078fd8..1c1cfb50e 100644
--- a/src/router/modules/claim.js
+++ b/src/router/modules/claim.js
@@ -10,11 +10,8 @@ export default {
component: RouterView,
redirect: { name: 'ClaimMain' },
menus: {
- main: [
- { name: 'ClaimList', icon: 'view_list' },
- { name: 'ClaimRmaList', icon: 'vn:barcode' },
- ],
- card: [{ name: 'CustomerBasicData', icon: 'vn:settings' }],
+ main: ['ClaimList', 'ClaimRmaList'],
+ card: ['ClaimBasicData', 'ClaimRma'],
},
children: [
{
@@ -55,6 +52,7 @@ export default {
path: 'summary',
meta: {
title: 'summary',
+ icon: 'launch',
},
component: () => import('src/pages/Claim/Card/ClaimSummary.vue'),
},
@@ -63,6 +61,7 @@ export default {
path: 'basic-data',
meta: {
title: 'basicData',
+ icon: 'vn:settings',
roles: ['salesPerson'],
},
component: () => import('src/pages/Claim/Card/ClaimBasicData.vue'),
@@ -72,6 +71,7 @@ export default {
path: 'rma',
meta: {
title: 'rma',
+ icon: 'vn:barcode',
roles: ['claimManager'],
},
component: () => import('src/pages/Claim/Card/ClaimRma.vue'),
diff --git a/src/router/modules/customer.js b/src/router/modules/customer.js
index 479a3d0ff..1c2d421b6 100644
--- a/src/router/modules/customer.js
+++ b/src/router/modules/customer.js
@@ -10,11 +10,8 @@ export default {
component: RouterView,
redirect: { name: 'CustomerMain' },
menus: {
- main: [
- { name: 'CustomerList', icon: 'view_list' },
- { name: 'CustomerCreate', icon: 'vn:addperson' },
- ],
- card: [{ name: 'CustomerBasicData', icon: 'vn:settings' }],
+ main: ['CustomerList', 'CustomerCreate'],
+ card: ['CustomerBasicData'],
},
children: [
{
@@ -55,6 +52,7 @@ export default {
path: 'summary',
meta: {
title: 'summary',
+ icon: 'launch',
},
component: () => import('src/pages/Customer/Card/CustomerSummary.vue'),
},
@@ -63,6 +61,7 @@ export default {
name: 'CustomerBasicData',
meta: {
title: 'basicData',
+ icon: 'vn:settings',
},
component: () => import('src/pages/Customer/Card/CustomerBasicData.vue'),
},
diff --git a/src/router/modules/ticket.js b/src/router/modules/ticket.js
index b9ce8dcf8..4f06a1808 100644
--- a/src/router/modules/ticket.js
+++ b/src/router/modules/ticket.js
@@ -5,10 +5,14 @@ export default {
path: '/ticket',
meta: {
title: 'tickets',
- icon: 'vn:ticket'
+ icon: 'vn:ticket',
},
component: RouterView,
redirect: { name: 'TicketMain' },
+ menus: {
+ main: ['TicketList'],
+ card: ['TicketBoxing'],
+ },
children: [
{
name: 'TicketMain',
@@ -35,8 +39,7 @@ export default {
},
component: () => import('src/pages/Ticket/TicketList.vue'),
},
-
- ]
+ ],
},
{
name: 'TicketCard',
@@ -48,7 +51,8 @@ export default {
name: 'TicketSummary',
path: 'summary',
meta: {
- title: 'summary'
+ title: 'summary',
+ icon: 'launch',
},
component: () => import('src/pages/Ticket/Card/TicketSummary.vue'),
},
@@ -56,7 +60,8 @@ export default {
name: 'TicketBasicData',
path: 'basic-data',
meta: {
- title: 'basicData'
+ title: 'basicData',
+ icon: 'vn:settings',
},
component: () => import('src/pages/Ticket/Card/TicketBasicData.vue'),
},
@@ -64,11 +69,12 @@ export default {
path: 'boxing',
name: 'TicketBoxing',
meta: {
- title: 'boxing'
+ title: 'boxing',
+ icon: 'vn:package',
},
component: () => import('src/pages/Ticket/Card/TicketBoxing.vue'),
- }
- ]
+ },
+ ],
},
- ]
+ ],
};
diff --git a/src/stores/useNavigation.js b/src/stores/useNavigation.js
new file mode 100644
index 000000000..6f3e3321e
--- /dev/null
+++ b/src/stores/useNavigation.js
@@ -0,0 +1,23 @@
+import { ref } from 'vue';
+import axios from 'axios';
+import { defineStore } from 'pinia';
+
+export const useNavigation = defineStore('navigation', () => {
+ const modules = ['customer', 'claim', 'ticket'];
+ const pinned = ref([]);
+
+ async function fetchPinned() {
+ const response = await axios.get('StarredModules/getStarredModules');
+ // const filteredModules = modules.value.filter((module) => {
+ // return response.data.find((element) => element.moduleFk == salixModules[module.name]);
+ // });
+
+ return (pinned.value = response.data);
+ }
+
+ return {
+ modules,
+ pinned,
+ fetchPinned,
+ };
+});