363 lines
11 KiB
JavaScript
363 lines
11 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 : {
|
||
roles: ['admin','editor'] control the page roles (you can set multiple roles)
|
||
title: 'title' the name show in sidebar and breadcrumb (recommend set)
|
||
icon: 'svg-name'/'el-icon-x' 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): 菜单内容是前端写死
|
||
动态路由: 菜单内容是动态获取
|
||
*/
|
||
// 静态路由
|
||
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/data-dashboard'),
|
||
meta: { title: '首页', icon: 'dashboard', affix: true }
|
||
}]
|
||
},
|
||
|
||
{
|
||
path: '/sales',
|
||
component: Layout,
|
||
redirect: '/sales/index',
|
||
name: 'SalesRoot',
|
||
meta: { title: '销售管理', icon: 'el-icon-s-custom' },
|
||
children: [
|
||
{
|
||
path: 'index',
|
||
name: 'Sales',
|
||
component: () => import('@/views/sales/index'),
|
||
meta: { title: '销售管理', icon: 'el-icon-s-custom' }
|
||
},
|
||
{
|
||
path: 'audio',
|
||
name: 'SalesAudio',
|
||
component: () => import('@/views/audio/index'),
|
||
meta: { title: '录音管理', icon: 'el-icon-microphone' }
|
||
},
|
||
{
|
||
path: 'dimension-analysis',
|
||
name: 'DimensionAnalysis',
|
||
component: () => import('@/views/sales/dimension-analysis'),
|
||
meta: { title: '维度分析', icon: 'el-icon-data-analysis' }
|
||
},
|
||
{
|
||
path: 'intelligent-pickup',
|
||
name: 'IntelligentPickup',
|
||
component: () => import('@/views/sales/intelligent-pickup'),
|
||
meta: { title: '智能捡漏', icon: 'el-icon-magic-stick' }
|
||
}
|
||
]
|
||
},
|
||
|
||
{
|
||
path: '/project',
|
||
component: Layout,
|
||
children: [
|
||
{
|
||
path: 'index',
|
||
name: 'Project',
|
||
component: () => import('@/views/project/index'),
|
||
meta: { title: '项目管理', icon: 'el-icon-s-cooperation' }
|
||
}
|
||
]
|
||
},
|
||
|
||
{
|
||
path: '/dealership',
|
||
component: Layout,
|
||
redirect: '/dealership/index',
|
||
name: 'Dealership',
|
||
meta: {
|
||
title: '分支机构',
|
||
icon: 'el-icon-s-shop'
|
||
},
|
||
children: [
|
||
{
|
||
path: 'index',
|
||
name: 'DealershipIndex',
|
||
component: () => import('@/views/dealership/index'),
|
||
meta: { title: '分支机构', icon: 'el-icon-s-shop' }
|
||
},
|
||
{
|
||
path: 'brand-analysis',
|
||
name: 'BrandAnalysis',
|
||
component: () => import('@/views/dealership/brand-analysis'),
|
||
meta: { title: '品牌分析', icon: 'el-icon-data-analysis' }
|
||
},
|
||
{
|
||
path: 'customer-profile',
|
||
name: 'CustomerProfile',
|
||
component: () => import('@/views/dealership/customer-profile'),
|
||
meta: { title: '客户画像', icon: 'el-icon-user-solid' }
|
||
}
|
||
]
|
||
},
|
||
|
||
{
|
||
path: '/device',
|
||
component: Layout,
|
||
children: [
|
||
{
|
||
path: 'index',
|
||
name: 'Device',
|
||
component: () => import('@/views/device/index'),
|
||
meta: { title: '设备管理', icon: 'el-icon-mobile-phone' }
|
||
}
|
||
]
|
||
},
|
||
|
||
{
|
||
path: '/customer',
|
||
component: Layout,
|
||
children: [
|
||
{
|
||
path: 'index',
|
||
name: 'Customer',
|
||
component: () => import('@/views/customer/index'),
|
||
meta: { title: '客户管理', icon: 'el-icon-user' }
|
||
}
|
||
]
|
||
},
|
||
{
|
||
path: '/knowledge',
|
||
component: Layout,
|
||
redirect: '/knowledge/index',
|
||
name: 'Knowledge',
|
||
meta: {
|
||
title: '知识中心',
|
||
icon: 'el-icon-document'
|
||
},
|
||
children: [
|
||
{
|
||
path: 'index',
|
||
name: 'KnowledgeCenter',
|
||
component: () => import('@/views/knowledge/index'),
|
||
meta: { title: '知识中心', icon: 'el-icon-document' }
|
||
},
|
||
{
|
||
path: 'dialogue-mining',
|
||
name: 'DialogueMining',
|
||
component: () => import('@/views/knowledge/dialogue-mining'),
|
||
meta: { title: '对话挖掘', icon: 'el-icon-chat-dot-round' }
|
||
},
|
||
{
|
||
path: 'knowledge-base',
|
||
name: 'KnowledgeBase',
|
||
component: () => import('@/views/knowledge/knowledge-base'),
|
||
meta: { title: '知识库', icon: 'el-icon-document' }
|
||
},
|
||
{
|
||
path: 'terminology',
|
||
name: 'Terminology',
|
||
component: () => import('@/views/knowledge/terminology'),
|
||
meta: { title: '汽车术语库', icon: 'el-icon-collection' }
|
||
}
|
||
]
|
||
},
|
||
|
||
{
|
||
path: '/audio-statistics',
|
||
component: Layout,
|
||
redirect: '/audio-statistics/index',
|
||
name: 'AudioStatisticsRoot',
|
||
meta: { title: '音频管理', icon: 'el-icon-data-analysis' },
|
||
children: [
|
||
{
|
||
path: 'index',
|
||
name: 'AudioStatistics',
|
||
component: () => import('@/views/audio-statistics/index'),
|
||
meta: { title: '音频统计', icon: 'el-icon-data-analysis' }
|
||
},
|
||
{
|
||
path: 'audio-generation',
|
||
name: 'AudioGeneration',
|
||
component: () => import('@/views/audio-statistics/audio-generation'),
|
||
meta: { title: '音频列表', icon: 'el-icon-microphone' }
|
||
}
|
||
]
|
||
},
|
||
|
||
{
|
||
path: '/video',
|
||
component: Layout,
|
||
redirect: '/video/index',
|
||
name: 'VideoRoot',
|
||
meta: { title: '视频管理', icon: 'el-icon-video-camera' },
|
||
children: [
|
||
{
|
||
path: 'index',
|
||
name: 'Video',
|
||
component: () => import('@/views/video/index'),
|
||
meta: { title: '视频管理', icon: 'el-icon-video-camera' }
|
||
},
|
||
{
|
||
path: 'face-detect',
|
||
name: 'FaceDetect',
|
||
component: () => import('@/views/video/face-detect'),
|
||
meta: { title: '人像检测列表', icon: 'el-icon-user-solid' }
|
||
},
|
||
{
|
||
path: 'detect-template',
|
||
name: 'DetectTemplate',
|
||
component: () => import('@/views/video/detect-template'),
|
||
meta: { title: '检测模板列表', icon: 'el-icon-document' }
|
||
},
|
||
{
|
||
path: 'video-synthesis',
|
||
name: 'VideoSynthesis',
|
||
component: () => import('@/views/video/video-synthesis'),
|
||
meta: { title: '特写视频列表', icon: 'el-icon-video-camera-solid' }
|
||
},
|
||
{
|
||
path: 'avatar-synthesis',
|
||
name: 'AvatarSynthesis',
|
||
component: () => import('@/views/video/avatar-synthesis'),
|
||
meta: { title: '特写视频生成', icon: 'el-icon-user-solid' }
|
||
},
|
||
{
|
||
path: 'dance-video-generation',
|
||
name: 'DanceVideoGeneration',
|
||
component: () => import('@/views/video/dance-video-generation'),
|
||
meta: { title: '舞动视频生成', icon: 'el-icon-video-camera' }
|
||
},
|
||
{
|
||
path: 'image-video-analysis',
|
||
name: 'ImageVideoAnalysis',
|
||
component: () => import('@/views/video/image-video-analysis'),
|
||
meta: { title: '图片视频分析列表', icon: 'el-icon-picture' }
|
||
}
|
||
]
|
||
},
|
||
|
||
{
|
||
path: '/text-model',
|
||
component: Layout,
|
||
redirect: '/text-model/index',
|
||
name: 'TextModelRoot',
|
||
meta: { title: '文本模型', icon: 'el-icon-document' },
|
||
children: [
|
||
{
|
||
path: 'index',
|
||
name: 'TextModel',
|
||
component: () => import('@/views/text-model/index'),
|
||
meta: { title: '文本模型', icon: 'el-icon-document' }
|
||
},
|
||
{
|
||
path: 'translation',
|
||
name: 'Translation',
|
||
component: () => import('@/views/text-model/translation'),
|
||
meta: { title: '翻译模型', icon: 'el-icon-translation' }
|
||
},
|
||
{
|
||
path: 'legal-model',
|
||
name: 'LegalModel',
|
||
component: () => import('@/views/text-model/legal-model'),
|
||
meta: { title: '法律模型', icon: 'el-icon-scale' }
|
||
}
|
||
]
|
||
},
|
||
|
||
{
|
||
path: '/image-model',
|
||
component: Layout,
|
||
redirect: '/image-model/background-model',
|
||
name: 'ImageModelRoot',
|
||
meta: { title: '图像模型', icon: 'el-icon-picture' },
|
||
children: [
|
||
{
|
||
path: 'image-list',
|
||
name: 'ImageList',
|
||
component: () => import('@/views/image-model/image-list'),
|
||
meta: { title: '图像管理列表', icon: 'el-icon-picture' }
|
||
},
|
||
{
|
||
path: 'poster-generation',
|
||
name: 'PosterGeneration',
|
||
component: () => import('@/views/image-model/poster-generation'),
|
||
meta: { title: '海报生成', icon: 'el-icon-picture-outline-round' }
|
||
},
|
||
{
|
||
path: 'remove-watermark',
|
||
name: 'RemoveWatermark',
|
||
component: () => import('@/views/image-model/remove-watermark'),
|
||
meta: { title: '去除水印', icon: 'el-icon-brush' }
|
||
},
|
||
{
|
||
path: 'background-model',
|
||
name: 'BackgroundModel',
|
||
component: () => import('@/views/image-model/background-model'),
|
||
meta: { title: '图像背景模型', icon: 'el-icon-picture-outline' }
|
||
},
|
||
{
|
||
path: 'virtual-model',
|
||
name: 'VirtualModel',
|
||
component: () => import('@/views/image-model/virtual-model'),
|
||
meta: { title: '虚拟模特儿模型', icon: 'el-icon-user' }
|
||
}
|
||
]
|
||
},
|
||
|
||
// 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 const asyncRoutes = []
|
||
|
||
export default router
|