You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
370 lines
8.3 KiB
370 lines
8.3 KiB
import Vue from 'vue'
|
|
import Router from 'vue-router'
|
|
|
|
/* Layout */
|
|
import Layout from '@/layout'
|
|
|
|
Vue.use(Router)
|
|
|
|
/**
|
|
* constantRoutes
|
|
*/
|
|
export const constantRoutes = [
|
|
{
|
|
path: '/redirect',
|
|
component: Layout,
|
|
hidden: true,
|
|
children: [
|
|
{
|
|
path: '/redirect/:path(.*)',
|
|
component: () => import('@/views/redirect/index'),
|
|
},
|
|
],
|
|
},
|
|
{
|
|
path: '/404',
|
|
component: () => import('@/views/404'),
|
|
hidden: true,
|
|
},
|
|
// 仪表板
|
|
{
|
|
path: '/dashboard',
|
|
component: Layout,
|
|
redirect: '/dashboard/index',
|
|
children: [
|
|
// 首页
|
|
{
|
|
path: 'index',
|
|
name: 'dashboard-index',
|
|
meta: {
|
|
title: '概况',
|
|
affix: true,
|
|
},
|
|
component: () => import('@/views/dashboard/index'),
|
|
},
|
|
],
|
|
},
|
|
{
|
|
path: '/dashboard/:id',
|
|
name: 'dashboard-detail',
|
|
hidden: true,
|
|
component: () => import('@/views/bi/dashboard'),
|
|
},
|
|
// 嵌入式分析
|
|
{
|
|
path: '/nests',
|
|
component: Layout,
|
|
redirect: '/nests/index',
|
|
children: [],
|
|
},
|
|
// 自定义报表
|
|
{
|
|
path: '/self',
|
|
component: Layout,
|
|
redirect: '/self/index',
|
|
children: [
|
|
// 首页
|
|
{
|
|
path: 'index',
|
|
name: 'self-index',
|
|
meta: {
|
|
title: '概况',
|
|
affix: true,
|
|
},
|
|
component: () => import('@/views/bi/index'),
|
|
},
|
|
],
|
|
},
|
|
// 交互式分析
|
|
{
|
|
path: '/interactive',
|
|
component: Layout,
|
|
redirect: '/interactive/index',
|
|
children: [
|
|
{
|
|
path: 'index',
|
|
name: 'interactive-index',
|
|
component: () => import('@/views/interactive/index'),
|
|
},
|
|
],
|
|
},
|
|
{
|
|
path: '/report',
|
|
name: 'report',
|
|
hidden: true,
|
|
component: () => import('@/views/bi/customReport'),
|
|
},
|
|
{
|
|
path: '/dynamicTab',
|
|
name: 'dynamicTab',
|
|
component: () => import('@/views/bi/dynamicTab'),
|
|
},
|
|
{
|
|
path: '/tableEditor',
|
|
name: 'tableEditor',
|
|
component: () => import('@/views/bi/tableEditor'),
|
|
},
|
|
{
|
|
path: '/preview',
|
|
name: 'preview',
|
|
component: () => import('@/views/preview/main'),
|
|
},
|
|
{
|
|
path: '/preview/dashboard',
|
|
name: 'preview-dashboard',
|
|
component: () => import('@/views/preview/dashboard'),
|
|
},
|
|
{
|
|
path: '/iframe',
|
|
component: Layout,
|
|
hidden: true,
|
|
redirect: '/iframe/index', // you can set roles in root nav
|
|
meta: {
|
|
title: 'iframe',
|
|
icon: 'people',
|
|
},
|
|
children: [
|
|
{
|
|
path: 'urlPath',
|
|
component: () => import('@/views/iframe/index'),
|
|
name: 'WebIFrame',
|
|
meta: {
|
|
title: 'iframe',
|
|
icon: 'people',
|
|
},
|
|
},
|
|
],
|
|
},
|
|
// 数据准备
|
|
{
|
|
path: '/datapre',
|
|
component: Layout,
|
|
redirect: '/datapre/dataset',
|
|
children: [
|
|
// 数据集
|
|
{
|
|
path: 'dataset',
|
|
name: 'datapre-dataset',
|
|
meta: {
|
|
title: '首页',
|
|
},
|
|
component: () => import('@/views/datapre/dataset/index'),
|
|
},
|
|
{
|
|
path: 'datapreMain',
|
|
name: 'datapreMain-index',
|
|
meta: {
|
|
title: '首页',
|
|
},
|
|
component: () => import('@/views/datapre/dataset/datapreMain'),
|
|
},
|
|
{
|
|
path: 'addDatapre',
|
|
name: 'addDatapre-index',
|
|
meta: {
|
|
title: '首页',
|
|
},
|
|
component: () => import('@/views/datapre/dataset/addDatapre'),
|
|
},
|
|
{
|
|
path: 'addApiDatapre',
|
|
name: 'addDatapre-api-index',
|
|
meta: {
|
|
title: '首页',
|
|
},
|
|
component: () => import('@/views/datapre/dataset/addApiDatapre'),
|
|
},
|
|
// 数据源
|
|
{
|
|
path: 'datasource',
|
|
name: 'datapre-datasource',
|
|
meta: {
|
|
title: '首页',
|
|
},
|
|
component: () => import('@/views/datapre/datasource/index'),
|
|
},
|
|
{
|
|
path: 'datasourceMain',
|
|
name: 'datasourceMain-index',
|
|
meta: {
|
|
title: '数据源列表页',
|
|
},
|
|
component: () => import('@/views/datapre/datasource/datasourceMain'),
|
|
}, // 指标管理
|
|
{
|
|
path: 'quota',
|
|
name: 'datapre-quota',
|
|
meta: {
|
|
title: '指标管理首页',
|
|
},
|
|
component: () => import('@/views/datapre/quota/quotaMain'),
|
|
}, // 数据字典
|
|
{
|
|
path: 'meta',
|
|
name: 'datapre-enum',
|
|
meta: {
|
|
title: '元数据管理首页',
|
|
},
|
|
component: () => import('@/views/datapre/meta/metaMain'),
|
|
}, // 标签管理
|
|
{
|
|
path: 'tag',
|
|
name: 'datapre-tag',
|
|
meta: {
|
|
title: '标签管理首页',
|
|
},
|
|
component: () => import('@/views/datapre/tag/tagMain'),
|
|
},
|
|
],
|
|
},
|
|
// 数据集成
|
|
{
|
|
path: '/datacollect',
|
|
component: Layout,
|
|
redirect: '/datacollect/datasource',
|
|
children: [
|
|
// 数据源
|
|
{
|
|
path: 'datasource',
|
|
name: 'datacollect-datasource',
|
|
meta: {
|
|
title: '数据源',
|
|
},
|
|
component: () => import('@/views/datacollect/datasource/datasourceMain'),
|
|
},
|
|
// 数据集成
|
|
{
|
|
path: 'collect',
|
|
name: 'datacollect-collect',
|
|
meta: {
|
|
title: '数据集成',
|
|
},
|
|
component: () => import('@/views/datacollect/collect/collectMain'),
|
|
},
|
|
// 首页
|
|
{
|
|
path: 'collect-new',
|
|
name: 'datacollect-collect-new',
|
|
meta: {
|
|
title: '首页',
|
|
},
|
|
component: () => import('@/views/datacollect/collect/collectMain_new'),
|
|
},
|
|
],
|
|
},
|
|
// 数据服务
|
|
{
|
|
path: '/dataservice',
|
|
component: Layout,
|
|
redirect: '/dataservice/dataservice-list',
|
|
children: [
|
|
// 服务列表
|
|
{
|
|
path: 'dataservice-list',
|
|
name: 'dataservice-list',
|
|
meta: {
|
|
title: '服务列表',
|
|
},
|
|
component: () => import('@/views/dataservice/list/dataserviceList'),
|
|
},
|
|
// 服务监控
|
|
{
|
|
path: 'dataservice-monitor',
|
|
name: '/dataservice-monitor',
|
|
meta: {
|
|
title: '服务监控',
|
|
},
|
|
component: () => import('@/views/dataservice/monitor/dataserviceMonitor'),
|
|
},
|
|
],
|
|
},
|
|
// 管理系统
|
|
{
|
|
path: '/system',
|
|
component: Layout,
|
|
redirect: '/system/system-user',
|
|
children: [
|
|
// 用户管理
|
|
{
|
|
path: 'system-user',
|
|
name: '/system-user',
|
|
meta: {
|
|
title: '用户管理',
|
|
},
|
|
component: () => import('@/views/system/user/userList'),
|
|
},
|
|
// 角色管理
|
|
{
|
|
path: 'system-role',
|
|
name: '/system-role',
|
|
meta: {
|
|
title: '角色管理',
|
|
},
|
|
component: () => import('@/views/system/role/roleList'),
|
|
},
|
|
// 权限管理
|
|
{
|
|
path: 'system-authority',
|
|
name: '/system-authority',
|
|
meta: {
|
|
title: '权限管理',
|
|
},
|
|
component: () => import('@/views/system/authority/authorityList'),
|
|
},
|
|
// 数据集管理
|
|
{
|
|
path: 'system-dataset',
|
|
name: '/system-dataset',
|
|
meta: {
|
|
title: '数据集管理',
|
|
},
|
|
component: () => import('@/views/system/dataset/datasetList'),
|
|
},
|
|
// 报表管理
|
|
{
|
|
path: 'system-report',
|
|
name: '/system-report',
|
|
meta: {
|
|
title: '报表管理',
|
|
},
|
|
component: () => import('@/views/system/report/reportList'),
|
|
},
|
|
// 报表监控
|
|
{
|
|
path: 'system-monitor',
|
|
name: '/system-monitor',
|
|
meta: {
|
|
title: '报表监控',
|
|
},
|
|
component: () => import('@/views/system/monitor/monitor'),
|
|
},
|
|
],
|
|
},
|
|
// 404 page must be placed at the end !!!
|
|
{
|
|
path: '*',
|
|
redirect: (to) => {
|
|
console.trace(to)
|
|
return { path: '/404' }
|
|
},
|
|
hidden: true,
|
|
},
|
|
]
|
|
|
|
const createRouter = () =>
|
|
new Router({
|
|
// mode: 'history', // require service support
|
|
base: `${process.env.VUE_APP_ROUTER_BASE || ''}/linkbi`,
|
|
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
|
|
|