| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541 |
- import Vue from 'vue'
- import Router from 'vue-router'
- Vue.use(Router)
- import { canIShow } from '@/permission'
- import Layout from '@/layout'
- export const constantRoutes = [
- {
- path: '/',
- component: Layout,
- redirect: '/login',
- meta: { title: '首页' },
- children: [
- {
- path: 'dashboard',
- component: () => import('@/views/dashboard/index'),
- name: 'Dashboard',
- meta: {
- title: '首页看板',
- icon: 'el-icon-house',
- roles: 'dashboard',
- func: [
- {
- name: '头部概览',
- roles: 'dashboard.head'
- }
- ]
- }
- },
- {
- path: 'audience',
- component: () => import('@/views/audienceManage/index'),
- name: 'audienceManage',
- meta: {
- title: '观众管理',
- icon: 'el-icon-user',
- roles: 'audience',
- func: [
- {
- name: '搜索观众',
- roles: 'audience.search'
- },
- {
- name: '按展会筛选',
- roles: 'audience.select'
- },
- {
- roles: 'audience.sendInvite',
- name: '发送邀请函'
- },
- {
- roles: 'audience.changePage',
- name: '观众换页'
- },
- {
- name: '观众导入',
- roles: 'audience.import'
- }
- ]
- }
- },
- {
- path: 'preRegister',
- component: () => import('@/views/preRegManage/index'),
- name: 'preRegManage',
- meta: {
- title: '预登记表单',
- icon: 'el-icon-tickets',
- roles: 'preReg'
- },
- redirect: '/preRegister/list',
- children: [
- {
- path: 'list',
- component: () => import('@/views/preRegManage/list'),
- name: 'preRegManageList',
- meta: {
- title: '表单管理',
- icon: 'el-icon-edit',
- roles: 'preReg.list',
- collapse: false,
- func: [
- {
- roles: 'preReg.creat',
- name: '创建表单'
- },
- {
- roles: 'preReg.search',
- name: '搜索表单'
- },
- {
- roles: 'preReg.handelEdit',
- name: '表单编辑'
- },
- {
- roles: 'preReg.handelDisable',
- name: '表单禁用'
- },
- {
- roles: 'preReg.handelDelete',
- name: '表单删除'
- },
- {
- roles: 'preReg.changePage',
- name: '表单换页'
- }
- ]
- }
- },
- {
- path: 'edit/:id',
- component: () => import('@/views/preRegManage/edit.vue'),
- name: 'preRegManagEdit',
- meta: {
- title: '表单编辑',
- icon: 'el-icon-edit',
- hidden: true,
- roles: 'preReg.edit',
- collapse: true,
- func: [
- {
- roles: 'preReg.save',
- name: '表单保存'
- },
- {
- roles: 'preReg.copy',
- name: '表单复制'
- },
- {
- roles: 'preReg.editEdit',
- name: '表单内容编辑'
- },
- {
- roles: 'preReg.editName',
- name: '表单名称编辑'
- },
- {
- roles: 'preReg.editDesc',
- name: '表单描述编辑'
- },
- {
- roles: 'preReg.saveCompEdit',
- name: '保存组件'
- }
- ]
- }
- },
- {
- path: 'add',
- component: () => import('@/views/preRegManage/edit'),
- name: 'preRegManagAdd',
- meta: {
- title: '表单新增',
- icon: 'el-icon-document-add',
- roles: 'preReg.addNew',
- collapse: true
- }
- },
- {
- path: 'comp',
- component: () => import('@/views/preRegManage/compEdit.vue'),
- name: 'preRegManagcomp',
- meta: {
- title: '我的组件',
- icon: 'el-icon-menu',
- roles: 'preReg.comp',
- func: [
- {
- roles: 'preReg.saveComp',
- name: '保存组件'
- }, {
- roles: 'preReg.copyComp',
- name: '复制组件'
- }, {
- roles: 'preReg.addComp',
- name: '新增组件'
- }
- ]
- }
- }
- ]
- },
- {
- path: 'exhibitor',
- component: () => import('@/views/exhibitorManage/index'),
- name: 'ExhibitorManage',
- meta: {
- title: '展会管理',
- icon: 'el-icon-office-building',
- roles: 'exhibitor'
- },
- redirect: '/exhibitor/list',
- children: [
- {
- component: () => import('@/views/exhibitorManage/exhibitorList'),
- path: 'list',
- name: 'exhibitorManageList',
- meta: {
- title: '展会管理',
- icon: 'el-icon-edit',
- roles: 'exhibitor.list',
- func: [
- {
- roles: 'exhibitor.addList',
- name: '添加展会'
- },
- {
- roles: 'exhibitor.search',
- name: '搜索展会'
- },
- {
- roles: 'exhibitor.handelView',
- name: '预览展会'
- },
- {
- roles: 'exhibitor.copyLink',
- name: '复制表单连接'
- },
- {
- roles: 'exhibitor.handelEdit',
- name: '编辑展会'
- },
- {
- roles: 'exhibitor.handelDisable',
- name: '禁用展会'
- },
- {
- roles: 'exhibitor.handelDelete',
- name: '删除展会'
- },
- {
- roles: 'exhibitor.handel',
- name: '展会翻页'
- }
- ] }
- },
- {
- component: () => import('@/views/exhibitorManage/exhibitorSetting'),
- name: 'exhibitorEdit',
- path: 'edit/:id',
- meta: {
- title: '配置展会',
- icon: 'el-icon-setting',
- roles: 'exhibitor.setting',
- hidden: true,
- func: [
- {
- roles: 'exhibitor.save',
- name: '保存展会'
- },
- {
- roles: 'exhibitor.copyright',
- name: '是否显示底部信息开关'
- }
- ]
- }
- },
- {
- component: () => import('@/views/exhibitorManage/exhibitorSetting'),
- name: 'exhibitorAdd',
- path: 'add',
- meta: {
- title: '添加展会',
- icon: 'el-icon-document-add',
- roles: 'exhibitor.add'
- }
- }
- ]
- },
- {
- path: 'invitation',
- component: () => import('@/views/invitationManage/index'),
- name: 'invitationManage',
- meta: {
- title: '邀请函模板管理',
- icon: 'el-icon-files',
- roles: 'invitation'
- },
- redirect: '/invitation/list',
- children: [{
- path: 'list',
- component: () => import('@/views/invitationManage/list'),
- name: 'invitationManageList',
- meta: {
- title: '邀请函模板管理',
- icon: 'el-icon-edit',
- roles: 'invitation.index',
- collapse: false,
- func: [
- {
- roles: 'invitation.addList',
- name: '添加邀请函模板'
- },
- {
- roles: 'invitation.goto',
- name: '点击进入模板'
- },
- {
- roles: 'invitation.changePage',
- name: '邀请函模板翻页'
- }
- ]
- }
- },
- {
- path: 'add',
- component: () => import('@/views/invitationManage/edit'),
- name: 'invitationAdd',
- meta: {
- title: '邀请函模板新增',
- icon: 'el-icon-document-add',
- roles: 'invitation.add',
- collapse: true
- }
- },
- {
- path: 'edit/:id',
- component: () => import('@/views/invitationManage/edit'),
- name: 'invitationEdit',
- meta: {
- title: '邀请函模板编辑',
- icon: 'el-icon-edit',
- hidden: true,
- roles: 'invitation.edit',
- collapse: true,
- func: [
- {
- roles: 'invitation.save',
- name: '修改邀请函模板'
- },
- {
- roles: 'invitation.desc',
- name: '修改邀请函描述'
- },
- {
- roles: 'invitation.rename',
- name: '重命名邀请函模板'
- },
- {
- roles: 'invitation.select',
- name: '选择展会'
- },
- {
- roles: 'invitation.editor',
- name: '允许操作编辑器'
- }
- ]
- }
- }
- ]
- },
- {
- path: 'setting',
- component: () => import('@/views/setting/index'),
- name: 'setting',
- meta: {
- title: '信息与配置',
- icon: 'el-icon-setting',
- roles: 'setting'
- },
- redirect: '/setting/exhibitor',
- children: [
- {
- path: 'account',
- component: () => import('@/views/setting/accountSetting'),
- name: 'accountSetting',
- meta: {
- title: '系统账号管理',
- icon: 'el-icon-user',
- roles: 'setting.account',
- func: [
- {
- name: '添加账号',
- roles: 'setting.account.add'
- },
- {
- name: '操作账号',
- roles: 'setting.account.handel'
- },
- {
- name: '搜索账号',
- roles: 'setting.account.search'
- },
- {
- name: '账号翻页',
- roles: 'setting.account.changePage'
- }
- ]
- }
- },
- {
- path: 'roles',
- component: () => import('@/views/setting/rolesSetting.vue'),
- name: 'accountRoles',
- meta: {
- title: '系统角色管理',
- icon: 'el-icon-suitcase-1',
- roles: 'setting.roles',
- func: [
- {
- name: '添加角色',
- roles: 'setting.roles.add'
- }, {
- name: '操作角色',
- roles: 'setting.roles.handel'
- },
- {
- name: '搜索角色',
- roles: 'setting.roles.search'
- },
- {
- name: '角色翻页',
- roles: 'setting.roles.changePage'
- },
- {
- name: '角色权限配置',
- roles: 'setting.roles.permission'
- },
- {
- name: '角色权限保存',
- roles: 'setting.roles.save'
- }
- ]
- }
- },
- {
- path: 'system',
- component: () => import('@/views/setting/systemSetting'),
- name: 'systemSetting',
- meta: {
- title: '系统信息配置',
- icon: 'el-icon-setting',
- roles: 'setting.system',
- func: [
- {
- name: '修改发件邮箱地址',
- roles: 'setting.system.sentEmailAddress'
- },
- {
- name: '修改发件邮箱密码/授权码',
- roles: 'setting.system.sentEmailPassword'
- },
- {
- name: '修改发件邮箱服务器地址',
- roles: 'setting.system.sentEmailServer'
- },
- {
- name: '修改发件邮箱SMTP端口号',
- roles: 'setting.system.sentEmailPort'
- },
- {
- name: '修改发件邮箱SSL加密',
- roles: 'setting.system.sentEmailSSL'
- }, {
- name: '保存设置',
- roles: 'setting.system.save'
- }
- ]
- }
- }
- ]
- },
- {
- path: '404',
- component: () => import('@/views/errorPage/404'),
- name: '404',
- meta: {
- title: '页面不存在哦',
- icon: 'el-icon-delete-location',
- hidden: true,
- roles: '404'
- }
- },
- {
- path: '401',
- component: () => import('@/views/errorPage/401'),
- name: '401',
- meta: {
- title: '页面无权限哦',
- icon: 'el-icon-delete-location',
- hidden: true,
- roles: '401'
- }
- }
- ]
- },
- {
- path: '/login',
- name: 'login',
- component: () => import('@/views/login/index'),
- hidden: true,
- meta: {
- title: '登录',
- icon: 'el-icon-user',
- hidden: true,
- roles: 'login'
- }
- },
- {
- path: '/user/form/:url',
- name: 'userForm',
- component: () => import('@/views/user/form.vue'),
- hidden: true,
- meta: {
- title: '用户表单',
- icon: 'el-icon-user',
- hidden: true,
- roles: 'user.form'
- }
- },
- {
- path: '/user/register',
- name: 'userRegister',
- component: () => import('@/views/user/register.vue'),
- hidden: true,
- meta: {
- title: '用户注册',
- icon: 'el-icon-user',
- hidden: true,
- roles: 'user.register'
- }
- },
- { path: '*', redirect: '/404', hidden: true }
- ]
- const createRouter = () => new Router({
- mode: 'history', // require service support
- scrollBehavior: () => ({ y: 0 }),
- routes: constantRoutes
- })
- const router = createRouter()
- router.beforeEach((to, from, next) => {
- canIShow(to.meta.roles).then((res) => {
- if (res) {
- next()
- } else {
- next({
- name: '401'
- })
- }
- })
- })
- export default router
|