index.js 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620
  1. import Vue from 'vue'
  2. import VueRouter from 'vue-router'
  3. import Cookies from 'js-cookie'
  4. Vue.use(VueRouter)
  5. const originalPush = VueRouter.prototype.push
  6. VueRouter.prototype.push = function push(location) {
  7. return originalPush.call(this, location).catch(err => err)
  8. }
  9. const routes = [
  10. {
  11. path: "/route",
  12. component: () => import('@/utils/model/route.vue'),
  13. },
  14. {
  15. path: "/",
  16. component: () => import('@/views/index'),
  17. },
  18. {
  19. path:'/login',
  20. name:'Login',
  21. meta: {
  22. title: '系统登录'
  23. },
  24. component: () => import("@/views/login/index.vue")
  25. },
  26. {
  27. path: "/agreeConceal",
  28. name:'agreeConceal',
  29. meta: {
  30. title: '用户须知'
  31. },
  32. component: () => import('@/views/login/compoments/invite/components/index.vue')
  33. },
  34. {
  35. path: "",
  36. component: () => import('@/views/layout/index.vue'),
  37. children: [
  38. {
  39. path: '/home',
  40. name: 'Home',
  41. meta: {
  42. title: '首页',
  43. sign:'home',
  44. belong:'home'
  45. },
  46. component: () => import('@/views/home/index.vue'),
  47. },
  48. //专利数据库
  49. {
  50. path: '/project',
  51. name:'Project',
  52. component:{render(c){return c('router-view')}},
  53. redirect:'/project',
  54. children:[
  55. {
  56. path:'/',
  57. meta: {
  58. title: '专利数据库',
  59. sign:'project',
  60. belong:'project'
  61. },
  62. component: () => import('@/views/project/index.vue'),
  63. },
  64. {
  65. path: 'patentCollection',
  66. meta: {
  67. title: '专利列表',
  68. sign:'patentCollection',
  69. belong:'project'
  70. },
  71. component: () => import('@/views/project/patentCollection/index.vue')
  72. },
  73. // {
  74. // path: 'folder/:id',
  75. // meta: {
  76. // title: '专利文章',
  77. // // button: [],
  78. // showProjectName:true
  79. // },
  80. // component: () => import('@/views/workspace/folder/articles')
  81. // },
  82. ],
  83. },
  84. //企业专利数据库
  85. // {
  86. // path: '/enterprisePatentDB',
  87. // name:'enterprisePatentDB',
  88. // component:{render(c){return c('router-view')}},
  89. // redirect:'/enterprisePatentDB',
  90. // children:[
  91. // {
  92. // path:'/',
  93. // meta: {
  94. // title: '企业专利数据库',
  95. // },
  96. // component: () => import('@/views/EnterprisePatentDatabase/index.vue'),
  97. // },
  98. // ]
  99. // },
  100. // //专利挖掘
  101. {
  102. path: '/patentMining',
  103. name:'patentMining',
  104. component:{render(c){return c('router-view')}},
  105. redirect:'/patentMining',
  106. children:[
  107. {
  108. path:'/',
  109. meta: {
  110. title: '专利挖掘',
  111. sign:'patentMining',
  112. belong:'patentMining'
  113. },
  114. component: () => import('@/views/patentMining/index.vue'),
  115. },
  116. {
  117. path:'/details',
  118. meta: {
  119. title: '专利挖掘详情',
  120. sign:'patentMiningDetails',
  121. belong:'patentMining'
  122. },
  123. component: () => import('@/views/patentMining/components/details/index.vue'),
  124. },
  125. {
  126. path:'/excavateTask',
  127. meta: {
  128. title: '专利挖掘任务',
  129. sign:'patentMiningExcavateTask',
  130. belong:'patentMining'
  131. },
  132. component: () => import('@/views/patentMining/components/excavateTask/index.vue'),
  133. },
  134. {
  135. path:'/handleExamine',
  136. meta: {
  137. title: '专利挖掘任务详情',
  138. sign:'patentMiningHandleExamine',
  139. belong:'patentMining'
  140. },
  141. component: () => import('@/views/patentMining/components/handleExamine/index.vue'),
  142. },
  143. ]
  144. },
  145. // // 产品
  146. {
  147. path: '/product',
  148. name: 'Product',
  149. component: { render(c) { return c('router-view') } },
  150. redirect: '/product',
  151. children:[
  152. {
  153. path:'/',
  154. name:'/',
  155. meta: {
  156. title: '产品',
  157. sign:'product',
  158. belong:'Product'
  159. },
  160. component: () => import('@/views/product/index.vue'),
  161. },
  162. {
  163. path: "/productDetails",
  164. name:'productDetails',
  165. meta: {
  166. title: '详情',
  167. sign:'productDetails',
  168. belong:'Product'
  169. },
  170. component: () => import('@/views/product/components/details'),
  171. },
  172. // {
  173. // path: "/mindIndex",
  174. // meta: {
  175. // title: '可视化',
  176. // button: [],
  177. // },
  178. // component: () => import('@/views/product/components/jsMind'),
  179. // },
  180. {
  181. path: "/chartIndex",
  182. name:'chartIndex',
  183. meta: {
  184. title: '趋势图',
  185. sign: 'chartIndex',
  186. belong:'Product'
  187. },
  188. component: () => import('@/views/product/components/echarts'),
  189. },
  190. {
  191. path: "/frameworkIndex",
  192. meta: {
  193. title: '产品架构',
  194. sign: 'frameworkIndex',
  195. belong:'Product'
  196. },
  197. component: () => import('@/views/product/components/framework/index.vue'),
  198. },
  199. {
  200. path: "/commodity",
  201. meta: {
  202. title: '产品商品化专利',
  203. sign:'commodity',
  204. belong:'Product'
  205. },
  206. component: () => import('@/views/product/components/commodity/index.vue'),
  207. },
  208. ],
  209. },
  210. //事件
  211. {
  212. path: '/Event',
  213. name:'Event',
  214. component:{render(c){return c('router-view')}},
  215. redirect:'/Event',
  216. children:[
  217. {
  218. path:'/',
  219. meta: {
  220. title: '事件',
  221. sign:'event',
  222. belong:'Event'
  223. },
  224. component: () => import('@/views/event/index.vue'),
  225. },
  226. //事件可视化
  227. {
  228. path: "/eventVisual",
  229. name:'eventVisual',
  230. meta: {
  231. title: '事件可视化',
  232. sign:'eventVisual',
  233. belong:'Event'
  234. },
  235. component: () => import('@/views/event/components/details/visualRouter.vue'),
  236. },
  237. ],
  238. },
  239. //报告
  240. {
  241. path: '/AllReport',
  242. name:'AllReport',
  243. component:{render(c){return c('router-view')}},
  244. redirect:'/AllReport',
  245. children:[
  246. {
  247. path:'/',
  248. meta: {
  249. title: '报告',
  250. sign:'report',
  251. belong:'AllReport'
  252. },
  253. component: () => import('@/views/report/index.vue'),
  254. },
  255. // //无效分析、第三方意见、稳定性分析
  256. // {
  257. // path: '/InvalidIndex',
  258. // name:"InvalidIndex",
  259. // meta:{
  260. // aside: true,
  261. // showHeader:true,
  262. // },
  263. // component:() => import('@/views/report/Invalid/index.vue'),
  264. // },
  265. // //FTO风险排查
  266. // {
  267. // path: '/FTOIndex',
  268. // name:"FTOIndex",
  269. // meta:{
  270. // aside: true,
  271. // showHeader:true,
  272. // },
  273. // component:() => import('@/views/report/FTO/index.vue'),
  274. // },
  275. // //侵权分析
  276. // {
  277. // path: '/tortIndex',
  278. // name:"tortIndex",
  279. // meta:{
  280. // aside: true,
  281. // showHeader:true,
  282. // },
  283. // component:() => import('@/views/report/tort/index.vue'),
  284. // },
  285. // //回避设计
  286. // {
  287. // path: '/avoid',
  288. // name:"avoid",
  289. // meta:{
  290. // aside: true,
  291. // showHeader:true,
  292. // },
  293. // component:() => import('@/views/report/avoid/index.vue'),
  294. // },
  295. // //无效分析、第三方意见、稳定性分析报告详情
  296. // {
  297. // path: '/rDetails',
  298. // name:"rDetails",
  299. // meta:{
  300. // aside: true,
  301. // showHeader:true,
  302. // },
  303. // component:() => import('@/views/report/reportDetails/index.vue'),
  304. // },
  305. // //FTO风险排查、侵权分析报告详情
  306. // {
  307. // path: '/FTOrDetails',
  308. // name:"FTOrDetails",
  309. // meta:{
  310. // aside: true,
  311. // showHeader:true,
  312. // },
  313. // component:() => import('@/views/report/FTO/FTOPage/ReportDetails/index.vue'),
  314. // },
  315. // //回避设计报告详情
  316. // {
  317. // path: '/avoidAside',
  318. // name:"avoidAside",
  319. // meta:{
  320. // aside: true,
  321. // showHeader:true,
  322. // },
  323. // component:() => import('@/views/report/avoid/avoidAsid/index.vue'),
  324. // },
  325. // //无效应对报告详情
  326. // {
  327. // path:'/InvalidResponse',
  328. // name:'InvalidResponse',
  329. // meta:{
  330. // title:'无效应对',
  331. // aside:true,
  332. // showHeader:true,
  333. // },
  334. // component:() => import('@/views/report/InvalidResponse/index'),
  335. // },
  336. // //添加无效证据和理由
  337. // {
  338. // path:'/invalidIdexRouter',
  339. // name:'invalidIdexRouter',
  340. // meta:{
  341. // title:'无效证据和理由',
  342. // aside:true,
  343. // showHeader:true,
  344. // },
  345. // component:() => import('@/views/report/InvalidResponse/components/invalidIdexRouter.vue'),
  346. // },
  347. // //导入证据文献
  348. // {
  349. // path:'/evidenceAndRequestIndex',
  350. // name:'evidenceAndRequestIndex',
  351. // meta:{
  352. // title:'证据详情',
  353. // aside:true,
  354. // showHeader:true,
  355. // },
  356. // component:() => import('@/views/report/InvalidResponse/components/evidenceAndRequestRouter.vue'),
  357. // },
  358. // //对比任务
  359. // {
  360. // path: '/SelectedPatent',
  361. // name:"SelectedPatent",
  362. // meta:{
  363. // aside:true
  364. // },
  365. // component:() => import('@/views/report/reportDetails/components/SelectedPatent.vue'),
  366. // },
  367. // // 任务分配
  368. // {
  369. // path: '/AssignTasks',
  370. // name:"/AssignTasks",
  371. // meta:{
  372. // aside:true
  373. // },
  374. // component:() => import('@/views/report/Invalid/InvalidPage/AssignTasks.vue'),
  375. // },
  376. // //添加对比文件
  377. // {
  378. // path:'/addPatentList',
  379. // name:'/addPatentList',
  380. // meta:{
  381. // title:'添加对比文件',
  382. // aside:true,
  383. // showHeader:true,
  384. // // hiddenHeader:true
  385. // },
  386. // component:() => import('@/views/report/components/addPatentList'),
  387. // },
  388. // //查看单个专利详情
  389. // {
  390. // path:'/patentDetails',
  391. // name:"patentDetails",
  392. // meta:{
  393. // aside:true
  394. // },
  395. // component:() => import('@/views/components/common/PatentDetails')
  396. // },
  397. // //无效应对证据文献详情
  398. // {
  399. // path:'/checkFileDetails/:key',
  400. // name:'checkFileDetails/:key',
  401. // meta:{
  402. // title:'证据文献详情',
  403. // aside:true,
  404. // showHeader:true,
  405. // },
  406. // component:() => import('@/views/report/InvalidResponse/components/FileDetails/index.vue'),
  407. // },
  408. // //报告任务清单
  409. // {
  410. // path:'/rTaskList',
  411. // name:'rTaskList',
  412. // meta:{
  413. // title:'任务',
  414. // aside:true,
  415. // showHeader:true,
  416. // },
  417. // component: () => import('@/views/report/task/index.vue'),
  418. // },
  419. // // },
  420. ],
  421. },
  422. //场景可视化
  423. {
  424. path: '/visual',
  425. name:'visual',
  426. meta: {
  427. title: '场景可视化',
  428. sign:'visual',
  429. belong:'visual'
  430. },
  431. component: () => import('@/views/visual')
  432. },
  433. {
  434. path: '/visual/:title',
  435. name:'flowPath',
  436. meta: {
  437. sign:'flowPath',
  438. title: '可视化平台',
  439. belong:'visual'
  440. },
  441. component: () => import('@/views/visual/title/index.vue')
  442. },
  443. //图表分析
  444. // {
  445. // path: "/analyse",
  446. // component:{render(c){return c('router-view')}},
  447. // redirect:'/analyse',
  448. // children: [
  449. // {
  450. // path: "custom",
  451. // component: () => import('@/views/analyse/custom'),
  452. // meta: {
  453. // title: '自定义分析列表'
  454. // }
  455. // },
  456. // {
  457. // path: "report",
  458. // component: () => import('@/views/analyse/report/create'),
  459. // meta: {
  460. // title: '一键生成报告'
  461. // }
  462. // },
  463. // ]
  464. // },
  465. // {
  466. // path: "custom",
  467. // component: () => import('@/views/analyse/custom'),
  468. // meta: {
  469. // title: '自定义分析列表'
  470. // }
  471. // },
  472. // {
  473. // path: "report",
  474. // component: () => import('@/views/analyse/report/create'),
  475. // meta: {
  476. // title: '一键生成报告'
  477. // }
  478. // },
  479. //查看文件
  480. {
  481. path:'/checkFile',
  482. name:'/checkFile',
  483. meta:{
  484. aside:true,
  485. sign:'checkFile',
  486. },
  487. component:() => import('@/views/components/view/checkFile.vue'),
  488. },
  489. //excel导入
  490. {
  491. path: '/import',
  492. name:"import",
  493. meta:{
  494. title: 'excel导入',
  495. sign:'import'
  496. },
  497. component:() => import('@/views/components/import/excelImport'),
  498. },
  499. //专利号导入
  500. {
  501. path: '/PatentNoImport',
  502. name:"PatentNoImport",
  503. meta:{
  504. title: '专利号导入',
  505. sign:'PatentNoImport'
  506. },
  507. component:() => import('@/views/components/import/PatentNoImport'),
  508. },
  509. //检索导入
  510. {
  511. path: '/conditionImport',
  512. name:"conditionImport",
  513. meta:{
  514. title: '专利检索',
  515. sign:'conditionImport',
  516. belong:'conditionImport'
  517. },
  518. component:() => import('@/views/components/import/conditionImport'),
  519. },
  520. // //检索结果
  521. // {
  522. // path: "/searchResult",
  523. // meta: {
  524. // title: '检索结果',
  525. // // button: [],
  526. // },
  527. // component: () => import('@/views/components/import/conditionImport/searchResultIndex.vue'),
  528. // },
  529. // //检索专利详情
  530. // {
  531. // path: "/search/patentDetail",
  532. // meta: {
  533. // title: '专利详情',
  534. // // button: [],
  535. // },
  536. // component: () => import('@/views/components/import/conditionImport/patentDetails/patentIndex.vue'),
  537. // },
  538. //任务清单
  539. // {
  540. // path: "/taskList",
  541. // meta: {
  542. // title: '任务清单',
  543. // button: [],
  544. // },
  545. // component: () => import('@/views/task/taskIndex.vue'),
  546. // },
  547. // //标注库
  548. // {
  549. // path: "/indicia",
  550. // meta: {
  551. // title: '标注库',
  552. // button: [],
  553. // },
  554. // component: () => import('@/views/indicia'),
  555. // },
  556. // //检索组件
  557. // {
  558. // path: "/search",
  559. // meta: {
  560. // title: '检索',
  561. // button: [],
  562. // },
  563. // component: () => import('@/views/components/common/retrieval'),
  564. // },
  565. ]
  566. },
  567. ]
  568. const router = new VueRouter({
  569. mode: 'history',
  570. base: '/',
  571. routes
  572. })
  573. router.beforeEach((to, from, next) => {
  574. if (to.path === '/login'||to.path==='/' || to.path == '/agreeConceal'){
  575. if (to.meta.title) {
  576. document.title = to.meta.title;
  577. }
  578. next()
  579. }
  580. else if(to.meta.allowPath){
  581. if (to.meta.title) {
  582. document.title = to.meta.title;
  583. }
  584. next()
  585. }
  586. else{
  587. const tokenStr = Cookies.get('token')
  588. switch(tokenStr){
  589. case undefined:
  590. if (to.meta.title) {
  591. document.title = to.meta.title;
  592. }
  593. next({name:'Login',params:{ redirect:to.fullPath}})
  594. break
  595. default:
  596. if (to.meta.title) {
  597. document.title = to.meta.title;
  598. }
  599. next()
  600. break;
  601. }
  602. }
  603. })
  604. router.afterEach((to, from) => {
  605. });
  606. export default router