From 96898eae45b2a2e764b9a99f3c12ad028daf2fff Mon Sep 17 00:00:00 2001 From: "Adam.Gong" Date: Sun, 10 May 2020 02:58:37 +0800 Subject: [PATCH] auto commit the code by alias command --- src/router/index.js | 233 ++++++++++++++++------------------- src/router/modules/system.js | 10 +- src/router/modules/user.js | 4 +- src/views/dashboard/editor/index.vue | 72 ----------- src/views/dashboard/index.vue | 45 +++++-- 5 files changed, 149 insertions(+), 215 deletions(-) delete mode 100755 src/views/dashboard/editor/index.vue diff --git a/src/router/index.js b/src/router/index.js index 86dd9f9..0b074fb 100755 --- a/src/router/index.js +++ b/src/router/index.js @@ -9,12 +9,13 @@ import Layout from '@/layout' /* Router Modules */ // import componentsRouter from './modules/components' // import chartsRouter from './modules/charts' -import tableRouter from './modules/table' +// import tableRouter from './modules/table' // import nestedRouter from './modules/nested' import userRouter from './modules/user' import systemRouter from './modules/system' import prodRouter from './modules/prod' import metaRouter from './modules/meta' +import sitesRouter from './modules/sites' /** * Note: sub-menu only appear when route children.length >= 1 @@ -42,81 +43,82 @@ import metaRouter from './modules/meta' * a base page that does not have permission requirements * all roles can be accessed */ -export const constantRoutes = [ - { - path: '/redirect', - component: Layout, - hidden: true, - children: [ - { - path: '/redirect/:path*', - component: () => import('@/views/redirect/index') - } - ] - }, - { - path: '/login', - component: () => import('@/views/login/index'), - hidden: true - }, - { - path: '/auth-redirect', - component: () => import('@/views/login/auth-redirect'), - hidden: true - }, - { - path: '/404', - component: () => import('@/views/error-page/404'), - hidden: true - }, - { - path: '/500', - component: () => import('@/views/error-page/500'), - hidden: true - }, - { - path: '/401', - component: () => import('@/views/error-page/401'), - hidden: true - }, - { - path: '/', - component: Layout, - redirect: '/dashboard', - children: [ - { - path: 'dashboard', - component: () => import('@/views/dashboard/index'), - name: 'Dashboard', - meta: { title: 'dashboard', icon: 'dashboard', affix: true } - } - ] - }, - // { - // path: '/documentation', - // component: Layout, - // children: [ - // { - // path: 'index', - // component: () => import('@/views/documentation/index'), - // name: 'Documentation', - // meta: { title: 'documentation', icon: 'documentation', affix: true } - // } - // ] - // }, - { - path: '/guide', - component: Layout, - redirect: '/guide/index', - children: [ - { - path: 'index', - component: () => import('@/views/guide/index'), - name: 'Guide', - meta: { title: 'guide', icon: 'guide', noCache: true } - } - ] - } +export const constantRoutes = [{ + path: '/redirect', + component: Layout, + hidden: true, + children: [{ + path: '/redirect/:path*', + component: () => import('@/views/redirect/index') + }] +}, +{ + path: '/login', + component: () => import('@/views/login/index'), + hidden: true +}, +{ + path: '/auth-redirect', + component: () => import('@/views/login/auth-redirect'), + hidden: true +}, +{ + path: '/404', + component: () => import('@/views/error-page/404'), + hidden: true +}, +{ + path: '/500', + component: () => import('@/views/error-page/500'), + hidden: true +}, +{ + path: '/401', + component: () => import('@/views/error-page/401'), + hidden: true +}, +{ + path: '/', + component: Layout, + redirect: '/dashboard', + children: [{ + path: 'dashboard', + component: () => import('@/views/dashboard/index'), + name: 'Dashboard', + meta: { + title: 'dashboard', + icon: 'dashboard', + affix: true + } + }] +}, +// { +// path: '/documentation', +// component: Layout, +// children: [ +// { +// path: 'index', +// component: () => import('@/views/documentation/index'), +// name: 'Documentation', +// meta: { title: 'documentation', icon: 'documentation', affix: true } +// } +// ] +// }, +{ + path: '/guide', + component: Layout, + redirect: '/guide/index', + children: [{ + path: 'index', + component: () => import('@/views/guide/index'), + name: 'Guide', + meta: { + title: 'guide', + icon: 'guide', + noCache: true + } + }] +} // { // path: '/profile', // component: Layout, @@ -180,7 +182,7 @@ export const asyncRoutes = [ // } // ] // }, - tableRouter, + // tableRouter, metaRouter, userRouter, prodRouter, @@ -195,61 +197,28 @@ export const asyncRoutes = [ icon: 'shopping', roles: ['admin', 'assistant', 'runner', 'shoper'] // you can set roles in root nav }, - children: [ - { - path: 'page', - component: () => import('@/views/permission/page'), - name: 'OrderList', - meta: { - title: 'OrderList', - roles: ['admin', 'assistant', 'runner', 'shoper'] // or you can only set roles in sub nav - } - }, - { - path: 'defined', - component: () => import('@/views/permission/directive'), - name: 'OrderDefiend', - meta: { - title: 'OrderDefiend', - roles: ['admin', 'assistant', 'runner', 'shoper'] - // if do not set roles, means: this page does not require permission - } + children: [{ + path: 'page', + component: () => import('@/views/permission/page'), + name: 'OrderList', + meta: { + title: 'OrderList', + roles: ['admin', 'assistant', 'runner', 'shoper'] // or you can only set roles in sub nav } - ] - }, - { - path: '/sites', - component: Layout, - redirect: '/site/page', - alwaysShow: true, // will always show the root menu - name: 'Site', - meta: { - title: 'sites', - icon: 'people', - roles: ['admin', 'assistant', 'runner'] // you can set roles in root nav }, - children: [ - { - path: 'page', - component: () => import('@/views/permission/page'), - name: 'SiteList', - meta: { - title: 'SiteList', - roles: ['admin', 'assistant', 'runner'] // or you can only set roles in sub nav - } - }, - { - path: 'defined', - component: () => import('@/views/permission/directive'), - name: 'SiteDefiend', - meta: { - title: 'SiteDefiend', - roles: ['admin', 'assistant', 'runner'] - // if do not set roles, means: this page does not require permission - } + { + path: 'defined', + component: () => import('@/views/permission/directive'), + name: 'OrderDefiend', + meta: { + title: 'OrderDefiend', + roles: ['admin', 'assistant', 'runner', 'shoper'] + // if do not set roles, means: this page does not require permission } + } ] }, + sitesRouter, // { // path: '/icon', @@ -477,12 +446,18 @@ export const asyncRoutes = [ // }, // 404 page must be placed at the end !!! - { path: '*', redirect: '/404', hidden: true } + { + path: '*', + redirect: '/404', + hidden: true + } ] const createRouter = () => new Router({ // mode: 'history', // require service support - scrollBehavior: () => ({ y: 0 }), + scrollBehavior: () => ({ + y: 0 + }), routes: constantRoutes }) diff --git a/src/router/modules/system.js b/src/router/modules/system.js index f4bb5e5..31e917d 100644 --- a/src/router/modules/system.js +++ b/src/router/modules/system.js @@ -9,7 +9,7 @@ const systemRouter = { meta: { title: 'systems.systems', icon: 'component', - roles: ['admin', 'assistant', 'runner'] // you can set roles in root nav + roles: ['admin', 'assistant'] // you can set roles in root nav }, children: [{ path: 'page', @@ -17,7 +17,7 @@ const systemRouter = { name: 'SystemList', meta: { title: 'systems.sites', - roles: ['admin', 'assistant', 'runner'] // or you can only set roles in sub nav + roles: ['admin', 'assistant'] // or you can only set roles in sub nav } }, { @@ -26,7 +26,7 @@ const systemRouter = { name: 'SystemList', meta: { title: 'systems.money', - roles: ['admin', 'assistant', 'runner'] // or you can only set roles in sub nav + roles: ['admin', 'assistant'] // or you can only set roles in sub nav } }, { @@ -35,7 +35,7 @@ const systemRouter = { name: 'SystemList', meta: { title: 'systems.industry', - roles: ['admin', 'assistant', 'runner'] // or you can only set roles in sub nav + roles: ['admin', 'assistant'] // or you can only set roles in sub nav } }, { @@ -44,7 +44,7 @@ const systemRouter = { name: 'SystemList', meta: { title: 'systems.template', - roles: ['admin', 'assistant', 'runner'] // or you can only set roles in sub nav + roles: ['admin', 'assistant'] // or you can only set roles in sub nav } } diff --git a/src/router/modules/user.js b/src/router/modules/user.js index 3d1d69e..e5fcedd 100644 --- a/src/router/modules/user.js +++ b/src/router/modules/user.js @@ -11,7 +11,7 @@ const chartsRouter = { meta: { title: 'users.people', icon: 'peoples', - roles: ['admin', 'assistant', 'runner', 'shoper'] // you can set roles in root nav + roles: ['admin', 'assistant'] // you can set roles in root nav }, children: [{ path: 'assistant', @@ -58,7 +58,7 @@ const chartsRouter = { }, meta: { title: 'users.user', - roles: ['admin', 'assistant', 'shoper', 'runner'] // or you can only set roles in sub nav + roles: ['admin', 'assistant'] // or you can only set roles in sub nav } } // ,{ diff --git a/src/views/dashboard/editor/index.vue b/src/views/dashboard/editor/index.vue deleted file mode 100755 index e2085a6..0000000 --- a/src/views/dashboard/editor/index.vue +++ /dev/null @@ -1,72 +0,0 @@ - - - - - diff --git a/src/views/dashboard/index.vue b/src/views/dashboard/index.vue index 1720ea8..c4b15d1 100755 --- a/src/views/dashboard/index.vue +++ b/src/views/dashboard/index.vue @@ -7,24 +7,55 @@