From 78baa306b07dd531a3c01a1d534ddd3fbaf2aa8f Mon Sep 17 00:00:00 2001 From: joan Date: Tue, 12 Apr 2022 14:53:43 +0200 Subject: [PATCH] Make use of slot --- src/layouts/MainLayout.vue | 36 ++++++++------------ src/pages/Customer/Card/CustomerCard.vue | 18 +++++----- src/pages/Customer/CustomerLayout.vue | 15 +++++++++ src/pages/Dashboard/DashboardLayout.vue | 17 ++++++++++ src/router/routes.js | 42 ++++++++++++++++++++++-- 5 files changed, 93 insertions(+), 35 deletions(-) create mode 100644 src/pages/Dashboard/DashboardLayout.vue diff --git a/src/layouts/MainLayout.vue b/src/layouts/MainLayout.vue index 480617886..c26912fa4 100644 --- a/src/layouts/MainLayout.vue +++ b/src/layouts/MainLayout.vue @@ -1,36 +1,26 @@ - + diff --git a/src/pages/Customer/Card/CustomerCard.vue b/src/pages/Customer/Card/CustomerCard.vue index 152c8cfdc..02db481f6 100644 --- a/src/pages/Customer/Card/CustomerCard.vue +++ b/src/pages/Customer/Card/CustomerCard.vue @@ -1,15 +1,15 @@ + + diff --git a/src/pages/Customer/CustomerLayout.vue b/src/pages/Customer/CustomerLayout.vue index 2785996d8..755652635 100644 --- a/src/pages/Customer/CustomerLayout.vue +++ b/src/pages/Customer/CustomerLayout.vue @@ -1,3 +1,18 @@ + diff --git a/src/pages/Dashboard/DashboardLayout.vue b/src/pages/Dashboard/DashboardLayout.vue new file mode 100644 index 000000000..917b15059 --- /dev/null +++ b/src/pages/Dashboard/DashboardLayout.vue @@ -0,0 +1,17 @@ + + diff --git a/src/router/routes.js b/src/router/routes.js index d4b63df1d..168a907e2 100644 --- a/src/router/routes.js +++ b/src/router/routes.js @@ -1,4 +1,4 @@ -import customer from './modules/customer'; +//import customer from './modules/customer'; import ticket from './modules/ticket'; const routes = [ @@ -18,7 +18,43 @@ const routes = [ path: '/dashboard', name: 'Dashboard', meta: { title: 'dashboard', icon: 'dashboard' }, - component: () => import('../pages/Dashboard/Dashboard.vue'), + component: () => import('../pages/Dashboard/DashboardLayout.vue'), + }, + { + path: '/customer', + name: 'Customer', + meta: { + title: 'customers', + icon: 'vn:client', + roles: ['salesPerson'], + }, + component: () => import('src/pages/Customer/CustomerLayout.vue'), + redirect: { name: 'CustomerList' }, + children: [ + { + path: 'list', + name: 'CustomerList', + meta: { + title: 'list' + }, + component: () => import('src/pages/Customer/CustomerList.vue'), + }, + { + path: ':id', + component: () => import('src/pages/Customer/Card/CustomerCard.vue'), + redirect: { name: 'CustomerBasicData' }, + children: [ + { + path: 'basic-data', + name: 'CustomerBasicData', + meta: { + title: 'basicData' + }, + component: () => import('src/pages/Customer/Card/CustomerBasicData.vue'), + } + ] + }, + ] }, /* { path: '/:pathMatch(.*)*', @@ -26,7 +62,7 @@ const routes = [ component: () => import('../pages/NotFound.vue'), }, */ // Module routes - customer, + //customer, ticket, ], },