2017-04-18 07:09:13 +00:00
|
|
|
import Vue from 'vue';
|
|
|
|
import Router from 'vue-router';
|
|
|
|
|
|
|
|
/* layout*/
|
|
|
|
import Layout from '../views/layout/Layout';
|
|
|
|
|
|
|
|
// dashboard
|
|
|
|
const dashboard = resolve => require(['../views/dashboard/index'], resolve);
|
2017-04-20 08:06:11 +00:00
|
|
|
|
|
|
|
/* error page*/
|
2017-04-18 07:09:13 +00:00
|
|
|
const Err404 = resolve => require(['../views/error/404'], resolve);
|
|
|
|
const Err401 = resolve => require(['../views/error/401'], resolve);
|
2017-04-20 08:06:11 +00:00
|
|
|
|
2017-04-18 07:09:13 +00:00
|
|
|
/* login*/
|
|
|
|
import Login from '../views/login/';
|
|
|
|
import authRedirect from '../views/login/authredirect';
|
|
|
|
import sendPWD from '../views/login/sendpwd';
|
|
|
|
import reset from '../views/login/reset';
|
|
|
|
|
2017-04-25 05:53:49 +00:00
|
|
|
/* Introduction*/
|
|
|
|
const Introduction = resolve => require(['../views/introduction/index'], resolve);
|
|
|
|
|
2017-04-18 07:09:13 +00:00
|
|
|
/* components*/
|
2017-04-21 07:12:45 +00:00
|
|
|
const componentsIndex = resolve => require(['../views/components/index'], resolve);
|
2017-04-18 07:09:13 +00:00
|
|
|
const Tinymce = resolve => require(['../views/components/tinymce'], resolve);
|
|
|
|
const Markdown = resolve => require(['../views/components/markdown'], resolve);
|
2017-04-19 10:43:57 +00:00
|
|
|
const JsonEditor = resolve => require(['../views/components/jsoneditor'], resolve);
|
2017-04-20 06:32:41 +00:00
|
|
|
const DndList = resolve => require(['../views/components/dndlist'], resolve);
|
2017-04-27 07:05:35 +00:00
|
|
|
const AvatarUpload = resolve => require(['../views/components/avatarUpload'], resolve);
|
2017-04-20 06:32:41 +00:00
|
|
|
const Dropzone = resolve => require(['../views/components/dropzone'], resolve);
|
|
|
|
const Sticky = resolve => require(['../views/components/sticky'], resolve);
|
|
|
|
const SplitPane = resolve => require(['../views/components/splitpane'], resolve);
|
2017-04-27 07:05:35 +00:00
|
|
|
const CountTo = resolve => require(['../views/components/countTo'], resolve);
|
2017-04-20 12:31:40 +00:00
|
|
|
const Mixin = resolve => require(['../views/components/mixin'], resolve);
|
2017-04-20 06:32:41 +00:00
|
|
|
|
2017-04-18 13:38:49 +00:00
|
|
|
|
|
|
|
/* charts*/
|
2017-04-21 07:12:45 +00:00
|
|
|
const chartIndex = resolve => require(['../views/charts/index'], resolve);
|
2017-04-18 13:38:49 +00:00
|
|
|
const KeyboardChart = resolve => require(['../views/charts/keyboard'], resolve);
|
|
|
|
const KeyboardChart2 = resolve => require(['../views/charts/keyboard2'], resolve);
|
2017-04-19 10:43:57 +00:00
|
|
|
const LineMarker = resolve => require(['../views/charts/line'], resolve);
|
|
|
|
const MixChart = resolve => require(['../views/charts/mixchart'], resolve);
|
|
|
|
|
2017-04-21 10:50:13 +00:00
|
|
|
/* error log*/
|
2017-04-20 12:31:40 +00:00
|
|
|
const ErrorLog = resolve => require(['../views/errlog/index'], resolve);
|
|
|
|
|
2017-04-19 10:43:57 +00:00
|
|
|
/* excel*/
|
|
|
|
const ExcelDownload = resolve => require(['../views/excel/index'], resolve);
|
2017-04-18 13:38:49 +00:00
|
|
|
|
2017-04-21 10:50:13 +00:00
|
|
|
/* theme*/
|
|
|
|
const Theme = resolve => require(['../views/theme/index'], resolve);
|
2017-04-18 07:09:13 +00:00
|
|
|
|
2017-04-21 10:50:13 +00:00
|
|
|
/* example*/
|
|
|
|
const DynamicTable = resolve => require(['../views/example/dynamictable'], resolve);
|
2017-04-22 13:44:36 +00:00
|
|
|
const Table = resolve => require(['../views/example/table'], resolve);
|
2017-04-23 11:50:32 +00:00
|
|
|
const Form1 = resolve => require(['../views/example/form1'], resolve);
|
2017-04-29 08:29:37 +00:00
|
|
|
// const Form2 = resolve => require(['../views/example/form2'], resolve);
|
2017-04-20 08:06:11 +00:00
|
|
|
|
2017-04-24 07:13:17 +00:00
|
|
|
/* permission */
|
|
|
|
const Permission = resolve => require(['../views/permission/index'], resolve);
|
2017-04-20 12:31:40 +00:00
|
|
|
|
2017-04-18 07:09:13 +00:00
|
|
|
|
|
|
|
Vue.use(Router);
|
|
|
|
|
|
|
|
export default new Router({
|
2017-04-29 08:29:37 +00:00
|
|
|
// mode: 'history', //后端支持可开
|
|
|
|
scrollBehavior: () => ({ y: 0 }),
|
|
|
|
routes: [
|
2017-04-18 07:09:13 +00:00
|
|
|
{ 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 },
|
2017-04-27 07:05:35 +00:00
|
|
|
{ path: '/401', component: Err401, hidden: true }, {
|
2017-04-29 08:29:37 +00:00
|
|
|
path: '/',
|
|
|
|
component: Layout,
|
|
|
|
redirect: '/dashboard',
|
|
|
|
name: '首页',
|
|
|
|
hidden: true,
|
|
|
|
children: [{ path: 'dashboard', component: dashboard }]
|
2017-04-27 07:05:35 +00:00
|
|
|
}, {
|
2017-04-29 08:29:37 +00:00
|
|
|
path: '/introduction',
|
|
|
|
component: Layout,
|
|
|
|
redirect: '/introduction/index',
|
|
|
|
icon: 'xinrenzhinan',
|
|
|
|
noDropdown: true,
|
|
|
|
children: [
|
2017-04-27 07:05:35 +00:00
|
|
|
{ path: 'index', component: Introduction, name: '简述' }
|
2017-04-29 08:29:37 +00:00
|
|
|
]
|
2017-04-27 07:05:35 +00:00
|
|
|
}, {
|
2017-04-29 08:29:37 +00:00
|
|
|
path: '/permission',
|
|
|
|
component: Layout,
|
|
|
|
redirect: '/permission/index',
|
|
|
|
name: '权限测试',
|
|
|
|
icon: 'quanxian',
|
|
|
|
meta: { role: ['admin'] },
|
|
|
|
noDropdown: true,
|
|
|
|
children: [
|
2017-04-27 07:05:35 +00:00
|
|
|
{ path: 'index', component: Permission, name: '权限测试页', meta: { role: ['admin'] } }
|
2017-04-29 08:29:37 +00:00
|
|
|
]
|
2017-04-27 07:05:35 +00:00
|
|
|
}, {
|
2017-04-29 08:29:37 +00:00
|
|
|
path: '/components',
|
|
|
|
component: Layout,
|
|
|
|
redirect: '/components/index',
|
|
|
|
name: '组件',
|
|
|
|
icon: 'zujian',
|
|
|
|
children: [
|
2017-04-27 07:05:35 +00:00
|
|
|
{ path: 'index', component: componentsIndex, name: '介绍 ' },
|
|
|
|
{ path: 'tinymce', component: Tinymce, name: '富文本编辑器' },
|
|
|
|
{ path: 'markdown', component: Markdown, name: 'Markdown' },
|
|
|
|
{ path: 'jsoneditor', component: JsonEditor, name: 'JSON编辑器' },
|
|
|
|
{ path: 'dndlist', component: DndList, name: '列表拖拽' },
|
|
|
|
{ path: 'splitpane', component: SplitPane, name: 'SplitPane' },
|
|
|
|
{ path: 'avatarupload', component: AvatarUpload, name: '头像上传' },
|
|
|
|
{ path: 'dropzone', component: Dropzone, name: 'Dropzone' },
|
|
|
|
{ path: 'sticky', component: Sticky, name: 'Sticky' },
|
|
|
|
{ path: 'countto', component: CountTo, name: 'CountTo' },
|
|
|
|
{ path: 'mixin', component: Mixin, name: '小组件' }
|
2017-04-29 08:29:37 +00:00
|
|
|
]
|
2017-04-27 07:05:35 +00:00
|
|
|
}, {
|
2017-04-29 08:29:37 +00:00
|
|
|
path: '/charts',
|
|
|
|
component: Layout,
|
|
|
|
redirect: '/charts/index',
|
|
|
|
name: '图表',
|
|
|
|
icon: 'tubiaoleixingzhengchang',
|
|
|
|
children: [
|
2017-04-27 07:05:35 +00:00
|
|
|
{ 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: '混合图表' }
|
2017-04-29 08:29:37 +00:00
|
|
|
]
|
2017-04-27 07:05:35 +00:00
|
|
|
}, {
|
2017-04-29 08:29:37 +00:00
|
|
|
path: '/errorpage',
|
|
|
|
component: Layout,
|
|
|
|
redirect: 'noredirect',
|
|
|
|
name: '错误页面',
|
|
|
|
icon: '404',
|
|
|
|
children: [
|
2017-04-27 07:05:35 +00:00
|
|
|
{ path: '401', component: Err401, name: '401' },
|
|
|
|
{ path: '404', component: Err404, name: '404' }
|
2017-04-29 08:29:37 +00:00
|
|
|
]
|
2017-04-27 07:05:35 +00:00
|
|
|
}, {
|
2017-04-29 08:29:37 +00:00
|
|
|
path: '/errlog',
|
|
|
|
component: Layout,
|
|
|
|
redirect: 'noredirect',
|
|
|
|
name: 'errlog',
|
|
|
|
icon: 'bug',
|
|
|
|
noDropdown: true,
|
|
|
|
children: [
|
2017-04-27 07:05:35 +00:00
|
|
|
{ path: 'log', component: ErrorLog, name: '错误日志' }
|
2017-04-29 08:29:37 +00:00
|
|
|
]
|
2017-04-27 07:05:35 +00:00
|
|
|
}, {
|
2017-04-29 08:29:37 +00:00
|
|
|
path: '/excel',
|
|
|
|
component: Layout,
|
|
|
|
redirect: 'noredirect',
|
|
|
|
name: 'excel',
|
|
|
|
icon: 'EXCEL',
|
|
|
|
noDropdown: true,
|
|
|
|
children: [
|
2017-04-27 07:05:35 +00:00
|
|
|
{ path: 'download', component: ExcelDownload, name: '导出excel' }
|
2017-04-29 08:29:37 +00:00
|
|
|
]
|
2017-04-27 07:05:35 +00:00
|
|
|
}, {
|
2017-04-29 08:29:37 +00:00
|
|
|
path: '/theme',
|
|
|
|
component: Layout,
|
|
|
|
redirect: 'noredirect',
|
|
|
|
name: 'theme',
|
|
|
|
icon: 'theme',
|
|
|
|
noDropdown: true,
|
|
|
|
children: [
|
2017-04-27 07:05:35 +00:00
|
|
|
{ path: 'index', component: Theme, name: '换肤' }
|
2017-04-29 08:29:37 +00:00
|
|
|
]
|
2017-04-27 07:05:35 +00:00
|
|
|
}, {
|
2017-04-29 08:29:37 +00:00
|
|
|
path: '/example',
|
|
|
|
component: Layout,
|
|
|
|
redirect: 'noredirect',
|
|
|
|
name: '综合实例',
|
|
|
|
icon: 'zonghe',
|
|
|
|
children: [
|
2017-04-27 07:05:35 +00:00
|
|
|
{ path: 'dynamictable', component: DynamicTable, name: '动态table' },
|
|
|
|
{ path: 'table', component: Table, name: '综合table' },
|
|
|
|
{ path: 'form1', component: Form1, name: '综合form1' }
|
|
|
|
// { path: 'form2', component: Form2, name: '综合form2' }
|
2017-04-29 08:29:37 +00:00
|
|
|
]
|
2017-04-27 07:05:35 +00:00
|
|
|
},
|
|
|
|
// {
|
|
|
|
// 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 }
|
2017-04-29 08:29:37 +00:00
|
|
|
]
|
2017-04-18 07:09:13 +00:00
|
|
|
});
|