index.js 18 KB

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