remaining.ts 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599
  1. import { Layout } from '@/utils/routerHelper'
  2. const { t } = useI18n()
  3. /**
  4. * redirect: noredirect 当设置 noredirect 的时候该路由在面包屑导航中不可被点击
  5. * name:'router-name' 设定路由的名字,一定要填写不然使用<keep-alive>时会出现各种问题
  6. * meta : {
  7. hidden: true 当设置 true 的时候该路由不会再侧边栏出现 如404,login等页面(默认 false)
  8. alwaysShow: true 当你一个路由下面的 children 声明的路由大于1个时,自动会变成嵌套的模式,
  9. 只有一个时,会将那个子路由当做根路由显示在侧边栏,
  10. 若你想不管路由下面的 children 声明的个数都显示你的根路由,
  11. 你可以设置 alwaysShow: true,这样它就会忽略之前定义的规则,
  12. 一直显示根路由(默认 false)
  13. title: 'title' 设置该路由在侧边栏和面包屑中展示的名字
  14. icon: 'svg-name' 设置该路由的图标
  15. noCache: true 如果设置为true,则不会被 <keep-alive> 缓存(默认 false)
  16. breadcrumb: false 如果设置为false,则不会在breadcrumb面包屑中显示(默认 true)
  17. affix: true 如果设置为true,则会一直固定在tag项中(默认 false)
  18. noTagsView: true 如果设置为true,则不会出现在tag中(默认 false)
  19. activeMenu: '/dashboard' 显示高亮的路由路径
  20. followAuth: '/dashboard' 跟随哪个路由进行权限过滤
  21. canTo: true 设置为true即使hidden为true,也依然可以进行路由跳转(默认 false)
  22. }
  23. **/
  24. const remainingRouter: AppRouteRecordRaw[] = [
  25. {
  26. path: '/redirect',
  27. component: Layout,
  28. name: 'Redirect',
  29. children: [
  30. {
  31. path: '/redirect/:path(.*)',
  32. name: 'Redirect',
  33. component: () => import('@/views/Redirect/Redirect.vue'),
  34. meta: {}
  35. }
  36. ],
  37. meta: {
  38. hidden: true,
  39. noTagsView: true
  40. }
  41. },
  42. {
  43. path: '/',
  44. component: Layout,
  45. redirect: '/index',
  46. name: 'Home',
  47. meta: {},
  48. children: [
  49. {
  50. path: 'index',
  51. component: () => import('@/views/Home/Index.vue'),
  52. name: 'Index',
  53. meta: {
  54. title: t('router.home'),
  55. icon: 'ep:home-filled',
  56. noCache: false,
  57. affix: true
  58. }
  59. }
  60. ]
  61. },
  62. {
  63. path: '/ai/music',
  64. component: Layout,
  65. redirect: '/index',
  66. name: 'AIMusic',
  67. meta: {},
  68. children: [
  69. {
  70. path: 'index',
  71. component: () => import('@/views/ai//music/index.vue'),
  72. name: 'AIMusicIndex',
  73. meta: {
  74. title: 'AI 音乐',
  75. icon: 'ep:home-filled',
  76. noCache: false,
  77. affix: true
  78. }
  79. }
  80. ]
  81. },
  82. {
  83. path: '/user',
  84. component: Layout,
  85. name: 'UserInfo',
  86. meta: {
  87. hidden: true
  88. },
  89. children: [
  90. {
  91. path: 'profile',
  92. component: () => import('@/views/Profile/Index.vue'),
  93. name: 'Profile',
  94. meta: {
  95. canTo: true,
  96. hidden: true,
  97. noTagsView: false,
  98. icon: 'ep:user',
  99. title: t('common.profile')
  100. }
  101. },
  102. {
  103. path: 'notify-message',
  104. component: () => import('@/views/system/notify/my/index.vue'),
  105. name: 'MyNotifyMessage',
  106. meta: {
  107. canTo: true,
  108. hidden: true,
  109. noTagsView: false,
  110. icon: 'ep:message',
  111. title: '我的站内信'
  112. }
  113. }
  114. ]
  115. },
  116. {
  117. path: '/dict',
  118. component: Layout,
  119. name: 'dict',
  120. meta: {
  121. hidden: true
  122. },
  123. children: [
  124. {
  125. path: 'type/data/:dictType',
  126. component: () => import('@/views/system/dict/data/index.vue'),
  127. name: 'SystemDictData',
  128. meta: {
  129. title: '字典数据',
  130. noCache: true,
  131. hidden: true,
  132. canTo: true,
  133. icon: '',
  134. activeMenu: '/system/dict'
  135. }
  136. }
  137. ]
  138. },
  139. {
  140. path: '/codegen',
  141. component: Layout,
  142. name: 'CodegenEdit',
  143. meta: {
  144. hidden: true
  145. },
  146. children: [
  147. {
  148. path: 'edit',
  149. component: () => import('@/views/infra/codegen/EditTable.vue'),
  150. name: 'InfraCodegenEditTable',
  151. meta: {
  152. noCache: true,
  153. hidden: true,
  154. canTo: true,
  155. icon: 'ep:edit',
  156. title: '修改生成配置',
  157. activeMenu: 'infra/codegen/index'
  158. }
  159. }
  160. ]
  161. },
  162. {
  163. path: '/job',
  164. component: Layout,
  165. name: 'JobL',
  166. meta: {
  167. hidden: true
  168. },
  169. children: [
  170. {
  171. path: 'job-log',
  172. component: () => import('@/views/infra/job/logger/index.vue'),
  173. name: 'InfraJobLog',
  174. meta: {
  175. noCache: true,
  176. hidden: true,
  177. canTo: true,
  178. icon: 'ep:edit',
  179. title: '调度日志',
  180. activeMenu: 'infra/job/index'
  181. }
  182. }
  183. ]
  184. },
  185. {
  186. path: '/login',
  187. component: () => import('@/views/Login/Login.vue'),
  188. name: 'Login',
  189. meta: {
  190. hidden: true,
  191. title: t('router.login'),
  192. noTagsView: true
  193. }
  194. },
  195. {
  196. path: '/sso',
  197. component: () => import('@/views/Login/Login.vue'),
  198. name: 'SSOLogin',
  199. meta: {
  200. hidden: true,
  201. title: t('router.login'),
  202. noTagsView: true
  203. }
  204. },
  205. {
  206. path: '/social-login',
  207. component: () => import('@/views/Login/SocialLogin.vue'),
  208. name: 'SocialLogin',
  209. meta: {
  210. hidden: true,
  211. title: t('router.socialLogin'),
  212. noTagsView: true
  213. }
  214. },
  215. {
  216. path: '/403',
  217. component: () => import('@/views/Error/403.vue'),
  218. name: 'NoAccess',
  219. meta: {
  220. hidden: true,
  221. title: '403',
  222. noTagsView: true
  223. }
  224. },
  225. {
  226. path: '/404',
  227. component: () => import('@/views/Error/404.vue'),
  228. name: 'NoFound',
  229. meta: {
  230. hidden: true,
  231. title: '404',
  232. noTagsView: true
  233. }
  234. },
  235. {
  236. path: '/500',
  237. component: () => import('@/views/Error/500.vue'),
  238. name: 'Error',
  239. meta: {
  240. hidden: true,
  241. title: '500',
  242. noTagsView: true
  243. }
  244. },
  245. {
  246. path: '/bpm',
  247. component: Layout,
  248. name: 'bpm',
  249. meta: {
  250. hidden: true
  251. },
  252. children: [
  253. {
  254. path: 'manager/form/edit',
  255. component: () => import('@/views/bpm/form/editor/index.vue'),
  256. name: 'BpmFormEditor',
  257. meta: {
  258. noCache: true,
  259. hidden: true,
  260. canTo: true,
  261. title: '设计流程表单',
  262. activeMenu: '/bpm/manager/form'
  263. }
  264. },
  265. {
  266. path: 'manager/model/edit',
  267. component: () => import('@/views/bpm/model/editor/index.vue'),
  268. name: 'BpmModelEditor',
  269. meta: {
  270. noCache: true,
  271. hidden: true,
  272. canTo: true,
  273. title: '设计流程',
  274. activeMenu: '/bpm/manager/model'
  275. }
  276. },
  277. {
  278. path: 'manager/simple/workflow/model/edit',
  279. component: () => import('@/views/bpm/simpleWorkflow/index.vue'),
  280. name: 'SimpleWorkflowDesignEditor',
  281. meta: {
  282. noCache: true,
  283. hidden: true,
  284. canTo: true,
  285. title: '仿钉钉设计流程',
  286. activeMenu: '/bpm/manager/model'
  287. }
  288. },
  289. {
  290. path: 'manager/definition',
  291. component: () => import('@/views/bpm/definition/index.vue'),
  292. name: 'BpmProcessDefinition',
  293. meta: {
  294. noCache: true,
  295. hidden: true,
  296. canTo: true,
  297. title: '流程定义',
  298. activeMenu: '/bpm/manager/model'
  299. }
  300. },
  301. {
  302. path: 'process-instance/detail',
  303. component: () => import('@/views/bpm/processInstance/detail/index.vue'),
  304. name: 'BpmProcessInstanceDetail',
  305. meta: {
  306. noCache: true,
  307. hidden: true,
  308. canTo: true,
  309. title: '流程详情',
  310. activeMenu: '/bpm/task/my'
  311. }
  312. },
  313. {
  314. path: 'oa/leave/create',
  315. component: () => import('@/views/bpm/oa/leave/create.vue'),
  316. name: 'OALeaveCreate',
  317. meta: {
  318. noCache: true,
  319. hidden: true,
  320. canTo: true,
  321. title: '发起 OA 请假',
  322. activeMenu: '/bpm/oa/leave'
  323. }
  324. },
  325. {
  326. path: 'oa/leave/detail',
  327. component: () => import('@/views/bpm/oa/leave/detail.vue'),
  328. name: 'OALeaveDetail',
  329. meta: {
  330. noCache: true,
  331. hidden: true,
  332. canTo: true,
  333. title: '查看 OA 请假',
  334. activeMenu: '/bpm/oa/leave'
  335. }
  336. }
  337. ]
  338. },
  339. {
  340. path: '/mall/product', // 商品中心
  341. component: Layout,
  342. name: 'ProductCenter',
  343. meta: {
  344. hidden: true
  345. },
  346. children: [
  347. {
  348. path: 'spu/add',
  349. component: () => import('@/views/mall/product/spu/form/index.vue'),
  350. name: 'ProductSpuAdd',
  351. meta: {
  352. noCache: true,
  353. hidden: true,
  354. canTo: true,
  355. icon: 'ep:edit',
  356. title: '商品添加',
  357. activeMenu: '/mall/product/spu'
  358. }
  359. },
  360. {
  361. path: 'spu/edit/:id(\\d+)',
  362. component: () => import('@/views/mall/product/spu/form/index.vue'),
  363. name: 'ProductSpuEdit',
  364. meta: {
  365. noCache: true,
  366. hidden: true,
  367. canTo: true,
  368. icon: 'ep:edit',
  369. title: '商品编辑',
  370. activeMenu: '/mall/product/spu'
  371. }
  372. },
  373. {
  374. path: 'spu/detail/:id(\\d+)',
  375. component: () => import('@/views/mall/product/spu/form/index.vue'),
  376. name: 'ProductSpuDetail',
  377. meta: {
  378. noCache: true,
  379. hidden: true,
  380. canTo: true,
  381. icon: 'ep:view',
  382. title: '商品详情',
  383. activeMenu: '/mall/product/spu'
  384. }
  385. },
  386. {
  387. path: 'property/value/:propertyId(\\d+)',
  388. component: () => import('@/views/mall/product/property/value/index.vue'),
  389. name: 'ProductPropertyValue',
  390. meta: {
  391. noCache: true,
  392. hidden: true,
  393. canTo: true,
  394. icon: 'ep:view',
  395. title: '商品属性值',
  396. activeMenu: '/product/property'
  397. }
  398. }
  399. ]
  400. },
  401. {
  402. path: '/mall/trade', // 交易中心
  403. component: Layout,
  404. name: 'TradeCenter',
  405. meta: {
  406. hidden: true
  407. },
  408. children: [
  409. {
  410. path: 'order/detail/:id(\\d+)',
  411. component: () => import('@/views/mall/trade/order/detail/index.vue'),
  412. name: 'TradeOrderDetail',
  413. meta: { title: '订单详情', icon: 'ep:view', activeMenu: '/mall/trade/order' }
  414. },
  415. {
  416. path: 'after-sale/detail/:id(\\d+)',
  417. component: () => import('@/views/mall/trade/afterSale/detail/index.vue'),
  418. name: 'TradeAfterSaleDetail',
  419. meta: { title: '退款详情', icon: 'ep:view', activeMenu: '/mall/trade/after-sale' }
  420. }
  421. ]
  422. },
  423. {
  424. path: '/member',
  425. component: Layout,
  426. name: 'MemberCenter',
  427. meta: { hidden: true },
  428. children: [
  429. {
  430. path: 'user/detail/:id',
  431. name: 'MemberUserDetail',
  432. meta: {
  433. title: '会员详情',
  434. noCache: true,
  435. hidden: true
  436. },
  437. component: () => import('@/views/member/user/detail/index.vue')
  438. }
  439. ]
  440. },
  441. {
  442. path: '/pay',
  443. component: Layout,
  444. name: 'pay',
  445. meta: { hidden: true },
  446. children: [
  447. {
  448. path: 'cashier',
  449. name: 'PayCashier',
  450. meta: {
  451. title: '收银台',
  452. noCache: true,
  453. hidden: true
  454. },
  455. component: () => import('@/views/pay/cashier/index.vue')
  456. }
  457. ]
  458. },
  459. {
  460. path: '/diy',
  461. name: 'DiyCenter',
  462. meta: { hidden: true },
  463. component: Layout,
  464. children: [
  465. {
  466. path: 'template/decorate/:id',
  467. name: 'DiyTemplateDecorate',
  468. meta: {
  469. title: '模板装修',
  470. noCache: true,
  471. hidden: true,
  472. activeMenu: '/mall/promotion/diy/template'
  473. },
  474. component: () => import('@/views/mall/promotion/diy/template/decorate.vue')
  475. },
  476. {
  477. path: 'page/decorate/:id',
  478. name: 'DiyPageDecorate',
  479. meta: {
  480. title: '页面装修',
  481. noCache: true,
  482. hidden: true,
  483. activeMenu: '/mall/promotion/diy/page'
  484. },
  485. component: () => import('@/views/mall/promotion/diy/page/decorate.vue')
  486. }
  487. ]
  488. },
  489. {
  490. path: '/crm',
  491. component: Layout,
  492. name: 'CrmCenter',
  493. meta: { hidden: true },
  494. children: [
  495. {
  496. path: 'clue/detail/:id',
  497. name: 'CrmClueDetail',
  498. meta: {
  499. title: '线索详情',
  500. noCache: true,
  501. hidden: true,
  502. activeMenu: '/crm/clue'
  503. },
  504. component: () => import('@/views/crm/clue/detail/index.vue')
  505. },
  506. {
  507. path: 'customer/detail/:id',
  508. name: 'CrmCustomerDetail',
  509. meta: {
  510. title: '客户详情',
  511. noCache: true,
  512. hidden: true,
  513. activeMenu: '/crm/customer'
  514. },
  515. component: () => import('@/views/crm/customer/detail/index.vue')
  516. },
  517. {
  518. path: 'business/detail/:id',
  519. name: 'CrmBusinessDetail',
  520. meta: {
  521. title: '商机详情',
  522. noCache: true,
  523. hidden: true,
  524. activeMenu: '/crm/business'
  525. },
  526. component: () => import('@/views/crm/business/detail/index.vue')
  527. },
  528. {
  529. path: 'contract/detail/:id',
  530. name: 'CrmContractDetail',
  531. meta: {
  532. title: '合同详情',
  533. noCache: true,
  534. hidden: true,
  535. activeMenu: '/crm/contract'
  536. },
  537. component: () => import('@/views/crm/contract/detail/index.vue')
  538. },
  539. {
  540. path: 'receivable-plan/detail/:id',
  541. name: 'CrmReceivablePlanDetail',
  542. meta: {
  543. title: '回款计划详情',
  544. noCache: true,
  545. hidden: true,
  546. activeMenu: '/crm/receivable-plan'
  547. },
  548. component: () => import('@/views/crm/receivable/plan/detail/index.vue')
  549. },
  550. {
  551. path: 'receivable/detail/:id',
  552. name: 'CrmReceivableDetail',
  553. meta: {
  554. title: '回款详情',
  555. noCache: true,
  556. hidden: true,
  557. activeMenu: '/crm/receivable'
  558. },
  559. component: () => import('@/views/crm/receivable/detail/index.vue')
  560. },
  561. {
  562. path: 'contact/detail/:id',
  563. name: 'CrmContactDetail',
  564. meta: {
  565. title: '联系人详情',
  566. noCache: true,
  567. hidden: true,
  568. activeMenu: '/crm/contact'
  569. },
  570. component: () => import('@/views/crm/contact/detail/index.vue')
  571. },
  572. {
  573. path: 'product/detail/:id',
  574. name: 'CrmProductDetail',
  575. meta: {
  576. title: '产品详情',
  577. noCache: true,
  578. hidden: true,
  579. activeMenu: '/crm/product'
  580. },
  581. component: () => import('@/views/crm/product/detail/index.vue')
  582. }
  583. ]
  584. }
  585. ]
  586. export default remainingRouter