From e65dfd38daa3660fcf56019744cdfb35b830bdcc Mon Sep 17 00:00:00 2001 From: Pan Date: Fri, 12 May 2017 11:54:53 +0800 Subject: [PATCH] refine code && rm code --- src/router/index.js | 215 ++++++++-------- src/views/admin/createUser.vue | 87 ------- src/views/admin/profile.vue | 404 ------------------------------ src/views/admin/quicklycreate.vue | 92 ------- src/views/admin/usersList.vue | 241 ------------------ src/views/example/form2.vue | 0 6 files changed, 104 insertions(+), 935 deletions(-) delete mode 100644 src/views/admin/createUser.vue delete mode 100644 src/views/admin/profile.vue delete mode 100644 src/views/admin/quicklycreate.vue delete mode 100644 src/views/admin/usersList.vue delete mode 100644 src/views/example/form2.vue diff --git a/src/router/index.js b/src/router/index.js index e1a10ceb..86caba70 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -56,7 +56,6 @@ const Table = resolve => require(['../views/example/table'], resolve); const DragTable = resolve => require(['../views/example/dragTable'], resolve); const InlineEditTable = resolve => require(['../views/example/inlineEditTable'], resolve); const Form1 = resolve => require(['../views/example/form1'], resolve); -// const Form2 = resolve => require(['../views/example/form2'], resolve); /* permission */ const Permission = resolve => require(['../views/permission/index'], resolve); @@ -64,49 +63,56 @@ const Permission = resolve => require(['../views/permission/index'], resolve); Vue.use(Router); + /** + * icon :the icon show in the sidebar + * hidden: if hiddenLtrue will not show in the sidebar + * redirect :if redirect:noredirect will not redirct in the levelbar + * noDropdown : if noDropdown:true will not has submenu + * meta: { role: ['admin'] } will control the page role + */ export default new Router({ // mode: 'history', //后端支持可开 scrollBehavior: () => ({ y: 0 }), routes: [ - { path: '/login', component: Login, hidden: true }, - { path: '/authredirect', component: authRedirect, hidden: true }, - { path: '/sendpwd', component: sendPWD, hidden: true }, - { path: '/reset', component: reset, hidden: true }, - { path: '/404', component: Err404, hidden: true }, - { path: '/401', component: Err401, hidden: true }, { - path: '/', - component: Layout, - redirect: '/dashboard', - name: '首页', - hidden: true, - children: [{ path: 'dashboard', component: dashboard }] - }, { - path: '/introduction', - component: Layout, - redirect: '/introduction/index', - icon: 'xinrenzhinan', - noDropdown: true, - children: [ - { path: 'index', component: Introduction, name: '简述' } - ] - }, { - path: '/permission', - component: Layout, - redirect: '/permission/index', - name: '权限测试', - icon: 'quanxian', - meta: { role: ['admin'] }, - noDropdown: true, - children: [ - { path: 'index', component: Permission, name: '权限测试页', meta: { role: ['admin'] } } - ] - }, { - path: '/components', - component: Layout, - redirect: '/components/index', - name: '组件', - icon: 'zujian', - children: [ + { path: '/login', component: Login, hidden: true }, + { path: '/authredirect', component: authRedirect, hidden: true }, + { path: '/sendpwd', component: sendPWD, hidden: true }, + { path: '/reset', component: reset, hidden: true }, + { path: '/404', component: Err404, hidden: true }, + { path: '/401', component: Err401, hidden: true }, + { + path: '/', + component: Layout, + redirect: '/dashboard', + name: '首页', + hidden: true, + children: [{ path: 'dashboard', component: dashboard }] + }, + { + path: '/introduction', + component: Layout, + redirect: '/introduction/index', + icon: 'xinrenzhinan', + noDropdown: true, + children: [{ path: 'index', component: Introduction, name: '简述' }] + }, + { + path: '/permission', + component: Layout, + redirect: '/permission/index', + name: '权限测试', + icon: 'quanxian', + meta: { role: ['admin'] }, + noDropdown: true, + children: [{ path: 'index', component: Permission, name: '权限测试页', meta: { role: ['admin'] } }] + }, + { + path: '/components', + component: Layout, + redirect: '/components/index', + name: '组件', + icon: 'zujian', + children: [ { path: 'index', component: componentsIndex, name: '介绍 ' }, { path: 'tinymce', component: Tinymce, name: '富文本编辑器' }, { path: 'markdown', component: Markdown, name: 'Markdown' }, @@ -118,88 +124,75 @@ export default new Router({ { path: 'sticky', component: Sticky, name: 'Sticky' }, { path: 'countto', component: CountTo, name: 'CountTo' }, { path: 'mixin', component: Mixin, name: '小组件' } - ] - }, { - path: '/charts', - component: Layout, - redirect: '/charts/index', - name: '图表', - icon: 'tubiaoleixingzhengchang', - children: [ + ] + }, + { + path: '/charts', + component: Layout, + redirect: '/charts/index', + name: '图表', + icon: 'tubiaoleixingzhengchang', + children: [ { path: 'index', component: chartIndex, name: '介绍' }, { path: 'keyboard', component: KeyboardChart, name: '键盘图表' }, { path: 'keyboard2', component: KeyboardChart2, name: '键盘图表2' }, { path: 'line', component: LineMarker, name: '折线图' }, { path: 'mixchart', component: MixChart, name: '混合图表' } - ] - }, { - path: '/errorpage', - component: Layout, - redirect: 'noredirect', - name: '错误页面', - icon: '404', - children: [ + ] + }, + { + path: '/errorpage', + component: Layout, + redirect: 'noredirect', + name: '错误页面', + icon: '404', + children: [ { path: '401', component: Err401, name: '401' }, { path: '404', component: Err404, name: '404' } - ] - }, { - path: '/errlog', - component: Layout, - redirect: 'noredirect', - name: 'errlog', - icon: 'bug', - noDropdown: true, - children: [ - { path: 'log', component: ErrorLog, name: '错误日志' } - ] - }, { - path: '/excel', - component: Layout, - redirect: 'noredirect', - name: 'excel', - icon: 'EXCEL', - noDropdown: true, - children: [ - { path: 'download', component: ExcelDownload, name: '导出excel' } - ] - }, { - path: '/theme', - component: Layout, - redirect: 'noredirect', - name: 'theme', - icon: 'theme', - noDropdown: true, - children: [ - { path: 'index', component: Theme, name: '换肤' } - ] - }, { - path: '/example', - component: Layout, - redirect: 'noredirect', - name: '综合实例', - icon: 'zonghe', - children: [ + ] + }, + { + path: '/errlog', + component: Layout, + redirect: 'noredirect', + name: 'errlog', + icon: 'bug', + noDropdown: true, + children: [{ path: 'log', component: ErrorLog, name: '错误日志' }] + }, + { + path: '/excel', + component: Layout, + redirect: 'noredirect', + name: 'excel', + icon: 'EXCEL', + noDropdown: true, + children: [{ path: 'download', component: ExcelDownload, name: '导出excel' }] + }, + { + path: '/theme', + component: Layout, + redirect: 'noredirect', + name: 'theme', + icon: 'theme', + noDropdown: true, + children: [{ path: 'index', component: Theme, name: '换肤' }] + }, + { + path: '/example', + component: Layout, + redirect: 'noredirect', + name: '综合实例', + icon: 'zonghe', + children: [ { path: 'dynamictable', component: DynamicTable, name: '动态table' }, { path: 'dragtable', component: DragTable, name: '拖拽table' }, { path: 'inline_edit_table', component: InlineEditTable, name: 'table内编辑' }, { path: 'table', component: Table, name: '综合table' }, { path: 'form1', component: Form1, name: '综合form1' } - // { path: 'form2', component: Form2, name: '综合form2' } - ] - }, - // { - // path: '/admin', - // component: Layout, - // redirect: 'noredirect', - // name: '后台管理', - // icon: 'geren1', - // children: [ - // { path: 'createuser', component: AdminCreateUser, name: '管理员', meta: { role: ['admin'] } }, - // { path: 'list', component: UsersList, name: '后台用户列表', meta: { role: ['super_editor', 'product', 'author_assistant'] } }, - // { path: 'qicklyCreate', component: QuicklyCreateUser, name: '一键创建账户', meta: { role: ['super_editor', 'gold_editor', 'weex_editor', 'wscn_editor', 'author_assistant', 'product'] } }, - // { path: 'profile', component: UserProfile, name: '个人' } - // ] - // }, - { path: '*', redirect: '/404', hidden: true } + ] + }, + + { path: '*', redirect: '/404', hidden: true } ] }); diff --git a/src/views/admin/createUser.vue b/src/views/admin/createUser.vue deleted file mode 100644 index d7de7537..00000000 --- a/src/views/admin/createUser.vue +++ /dev/null @@ -1,87 +0,0 @@ - - diff --git a/src/views/admin/profile.vue b/src/views/admin/profile.vue deleted file mode 100644 index fa80c902..00000000 --- a/src/views/admin/profile.vue +++ /dev/null @@ -1,404 +0,0 @@ - - - - diff --git a/src/views/admin/quicklycreate.vue b/src/views/admin/quicklycreate.vue deleted file mode 100644 index 0b39be4c..00000000 --- a/src/views/admin/quicklycreate.vue +++ /dev/null @@ -1,92 +0,0 @@ - - - diff --git a/src/views/admin/usersList.vue b/src/views/admin/usersList.vue deleted file mode 100644 index efbb3066..00000000 --- a/src/views/admin/usersList.vue +++ /dev/null @@ -1,241 +0,0 @@ - - - - diff --git a/src/views/example/form2.vue b/src/views/example/form2.vue deleted file mode 100644 index e69de29b..00000000