cnas/client/src/router/index.js

527 lines
16 KiB
JavaScript

import Vue from 'vue'
import Router from 'vue-router'
Vue.use(Router)
/* Layout */
import Layout from '@/layout'
/**
* Note: sub-menu only appear when route children.length >= 1
* Detail see: https://panjiachen.github.io/vue-element-admin-site/guide/essentials/router-and-nav.html
*
* hidden: true if set true, item will not show in the sidebar(default is false)
* alwaysShow: true if set true, will always show the root menu
* if not set alwaysShow, when item has more than one children route,
* it will becomes nested mode, otherwise not show the root menu
* redirect: noRedirect if set noRedirect will no redirect in the breadcrumb
* name:'router-name' the name is used by <keep-alive> (must set!!!)
* meta : {
perms: ['admin','editor'] control the page perms (you can set multiple perms)
title: 'title' the name show in sidebar and breadcrumb (recommend set)
icon: 'svg-name' the icon show in the sidebar
breadcrumb: false if set false, the item will hidden in breadcrumb(default is true)
activeMenu: '/example/list' if set path, the sidebar will highlight the path you set
}
*/
/**
* constantRoutes
* a base page that does not have permission requirements
* all perms can be accessed
*/
export const constantRoutes = [
{
path: '/login',
component: () => import('@/views/login/index'),
hidden: true
},
{
path: '/404',
component: () => import('@/views/404'),
hidden: true
},
{
path: '/',
component: Layout,
redirect: '/dashboard',
children: [{
path: 'dashboard',
name: 'Dashboard',
component: () => import('@/views/dashboard/index'),
meta: { title: '首页', icon: 'dashboard' }
}]
}
]
/**
* asyncRoutes
* the routes that need to be dynamically loaded based on user perms
*/
export const asyncRoutes = [
{
path: '/project',
component: Layout,
redirect: '/project/certapp',
name: 'ProjectManage',
meta: { title: '认证项目', icon: 'example'},
children: [
{
path: 'application',
name: 'Applicaion',
component: () => import('@/views/application/application'),
meta: { title: '业务受理2', icon: 'example', perms: ['application_view'] }
},
{
path: 'certapp',
name: 'Certapp',
component: () => import('@/views/certapp/certapp'),
meta: { title: '业务受理1', icon: 'example', perms: ['certapp_view'] }
},
// {
// path: 'application2',
// name: 'Applicaion2',
// component: () => import('@/views/employee/train'),
// meta: { title: '客户申请受理', icon: 'example', perms: ['application_accept'] }
// },
{
path: 'project',
name: 'Project',
component: () => import('@/views/project/project'),
meta: { title: '项目制定', icon: 'example', perms: ['project_view'] }
},
{
path: 'application/applicationform/',
name: 'ApplicationForm',
component: () => import('@/views/application/applicationform'),
meta: { title: '认证申请', icon: 'example', perms: ['application_create', 'application_update'] },
hidden: true
},
{
path: 'certapp/create/:id/',
name: 'Certappcreate',
component: () => import('@/views/certapp/certappcreate'),
meta: { title: '申请受理单创建', icon: 'example', perms: ['certapp_create'] },
hidden: true
},
{
path: 'certapp/:id/update/',
name: 'Certappupdate',
component: () => import('@/views/certapp/certapphandle'),
meta: { title: '申请受理单修改', icon: 'example', perms: ['certapp_update'] },
hidden: true
},
{
path: 'certapp/:id/detail/',
name: 'Certappdetail',
component: () => import('@/views/certapp/certapphandle'),
meta: { title: '业务详情', icon: 'example', perms: ['certapp_detail'] },
hidden: true
},
]
},
{
path: '/plan',
component: Layout,
redirect: '/plan/plan',
name: 'PlanManage',
meta: { title: '审核策划', icon: 'example'},
children: [
{
path: 'plan',
name: 'Plan',
component: () => import('@/views/plan/plan'),
meta: { title: '策划', icon: 'example', perms: ['plan_view'] }
},
{
path: 'paichai',
name: 'Paichai',
component: () => import('@/views/plan/paichai'),
meta: { title: '派差', icon: 'example', perms: ['plan_view'] }
},
{
path: 'project/:id/',
name: 'PlanProject',
component: () => import('@/views/project/handle'),
meta: { title: '项目', icon: 'example', perms: ['project_view'] },
hidden: true
},
{
path: 'certapp/:id/:action/',
name: 'Certappmember',
component: () => import('@/views/certapp/certapphandle'),
meta: { title: '派人', icon: 'example', perms: ['plan_view'] },
hidden: true
},
]
},
{
path: '/audit',
component: Layout,
redirect: '/audit/task',
name: 'Audit',
meta: { title: '现场审核', icon: 'example'},
children: [
{
path: 'task',
name: 'AuditTask',
component: () => import('@/views/audit/task'),
meta: { title: '我的任务', icon: 'example', perms: ['audittask_view'] }
},
{
path: 'fee',
name: 'Fee',
component: () => import('@/views/audit/fee'),
meta: { title: '劳务费', icon: 'example', perms: ['taskfee_view'] }
},
{
path: 'project/:id/',
name: 'AuditProject',
component: () => import('@/views/project/handle'),
meta: { title: '项目', icon: 'example', perms: ['project_view'] },
hidden: true
},
{
path: 'certapp/:id/:action/',
name: 'Certappfeedback',
component: () => import('@/views/certapp/certapphandle'),
meta: { title: '业务审核反馈', icon: 'example', perms: ['certapp_feedback'] },
hidden: true
},
]
},
{
path: '/testorg',
component: Layout,
redirect: '/testorg/testorg',
name: 'testorg',
meta: { title: '产品检测', icon: 'example' },
children: [
{
path: 'testorg',
name: 'TestOrg',
component: () => import('@/views/testorg/testorg'),
meta: { title: '实验室信息', icon: 'example', perms: ['testorg_manage'] }
},
{
path: 'testorgnotice',
name: 'TextOrgNotice',
component: () => import('@/views/testorg/testorgnotice'),
meta: { title: '实验室通知公告', icon: 'example', perms: ['testorg_manage'] }
},
]
},
{
path: '/accessment',
component: Layout,
redirect: '/accessment/index',
name: 'AccessmentManage',
meta: { title: '认证评定', icon: 'example'},
children: [
{
path: 'index',
name: 'Accessment',
component: () => import('@/views/accessment/index'),
meta: { title: '认证评定', icon: 'example', perms: ['accessment_view'] }
},
{
path: 'certapp/:id/:action/',
name: 'Certappaccess',
component: () => import('@/views/certapp/certapphandle'),
meta: { title: '业务评定', icon: 'example', perms: ['certapp_access'] },
hidden: true
},
]
},
{
path: '/certificate',
component: Layout,
redirect: '/certificate/index',
name: 'CertificateManage',
meta: { title: '证书管理', icon: 'example'},
children: [
{
path: 'index',
name: 'Certificate',
component: () => import('@/views/certificate/index'),
meta: { title: '证书管理', icon: 'example', perms: ['certificate_view'] }
},
]
},
{
path: '/employee',
component: Layout,
redirect: '/employee/employee',
name: 'EmployeeManage',
meta: { title: '人员管理', icon: 'example'},
children: [
{
path: 'employee',
name: 'Employee',
component: () => import('@/views/employee/employee'),
meta: { title: '人员信息', icon: 'example', perms: ['employee_view'] }
},
{
path: 'employee/update/:id',
name: 'EmployeeUpdate',
component: () => import('@/views/employee/employeeupdate'),
meta: { title: '人员信息变更', icon: 'example', perms: ['employee_update'] },
hidden: true
},
// {
// path: 'qualification_',
// name: 'Qualification_',
// component: () => import('@/views/qualification/qualification_'),
// meta: { title: '注册资格检索', icon: 'example', perms: ['qualification_view'] }
// },
{
path: 'train',
name: 'Train',
component: () => import('@/views/employee/train'),
meta: { title: '人员培训', icon: 'example', perms: ['Train_manage'] }
},
{
path: 'train/create',
name: 'TrainCreate',
component: () => import('@/views/employee/traincreate'),
meta: { title: '新增人员培训', icon: 'example', perms: ['Train_create'] },
hidden: true
},
{
path: 'train/update',
name: 'TrainUpdate',
component: () => import('@/views/employee/trainupdate'),
meta: { title: '修改人员培训', icon: 'example', perms: ['Train_update'] },
hidden: true
},
{
path: 'user/select',
name: 'UserSelect',
component: () => import('@/views/employee/userselet'),
meta: { title: '选择人员', icon: 'example', perms: ['User_select'] },
hidden: true
},
]
},
{
path: '/certset',
component: Layout,
redirect: '/certset/implementrule',
name: 'certset',
meta: { title: '认证配置', icon: 'example'},
children: [
{
path: 'implementrule',
name: 'ImplementRule',
component: () => import('@/views/implementrule/implementrule'),
meta: { title: '认证规则', icon: 'example', perms: ['implementrule_manage'] }
},
{
path: 'standard',
name: 'Standard',
component: () => import('@/views/standard/standard'),
meta: { title: '标准库', icon: 'example', perms: ['standard_manage'] }
},
{
path: 'implementrule/create',
name: 'ImplementRuleCreate',
component: () => import('@/views/implementrule/implementrulecreate.vue'),
meta: { title: '新增规则', noCache: true, icon: '', perms: ['implementrule_create']},
hidden: true
},
{
path: 'implementrule/update',
name: 'ImplementRuleUpdate',
component: () => import('@/views/implementrule/implementruleupdate.vue'),
meta: { title: '编辑规则', noCache: true, icon: '', perms: ['implementrule_update']},
hidden: true
},
{
path: 'evaluationitem',
name: 'evaluationitem',
component: () => import('@/views/evaluation/evaluationitem'),
meta: { title: '评审信息', icon: 'example', perms: ['evaluation_manage'] }
},
{
path: 'evaluationitem/create',
name: 'evaluationitemcreate',
component: () => import('@/views/evaluation/evaluationitemcreate.vue'),
meta: { title: '新增规则', noCache: true, icon: '', perms: ['evaluationitem_create'] },
hidden: true
},
{
path: 'evaluationitem/update',
name: 'evaluationitemupdate',
component: () => import('@/views/evaluation/evaluationitemupdate.vue'),
meta: { title: '新增规则', noCache: true, icon: '', perms: ['evaluationitem_update'] },
hidden: true
},
]
},
{
path: '/crm',
component: Layout,
redirect: '/crm/enterprise',
name: 'crm',
meta: { title: '客户企业', icon: 'example' },
children: [
{
path: 'enterprise',
name: 'Enterprise',
component: () => import('@/views/enterprise/enterprise'),
meta: { title: '组织信息', icon: 'example', perms: ['enterprise_manage'] }
},
{
path: 'enterprise2',
name: 'Enterprise2',
component: () => import('@/views/enterprise/enterprise'),
meta: { title: '组织信息2', icon: 'example', perms: ['enterprise_manage'] }
},
{
path: 'enterprise/create',
name: 'EnterpriseCreate',
component: () => import('@/views/enterprise/enterprisecreate.vue'),
meta: { title: '新增组织信息', noCache: true, icon: '', perms: ['enterprise_create']},
hidden: true
},
{
path: 'enterprise/update',
name: 'EnterpriseUpdate',
component: () => import('@/views/enterprise/enterpriseupdate.vue'),
meta: { title: '修改组织信息', noCache: true, icon: '', perms: ['enterprise_update'] },
hidden: true
},
]
},
{
path: '/system',
component: Layout,
redirect: '/system/user',
name: 'System',
meta: { title: '系统管理', icon: 'example', perms: ['system_manage'] },
children: [
{
path: 'user',
name: 'User',
component: () => import('@/views/system/user'),
meta: { title: '用户管理', icon: 'user', perms: ['user_manage'] }
},
{
path: 'user/password',
name: 'ChangePassword',
component: () => import('@/views/system/changepassword'),
meta: { title: '修改密码', noCache: true, icon: ''},
hidden: true
},
{
path: 'organization',
name: 'Organization',
component: () => import('@/views/system/organization'),
meta: { title: '部门管理', icon: 'tree', perms: ['org_manage'] }
},
{
path: 'role',
name: 'Role',
component: () => import('@/views/system/role'),
meta: { title: '角色管理', icon: 'lock', perms: ['role_manage'] }
},
{
path: 'position',
name: 'Postion',
component: () => import('@/views/system/position'),
meta: { title: '岗位管理', icon: 'position', perms: ['position_manage'] }
},
{
path: 'dict',
name: 'Dict',
component: () => import('@/views/system/dict'),
meta: { title: '数据字典', icon: 'example', perms: ['dict_manage'] }
},
{
path: 'file',
name: 'File',
component: () => import('@/views/system/file'),
meta: { title: '文件库', icon: 'documentation', perms: ['file_room'] }
},
{
path: 'task',
name: 'Task',
component: () => import('@/views/system/task'),
meta: { title: '定时任务', icon: 'list', perms: ['task_manage'] }
}
]
},
{
path: '/develop',
component: Layout,
redirect: '/develop/perm',
name: 'Develop',
meta: { title: '开发配置', icon: 'example', perms: ['dev_set'] },
children: [
{
path: 'perm',
name: 'Perm',
component: () => import('@/views/system/perm'),
meta: { title: '权限菜单', icon: 'example', perms: ['perm_manage'] }
},
{
path: 'form-gen-link',
component: Layout,
children: [
{
path: 'http://121.36.23.77:8037/',
meta: { title: '表单设计器', icon: 'link', perms: ['dev_form_gen'] }
}
]
},
{
path: 'docs-link',
component: Layout,
children: [
{
path: process.env.VUE_APP_BASE_API + '/docs/',
meta: { title: '接口文档', icon: 'link', perms: ['dev_docs'] }
}
]
},
{
path: 'admin-link',
component: Layout,
children: [
{
path: process.env.VUE_APP_BASE_API + '/admin/',
meta: { title: 'Django后台', icon: 'link', perms: ['dev_admin'] }
}
]
}
]
},
// 404 page must be placed at the end !!!
{ path: '*', redirect: '/404', hidden: true }
]
const createRouter = () => new Router({
// mode: 'history', // require service support
scrollBehavior: () => ({ y: 0 }),
routes: constantRoutes
})
const router = createRouter()
// Detail see: https://github.com/vuejs/vue-router/issues/1234#issuecomment-357941465
export function resetRouter() {
const newRouter = createRouter()
router.matcher = newRouter.matcher // reset router
}
export default router