remaining.ts 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706
  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: '/user',
  64. component: Layout,
  65. name: 'UserInfo',
  66. meta: {
  67. hidden: true
  68. },
  69. children: [
  70. {
  71. path: 'profile',
  72. component: () => import('@/views/Profile/Index.vue'),
  73. name: 'Profile',
  74. meta: {
  75. canTo: true,
  76. hidden: true,
  77. noTagsView: false,
  78. icon: 'ep:user',
  79. title: t('common.profile')
  80. }
  81. },
  82. {
  83. path: 'notify-message',
  84. component: () => import('@/views/system/notify/my/index.vue'),
  85. name: 'MyNotifyMessage',
  86. meta: {
  87. canTo: true,
  88. hidden: true,
  89. noTagsView: false,
  90. icon: 'ep:message',
  91. title: '我的站内信'
  92. }
  93. }
  94. ]
  95. },
  96. {
  97. path: '/dict',
  98. component: Layout,
  99. name: 'dict',
  100. meta: {
  101. hidden: true
  102. },
  103. children: [
  104. {
  105. path: 'type/data/:dictType',
  106. component: () => import('@/views/system/dict/data/index.vue'),
  107. name: 'SystemDictData',
  108. meta: {
  109. title: '字典数据',
  110. noCache: true,
  111. hidden: true,
  112. canTo: true,
  113. icon: '',
  114. activeMenu: '/system/dict'
  115. }
  116. }
  117. ]
  118. },
  119. {
  120. path: '/codegen',
  121. component: Layout,
  122. name: 'CodegenEdit',
  123. meta: {
  124. hidden: true
  125. },
  126. children: [
  127. {
  128. path: 'edit',
  129. component: () => import('@/views/infra/codegen/EditTable.vue'),
  130. name: 'InfraCodegenEditTable',
  131. meta: {
  132. noCache: true,
  133. hidden: true,
  134. canTo: true,
  135. icon: 'ep:edit',
  136. title: '修改生成配置',
  137. activeMenu: 'infra/codegen/index'
  138. }
  139. }
  140. ]
  141. },
  142. {
  143. path: '/job',
  144. component: Layout,
  145. name: 'JobL',
  146. meta: {
  147. hidden: true
  148. },
  149. children: [
  150. {
  151. path: 'job-log',
  152. component: () => import('@/views/infra/job/logger/index.vue'),
  153. name: 'InfraJobLog',
  154. meta: {
  155. noCache: true,
  156. hidden: true,
  157. canTo: true,
  158. icon: 'ep:edit',
  159. title: '调度日志',
  160. activeMenu: 'infra/job/index'
  161. }
  162. }
  163. ]
  164. },
  165. {
  166. path: '/login',
  167. component: () => import('@/views/Login/Login.vue'),
  168. name: 'Login',
  169. meta: {
  170. hidden: true,
  171. title: t('router.login'),
  172. noTagsView: true
  173. }
  174. },
  175. {
  176. path: '/sso',
  177. component: () => import('@/views/Login/Login.vue'),
  178. name: 'SSOLogin',
  179. meta: {
  180. hidden: true,
  181. title: t('router.login'),
  182. noTagsView: true
  183. }
  184. },
  185. {
  186. path: '/social-login',
  187. component: () => import('@/views/Login/SocialLogin.vue'),
  188. name: 'SocialLogin',
  189. meta: {
  190. hidden: true,
  191. title: t('router.socialLogin'),
  192. noTagsView: true
  193. }
  194. },
  195. {
  196. path: '/403',
  197. component: () => import('@/views/Error/403.vue'),
  198. name: 'NoAccess',
  199. meta: {
  200. hidden: true,
  201. title: '403',
  202. noTagsView: true
  203. }
  204. },
  205. {
  206. path: '/404',
  207. component: () => import('@/views/Error/404.vue'),
  208. name: 'NoFound',
  209. meta: {
  210. hidden: true,
  211. title: '404',
  212. noTagsView: true
  213. }
  214. },
  215. {
  216. path: '/500',
  217. component: () => import('@/views/Error/500.vue'),
  218. name: 'Error',
  219. meta: {
  220. hidden: true,
  221. title: '500',
  222. noTagsView: true
  223. }
  224. },
  225. {
  226. path: '/supplier/product', // 商品中心
  227. component: Layout,
  228. name: 'SupplierCenter',
  229. meta: {
  230. hidden: true
  231. },
  232. children: [
  233. {
  234. path: '/supplier/detail/info/:id(\\d+)',
  235. component: () => import('@/views/supplier/base/form/index.vue'),
  236. name: 'SupplierDetailInfo',
  237. meta: {
  238. noCache: true,
  239. hidden: true,
  240. canTo: true,
  241. icon: 'ep:view',
  242. title: '供应商详情',
  243. activeMenu: '/supplier/base'
  244. }
  245. },
  246. ]
  247. },
  248. {
  249. path: '/bpm',
  250. component: Layout,
  251. name: 'bpm',
  252. meta: {
  253. hidden: true
  254. },
  255. children: [
  256. {
  257. path: 'manager/form/edit',
  258. component: () => import('@/views/bpm/form/editor/index.vue'),
  259. name: 'BpmFormEditor',
  260. meta: {
  261. noCache: true,
  262. hidden: true,
  263. canTo: true,
  264. title: '设计流程表单',
  265. activeMenu: '/bpm/manager/form'
  266. }
  267. },
  268. {
  269. path: 'manager/model/edit',
  270. component: () => import('@/views/bpm/model/editor/index.vue'),
  271. name: 'BpmModelEditor',
  272. meta: {
  273. noCache: true,
  274. hidden: true,
  275. canTo: true,
  276. title: '设计流程',
  277. activeMenu: '/bpm/manager/model'
  278. }
  279. },
  280. {
  281. path: 'manager/simple/model',
  282. component: () => import('@/views/bpm/simple/SimpleModelDesign.vue'),
  283. name: 'SimpleModelDesign',
  284. meta: {
  285. noCache: true,
  286. hidden: true,
  287. canTo: true,
  288. title: '仿钉钉设计流程',
  289. activeMenu: '/bpm/manager/model'
  290. }
  291. },
  292. {
  293. path: 'manager/definition',
  294. component: () => import('@/views/bpm/definition/index.vue'),
  295. name: 'BpmProcessDefinition',
  296. meta: {
  297. noCache: true,
  298. hidden: true,
  299. canTo: true,
  300. title: '流程定义',
  301. activeMenu: '/bpm/manager/model'
  302. }
  303. },
  304. {
  305. path: 'process-instance/detail',
  306. component: () => import('@/views/bpm/processInstance/detail/index.vue'),
  307. name: 'BpmProcessInstanceDetail',
  308. meta: {
  309. noCache: true,
  310. hidden: true,
  311. canTo: true,
  312. title: '流程详情',
  313. activeMenu: '/bpm/task/my'
  314. },
  315. props: (route) => ({
  316. id: route.query.id,
  317. taskId: route.query.taskId,
  318. activityId: route.query.activityId
  319. })
  320. },
  321. {
  322. path: 'process-instance/report',
  323. component: () => import('@/views/bpm/processInstance/report/index.vue'),
  324. name: 'BpmProcessInstanceReport',
  325. meta: {
  326. noCache: true,
  327. hidden: true,
  328. canTo: true,
  329. title: '数据报表',
  330. activeMenu: '/bpm/manager/model'
  331. }
  332. },
  333. {
  334. path: 'oa/leave/create',
  335. component: () => import('@/views/bpm/oa/leave/create.vue'),
  336. name: 'OALeaveCreate',
  337. meta: {
  338. noCache: true,
  339. hidden: true,
  340. canTo: true,
  341. title: '发起 OA 请假',
  342. activeMenu: '/bpm/oa/leave'
  343. }
  344. },
  345. {
  346. path: 'oa/leave/detail',
  347. component: () => import('@/views/bpm/oa/leave/detail.vue'),
  348. name: 'OALeaveDetail',
  349. meta: {
  350. noCache: true,
  351. hidden: true,
  352. canTo: true,
  353. title: '查看 OA 请假',
  354. activeMenu: '/bpm/oa/leave'
  355. }
  356. },
  357. {
  358. path: 'manager/model/create',
  359. component: () => import('@/views/bpm/model/form/index.vue'),
  360. name: 'BpmModelCreate',
  361. meta: {
  362. noCache: true,
  363. hidden: true,
  364. canTo: true,
  365. title: '创建流程',
  366. activeMenu: '/bpm/manager/model'
  367. }
  368. },
  369. {
  370. // TODO @zws:1)建议,在加一个路由。然后标题是“复制流程”,这样体验会好点;2)复制出来的数据,在名字前面,加“副本 ”,和钉钉保持一致!
  371. path: 'manager/model/:type/:id',
  372. component: () => import('@/views/bpm/model/form/index.vue'),
  373. name: 'BpmModelUpdate',
  374. meta: {
  375. noCache: true,
  376. hidden: true,
  377. canTo: true,
  378. title: '修改流程',
  379. activeMenu: '/bpm/manager/model'
  380. }
  381. }
  382. ]
  383. },
  384. {
  385. path: '/mall/product', // 商品中心
  386. component: Layout,
  387. name: 'ProductCenter',
  388. meta: {
  389. hidden: true
  390. },
  391. children: [
  392. {
  393. path: 'spu/add',
  394. component: () => import('@/views/mall/product/spu/form/index.vue'),
  395. name: 'ProductSpuAdd',
  396. meta: {
  397. noCache: false, // 需要缓存
  398. hidden: true,
  399. canTo: true,
  400. icon: 'ep:edit',
  401. title: '商品添加',
  402. activeMenu: '/mall/product/spu'
  403. }
  404. },
  405. {
  406. path: 'spu/edit/:id(\\d+)',
  407. component: () => import('@/views/mall/product/spu/form/index.vue'),
  408. name: 'ProductSpuEdit',
  409. meta: {
  410. noCache: true,
  411. hidden: true,
  412. canTo: true,
  413. icon: 'ep:edit',
  414. title: '商品编辑',
  415. activeMenu: '/mall/product/spu'
  416. }
  417. },
  418. {
  419. path: 'spu/detail/:id(\\d+)',
  420. component: () => import('@/views/mall/product/spu/form/index.vue'),
  421. name: 'ProductSpuDetail',
  422. meta: {
  423. noCache: true,
  424. hidden: true,
  425. canTo: true,
  426. icon: 'ep:view',
  427. title: '商品详情',
  428. activeMenu: '/mall/product/spu'
  429. }
  430. },
  431. {
  432. path: 'property/value/:propertyId(\\d+)',
  433. component: () => import('@/views/mall/product/property/value/index.vue'),
  434. name: 'ProductPropertyValue',
  435. meta: {
  436. noCache: true,
  437. hidden: true,
  438. canTo: true,
  439. icon: 'ep:view',
  440. title: '商品属性值',
  441. activeMenu: '/product/property'
  442. }
  443. }
  444. ]
  445. },
  446. {
  447. path: '/mall/trade', // 交易中心
  448. component: Layout,
  449. name: 'TradeCenter',
  450. meta: {
  451. hidden: true
  452. },
  453. children: [
  454. {
  455. path: 'order/detail/:id(\\d+)',
  456. component: () => import('@/views/mall/trade/order/detail/index.vue'),
  457. name: 'TradeOrderDetail',
  458. meta: { title: '订单详情', icon: 'ep:view', activeMenu: '/mall/trade/order' }
  459. },
  460. {
  461. path: 'after-sale/detail/:id(\\d+)',
  462. component: () => import('@/views/mall/trade/afterSale/detail/index.vue'),
  463. name: 'TradeAfterSaleDetail',
  464. meta: { title: '退款详情', icon: 'ep:view', activeMenu: '/mall/trade/after-sale' }
  465. }
  466. ]
  467. },
  468. {
  469. path: '/member',
  470. component: Layout,
  471. name: 'MemberCenter',
  472. meta: { hidden: true },
  473. children: [
  474. {
  475. path: 'user/detail/:id',
  476. name: 'MemberUserDetail',
  477. meta: {
  478. title: '会员详情',
  479. noCache: true,
  480. hidden: true
  481. },
  482. component: () => import('@/views/member/user/detail/index.vue')
  483. }
  484. ]
  485. },
  486. {
  487. path: '/pay',
  488. component: Layout,
  489. name: 'pay',
  490. meta: { hidden: true },
  491. children: [
  492. {
  493. path: 'cashier',
  494. name: 'PayCashier',
  495. meta: {
  496. title: '收银台',
  497. noCache: true,
  498. hidden: true
  499. },
  500. component: () => import('@/views/pay/cashier/index.vue')
  501. }
  502. ]
  503. },
  504. {
  505. path: '/diy',
  506. name: 'DiyCenter',
  507. meta: { hidden: true },
  508. component: Layout,
  509. children: [
  510. {
  511. path: 'template/decorate/:id',
  512. name: 'DiyTemplateDecorate',
  513. meta: {
  514. title: '模板装修',
  515. noCache: true,
  516. hidden: true,
  517. activeMenu: '/mall/promotion/diy/template'
  518. },
  519. component: () => import('@/views/mall/promotion/diy/template/decorate.vue')
  520. },
  521. {
  522. path: 'page/decorate/:id',
  523. name: 'DiyPageDecorate',
  524. meta: {
  525. title: '页面装修',
  526. noCache: true,
  527. hidden: true,
  528. activeMenu: '/mall/promotion/diy/page'
  529. },
  530. component: () => import('@/views/mall/promotion/diy/page/decorate.vue')
  531. }
  532. ]
  533. },
  534. {
  535. path: '/crm',
  536. component: Layout,
  537. name: 'CrmCenter',
  538. meta: { hidden: true },
  539. children: [
  540. {
  541. path: 'clue/detail/:id',
  542. name: 'CrmClueDetail',
  543. meta: {
  544. title: '线索详情',
  545. noCache: true,
  546. hidden: true,
  547. activeMenu: '/crm/clue'
  548. },
  549. component: () => import('@/views/crm/clue/detail/index.vue')
  550. },
  551. {
  552. path: 'customer/detail/:id',
  553. name: 'CrmCustomerDetail',
  554. meta: {
  555. title: '客户详情',
  556. noCache: true,
  557. hidden: true,
  558. activeMenu: '/crm/customer'
  559. },
  560. component: () => import('@/views/crm/customer/detail/index.vue')
  561. },
  562. {
  563. path: 'business/detail/:id',
  564. name: 'CrmBusinessDetail',
  565. meta: {
  566. title: '商机详情',
  567. noCache: true,
  568. hidden: true,
  569. activeMenu: '/crm/business'
  570. },
  571. component: () => import('@/views/crm/business/detail/index.vue')
  572. },
  573. {
  574. path: 'contract/detail/:id',
  575. name: 'CrmContractDetail',
  576. meta: {
  577. title: '合同详情',
  578. noCache: true,
  579. hidden: true,
  580. activeMenu: '/crm/contract'
  581. },
  582. component: () => import('@/views/crm/contract/detail/index.vue')
  583. },
  584. {
  585. path: 'receivable-plan/detail/:id',
  586. name: 'CrmReceivablePlanDetail',
  587. meta: {
  588. title: '回款计划详情',
  589. noCache: true,
  590. hidden: true,
  591. activeMenu: '/crm/receivable-plan'
  592. },
  593. component: () => import('@/views/crm/receivable/plan/detail/index.vue')
  594. },
  595. {
  596. path: 'receivable/detail/:id',
  597. name: 'CrmReceivableDetail',
  598. meta: {
  599. title: '回款详情',
  600. noCache: true,
  601. hidden: true,
  602. activeMenu: '/crm/receivable'
  603. },
  604. component: () => import('@/views/crm/receivable/detail/index.vue')
  605. },
  606. {
  607. path: 'contact/detail/:id',
  608. name: 'CrmContactDetail',
  609. meta: {
  610. title: '联系人详情',
  611. noCache: true,
  612. hidden: true,
  613. activeMenu: '/crm/contact'
  614. },
  615. component: () => import('@/views/crm/contact/detail/index.vue')
  616. },
  617. {
  618. path: 'product/detail/:id',
  619. name: 'CrmProductDetail',
  620. meta: {
  621. title: '产品详情',
  622. noCache: true,
  623. hidden: true,
  624. activeMenu: '/crm/product'
  625. },
  626. component: () => import('@/views/crm/product/detail/index.vue')
  627. }
  628. ]
  629. },
  630. {
  631. path: '/ai',
  632. component: Layout,
  633. name: 'Ai',
  634. meta: {
  635. hidden: true
  636. },
  637. children: [
  638. {
  639. path: 'image/square',
  640. component: () => import('@/views/ai/image/square/index.vue'),
  641. name: 'AiImageSquare',
  642. meta: {
  643. title: '绘图作品',
  644. icon: 'ep:home-filled',
  645. noCache: false
  646. }
  647. }
  648. ]
  649. },
  650. {
  651. path: '/:pathMatch(.*)*',
  652. component: () => import('@/views/Error/404.vue'),
  653. name: '',
  654. meta: {
  655. title: '404',
  656. hidden: true,
  657. breadcrumb: false
  658. }
  659. },
  660. {
  661. path: '/iot',
  662. component: Layout,
  663. name: 'IOT',
  664. meta: {
  665. hidden: true
  666. },
  667. children: [
  668. {
  669. path: 'product/detail/:id',
  670. name: 'IoTProductDetail',
  671. meta: {
  672. title: '产品详情',
  673. noCache: true,
  674. hidden: true,
  675. activeMenu: '/iot/product'
  676. },
  677. component: () => import('@/views/iot/product/detail/index.vue')
  678. },
  679. {
  680. path: 'device/detail/:id',
  681. name: 'IoTDeviceDetail',
  682. meta: {
  683. title: '设备详情',
  684. noCache: true,
  685. hidden: true,
  686. activeMenu: '/iot/device'
  687. },
  688. component: () => import('@/views/iot/device/detail/index.vue')
  689. }
  690. ]
  691. }
  692. ]
  693. export default remainingRouter