123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620 |
- import Vue from 'vue'
- import VueRouter from 'vue-router'
- import Cookies from 'js-cookie'
- Vue.use(VueRouter)
- const originalPush = VueRouter.prototype.push
- VueRouter.prototype.push = function push(location) {
- return originalPush.call(this, location).catch(err => err)
- }
- const routes = [
- {
- path: "/route",
- component: () => import('@/utils/model/route.vue'),
- },
- {
- path: "/",
- component: () => import('@/views/index'),
- },
- {
- path:'/login',
- name:'Login',
- meta: {
- title: '系统登录'
- },
- component: () => import("@/views/login/index.vue")
- },
- {
- path: "/agreeConceal",
- name:'agreeConceal',
- meta: {
- title: '用户须知'
- },
- component: () => import('@/views/login/compoments/invite/components/index.vue')
- },
- {
- path: "",
- component: () => import('@/views/layout/index.vue'),
- children: [
- {
- path: '/home',
- name: 'Home',
- meta: {
- title: '首页',
- sign:'home',
- belong:'home'
- },
- component: () => import('@/views/home/index.vue'),
- },
- //专利数据库
- {
- path: '/project',
- name:'Project',
- component:{render(c){return c('router-view')}},
- redirect:'/project',
- children:[
- {
- path:'/',
- meta: {
- title: '专利数据库',
- sign:'project',
- belong:'project'
- },
- component: () => import('@/views/project/index.vue'),
- },
- {
- path: 'patentCollection',
- meta: {
- title: '专利列表',
- sign:'patentCollection',
- belong:'project'
- },
- component: () => import('@/views/project/patentCollection/index.vue')
- },
- // {
- // path: 'folder/:id',
- // meta: {
- // title: '专利文章',
- // // button: [],
- // showProjectName:true
- // },
- // component: () => import('@/views/workspace/folder/articles')
- // },
- ],
- },
- //企业专利数据库
- // {
- // path: '/enterprisePatentDB',
- // name:'enterprisePatentDB',
- // component:{render(c){return c('router-view')}},
- // redirect:'/enterprisePatentDB',
- // children:[
- // {
- // path:'/',
- // meta: {
- // title: '企业专利数据库',
- // },
- // component: () => import('@/views/EnterprisePatentDatabase/index.vue'),
- // },
- // ]
- // },
- // //专利挖掘
- {
- path: '/patentMining',
- name:'patentMining',
- component:{render(c){return c('router-view')}},
- redirect:'/patentMining',
- children:[
- {
- path:'/',
- meta: {
- title: '专利挖掘',
- sign:'patentMining',
- belong:'patentMining'
- },
- component: () => import('@/views/patentMining/index.vue'),
- },
- {
- path:'/details',
- meta: {
- title: '专利挖掘详情',
- sign:'patentMiningDetails',
- belong:'patentMining'
- },
- component: () => import('@/views/patentMining/components/details/index.vue'),
- },
- {
- path:'/excavateTask',
- meta: {
- title: '专利挖掘任务',
- sign:'patentMiningExcavateTask',
- belong:'patentMining'
- },
- component: () => import('@/views/patentMining/components/excavateTask/index.vue'),
- },
- {
- path:'/handleExamine',
- meta: {
- title: '专利挖掘任务详情',
- sign:'patentMiningHandleExamine',
- belong:'patentMining'
- },
- component: () => import('@/views/patentMining/components/handleExamine/index.vue'),
- },
- ]
- },
- // // 产品
- {
- path: '/product',
- name: 'Product',
- component: { render(c) { return c('router-view') } },
- redirect: '/product',
- children:[
- {
- path:'/',
- name:'/',
- meta: {
- title: '产品',
- sign:'product',
- belong:'Product'
- },
- component: () => import('@/views/product/index.vue'),
- },
- {
- path: "/productDetails",
- name:'productDetails',
- meta: {
- title: '详情',
- sign:'productDetails',
- belong:'Product'
- },
- component: () => import('@/views/product/components/details'),
- },
- // {
- // path: "/mindIndex",
- // meta: {
- // title: '可视化',
- // button: [],
- // },
- // component: () => import('@/views/product/components/jsMind'),
- // },
- {
- path: "/chartIndex",
- name:'chartIndex',
- meta: {
- title: '趋势图',
- sign: 'chartIndex',
- belong:'Product'
- },
- component: () => import('@/views/product/components/echarts'),
- },
- {
- path: "/frameworkIndex",
- meta: {
- title: '产品架构',
- sign: 'frameworkIndex',
- belong:'Product'
- },
- component: () => import('@/views/product/components/framework/index.vue'),
-
- },
- {
- path: "/commodity",
- meta: {
- title: '产品商品化专利',
- sign:'commodity',
- belong:'Product'
- },
- component: () => import('@/views/product/components/commodity/index.vue'),
-
- },
- ],
-
- },
- //事件
- {
- path: '/Event',
- name:'Event',
- component:{render(c){return c('router-view')}},
- redirect:'/Event',
- children:[
- {
- path:'/',
- meta: {
- title: '事件',
- sign:'event',
- belong:'Event'
- },
- component: () => import('@/views/event/index.vue'),
- },
- //事件可视化
- {
- path: "/eventVisual",
- name:'eventVisual',
- meta: {
- title: '事件可视化',
- sign:'eventVisual',
- belong:'Event'
- },
- component: () => import('@/views/event/components/details/visualRouter.vue'),
- },
- ],
- },
- //报告
- {
- path: '/AllReport',
- name:'AllReport',
- component:{render(c){return c('router-view')}},
- redirect:'/AllReport',
- children:[
- {
- path:'/',
- meta: {
- title: '报告',
- sign:'report',
- belong:'AllReport'
- },
- component: () => import('@/views/report/index.vue'),
- },
- // //无效分析、第三方意见、稳定性分析
- // {
- // path: '/InvalidIndex',
- // name:"InvalidIndex",
- // meta:{
- // aside: true,
- // showHeader:true,
- // },
- // component:() => import('@/views/report/Invalid/index.vue'),
- // },
- // //FTO风险排查
- // {
- // path: '/FTOIndex',
- // name:"FTOIndex",
- // meta:{
- // aside: true,
- // showHeader:true,
- // },
- // component:() => import('@/views/report/FTO/index.vue'),
- // },
- // //侵权分析
- // {
- // path: '/tortIndex',
- // name:"tortIndex",
- // meta:{
- // aside: true,
- // showHeader:true,
- // },
- // component:() => import('@/views/report/tort/index.vue'),
- // },
- // //回避设计
- // {
- // path: '/avoid',
- // name:"avoid",
- // meta:{
- // aside: true,
- // showHeader:true,
- // },
- // component:() => import('@/views/report/avoid/index.vue'),
- // },
- // //无效分析、第三方意见、稳定性分析报告详情
- // {
- // path: '/rDetails',
- // name:"rDetails",
- // meta:{
- // aside: true,
- // showHeader:true,
- // },
- // component:() => import('@/views/report/reportDetails/index.vue'),
- // },
- // //FTO风险排查、侵权分析报告详情
- // {
- // path: '/FTOrDetails',
- // name:"FTOrDetails",
- // meta:{
- // aside: true,
- // showHeader:true,
- // },
- // component:() => import('@/views/report/FTO/FTOPage/ReportDetails/index.vue'),
- // },
- // //回避设计报告详情
- // {
- // path: '/avoidAside',
- // name:"avoidAside",
- // meta:{
- // aside: true,
- // showHeader:true,
- // },
- // component:() => import('@/views/report/avoid/avoidAsid/index.vue'),
- // },
- // //无效应对报告详情
- // {
- // path:'/InvalidResponse',
- // name:'InvalidResponse',
- // meta:{
- // title:'无效应对',
- // aside:true,
- // showHeader:true,
- // },
- // component:() => import('@/views/report/InvalidResponse/index'),
- // },
- // //添加无效证据和理由
- // {
- // path:'/invalidIdexRouter',
- // name:'invalidIdexRouter',
- // meta:{
- // title:'无效证据和理由',
- // aside:true,
- // showHeader:true,
- // },
- // component:() => import('@/views/report/InvalidResponse/components/invalidIdexRouter.vue'),
- // },
- // //导入证据文献
- // {
- // path:'/evidenceAndRequestIndex',
- // name:'evidenceAndRequestIndex',
- // meta:{
- // title:'证据详情',
- // aside:true,
- // showHeader:true,
- // },
- // component:() => import('@/views/report/InvalidResponse/components/evidenceAndRequestRouter.vue'),
- // },
- // //对比任务
- // {
- // path: '/SelectedPatent',
- // name:"SelectedPatent",
- // meta:{
- // aside:true
- // },
- // component:() => import('@/views/report/reportDetails/components/SelectedPatent.vue'),
- // },
- // // 任务分配
- // {
- // path: '/AssignTasks',
- // name:"/AssignTasks",
- // meta:{
- // aside:true
- // },
- // component:() => import('@/views/report/Invalid/InvalidPage/AssignTasks.vue'),
- // },
- // //添加对比文件
- // {
- // path:'/addPatentList',
- // name:'/addPatentList',
- // meta:{
- // title:'添加对比文件',
- // aside:true,
- // showHeader:true,
- // // hiddenHeader:true
- // },
- // component:() => import('@/views/report/components/addPatentList'),
- // },
- // //查看单个专利详情
- // {
- // path:'/patentDetails',
- // name:"patentDetails",
- // meta:{
- // aside:true
- // },
- // component:() => import('@/views/components/common/PatentDetails')
- // },
- // //无效应对证据文献详情
- // {
- // path:'/checkFileDetails/:key',
- // name:'checkFileDetails/:key',
- // meta:{
- // title:'证据文献详情',
- // aside:true,
- // showHeader:true,
- // },
- // component:() => import('@/views/report/InvalidResponse/components/FileDetails/index.vue'),
- // },
- // //报告任务清单
- // {
- // path:'/rTaskList',
- // name:'rTaskList',
- // meta:{
- // title:'任务',
- // aside:true,
- // showHeader:true,
- // },
- // component: () => import('@/views/report/task/index.vue'),
- // },
- // // },
- ],
- },
- //场景可视化
- {
- path: '/visual',
- name:'visual',
- meta: {
- title: '场景可视化',
- sign:'visual',
- belong:'visual'
- },
- component: () => import('@/views/visual')
- },
- {
- path: '/visual/:title',
- name:'flowPath',
- meta: {
- sign:'flowPath',
- title: '可视化平台',
- belong:'visual'
- },
- component: () => import('@/views/visual/title/index.vue')
- },
- //图表分析
- // {
- // path: "/analyse",
- // component:{render(c){return c('router-view')}},
- // redirect:'/analyse',
- // children: [
- // {
- // path: "custom",
- // component: () => import('@/views/analyse/custom'),
- // meta: {
- // title: '自定义分析列表'
- // }
- // },
- // {
- // path: "report",
- // component: () => import('@/views/analyse/report/create'),
- // meta: {
- // title: '一键生成报告'
- // }
- // },
- // ]
- // },
-
- // {
- // path: "custom",
- // component: () => import('@/views/analyse/custom'),
- // meta: {
- // title: '自定义分析列表'
- // }
- // },
- // {
- // path: "report",
- // component: () => import('@/views/analyse/report/create'),
- // meta: {
- // title: '一键生成报告'
- // }
- // },
- //查看文件
- {
- path:'/checkFile',
- name:'/checkFile',
- meta:{
- aside:true,
- sign:'checkFile',
- },
- component:() => import('@/views/components/view/checkFile.vue'),
- },
- //excel导入
- {
- path: '/import',
- name:"import",
- meta:{
- title: 'excel导入',
- sign:'import'
- },
- component:() => import('@/views/components/import/excelImport'),
- },
- //专利号导入
- {
- path: '/PatentNoImport',
- name:"PatentNoImport",
- meta:{
- title: '专利号导入',
- sign:'PatentNoImport'
- },
- component:() => import('@/views/components/import/PatentNoImport'),
- },
- //检索导入
- {
- path: '/conditionImport',
- name:"conditionImport",
- meta:{
- title: '专利检索',
- sign:'conditionImport',
- belong:'conditionImport'
- },
- component:() => import('@/views/components/import/conditionImport'),
- },
- // //检索结果
- // {
- // path: "/searchResult",
- // meta: {
- // title: '检索结果',
- // // button: [],
- // },
- // component: () => import('@/views/components/import/conditionImport/searchResultIndex.vue'),
- // },
- // //检索专利详情
- // {
- // path: "/search/patentDetail",
- // meta: {
- // title: '专利详情',
- // // button: [],
- // },
- // component: () => import('@/views/components/import/conditionImport/patentDetails/patentIndex.vue'),
- // },
- //任务清单
- // {
- // path: "/taskList",
- // meta: {
- // title: '任务清单',
- // button: [],
- // },
- // component: () => import('@/views/task/taskIndex.vue'),
- // },
- // //标注库
- // {
- // path: "/indicia",
- // meta: {
- // title: '标注库',
- // button: [],
- // },
- // component: () => import('@/views/indicia'),
- // },
- // //检索组件
- // {
- // path: "/search",
- // meta: {
- // title: '检索',
- // button: [],
- // },
- // component: () => import('@/views/components/common/retrieval'),
- // },
-
- ]
- },
- ]
- const router = new VueRouter({
- mode: 'history',
- base: '/',
- routes
- })
- router.beforeEach((to, from, next) => {
- if (to.path === '/login'||to.path==='/' || to.path == '/agreeConceal'){
- if (to.meta.title) {
- document.title = to.meta.title;
- }
- next()
- }
- else if(to.meta.allowPath){
- if (to.meta.title) {
- document.title = to.meta.title;
- }
- next()
- }
- else{
- const tokenStr = Cookies.get('token')
- switch(tokenStr){
- case undefined:
- if (to.meta.title) {
- document.title = to.meta.title;
- }
- next({name:'Login',params:{ redirect:to.fullPath}})
- break
- default:
- if (to.meta.title) {
- document.title = to.meta.title;
- }
- next()
- break;
- }
- }
- })
- router.afterEach((to, from) => {
- });
- export default router
|