| | |
| | | |
| | | import Layout from '@/layout/MainLayout/Layout.vue'; |
| | | import ErrorLayout from '@/layout/ErrorLayout/ErrorLayout.vue'; |
| | | import { AppType } from '@/constants'; |
| | | import { loadEnv } from '@build/index'; |
| | | |
| | | // import { ElIcons } from '@/typings' |
| | | |
| | |
| | | children?: Route[]; |
| | | }; |
| | | |
| | | //@ts-ignore |
| | | export const constantRoutes: Route[] = [ |
| | | { |
| | | path: '/redirect', |
| | |
| | | component: Layout, |
| | | redirect: '/home', |
| | | alwaysShow: true, |
| | | meta: { |
| | | rank: 1001, |
| | | icon: 'home', |
| | | title: '保单管理', |
| | | rootMenu: true, |
| | | }, |
| | | children: [ |
| | | { |
| | | path: 'home', |
| | |
| | | hidden: false, |
| | | component: () => import('@/views/Home/Home.vue'), |
| | | meta: { |
| | | rank: 10001, |
| | | title: '首页', |
| | | rank: 1001, |
| | | title: '保单管理', |
| | | affix: true, |
| | | // rootMenu: true, |
| | | icon: 'home', |
| | | }, |
| | | }, |
| | | { |
| | | path: '/InsuranceOrderDetail/:id', |
| | | name: 'InsuranceOrderDetail', |
| | | hidden: true, |
| | | component: () => import('@/views/Home/InsuranceOrderDetail.vue'), |
| | | meta: { |
| | | rank: 10002, |
| | | title: '保单详情', |
| | | // rootMenu: true, |
| | | icon: 'home', |
| | | }, |
| | | }, |
| | | { |
| | | path: '/InsurancePolicyStampFiles/:id', |
| | | name: 'InsurancePolicyStampFiles', |
| | | hidden: true, |
| | | component: () => import('@/views/Home/InsurancePolicyStampFiles.vue'), |
| | | meta: { |
| | | rank: 10003, |
| | | title: '保单下载', |
| | | // rootMenu: true, |
| | | icon: 'home', |
| | | }, |
| | | }, |
| | | { |
| | | path: '/InsureDownloadInvoice/:id', |
| | | name: 'InsureDownloadInvoice', |
| | | hidden: true, |
| | | component: () => import('@/views/Home/InsureDownloadInvoice.vue'), |
| | | meta: { |
| | | rank: 10004, |
| | | title: '发票下载', |
| | | // rootMenu: true, |
| | | icon: 'home', |
| | | }, |
| | | }, |
| | | { |
| | | path: '/InsurePayDetail/:id', |
| | | name: 'InsurePayDetail', |
| | | hidden: true, |
| | | component: () => import('@/views/Home/InsurePayDetail.vue'), |
| | | meta: { |
| | | rank: 10005, |
| | | title: '支付详情', |
| | | // rootMenu: true, |
| | | icon: 'home', |
| | | }, |
| | | }, |
| | | { |
| | | path: '/BatchChange/:id', |
| | | name: 'BatchChange', |
| | | hidden: true, |
| | | component: () => import('@/views/Home/BatchChange.vue'), |
| | | meta: { |
| | | rank: 10002, |
| | | title: '批改', |
| | | // rootMenu: true, |
| | | icon: 'home', |
| | | }, |
| | | }, |
| | | ], |
| | | meta: { |
| | | rank: 1001, |
| | | icon: 'home', |
| | | title: '首页', |
| | | rootMenu: true, |
| | | }, |
| | | }, |
| | | |
| | | { |
| | | path: '/InsuranceClaim', |
| | | redirect: 'noRedirect', |
| | |
| | | }, |
| | | ], |
| | | }, |
| | | AppType === 'jx' && { |
| | | path: '/BalanceManage', |
| | | redirect: 'noRedirect', |
| | | component: Layout, |
| | | hidden: false, |
| | | alwaysShow: true, |
| | | meta: { |
| | | rank: 10010, |
| | | title: '余额管理', |
| | | rootMenu: true, |
| | | icon: 'home', |
| | | }, |
| | | children: [ |
| | | { |
| | | path: '/BalanceManage', |
| | | name: 'BalanceManage', |
| | | hidden: false, |
| | | alwaysShow: true, |
| | | component: () => import('@/views/BalanceManage/BalanceManage.vue'), |
| | | meta: { |
| | | rank: 10011, |
| | | title: '余额管理', |
| | | // rootMenu: true, |
| | | icon: 'home', |
| | | }, |
| | | }, |
| | | ], |
| | | }, |
| | | // { |
| | | // path: '/FileManage', |
| | | // redirect: 'noRedirect', |
| | | // component: Layout, |
| | | // hidden: false, |
| | | // alwaysShow: true, |
| | | // meta: { |
| | | // rank: 10020, |
| | | // title: '文件管理', |
| | | // rootMenu: true, |
| | | // icon: 'home', |
| | | // }, |
| | | // children: [ |
| | | // { |
| | | // path: '/FileManage', |
| | | // name: 'FileManage', |
| | | // hidden: false, |
| | | // alwaysShow: true, |
| | | // component: () => import('@/views/FileManage/FileManage.vue'), |
| | | // meta: { |
| | | // rank: 10021, |
| | | // title: '文件管理', |
| | | // icon: 'home', |
| | | // }, |
| | | // }, |
| | | // ], |
| | | // }, |
| | | { |
| | | path: '/Login', |
| | | name: 'Login', |
| | |
| | | }, |
| | | ], |
| | | }, |
| | | ]; |
| | | ].filter(Boolean); |
| | | |
| | | export const asyncRoutes: Route[] = [ |
| | | { |
| | |
| | | }, |
| | | ]; |
| | | |
| | | const { VITE_PUBLIC_PATH } = loadEnv(); |
| | | |
| | | const createRouterFactory = () => |
| | | createRouter({ |
| | | history: createWebHistory(), // hash模式:createWebHashHistory,history模式:createWebHistory |
| | | history: createWebHistory(VITE_PUBLIC_PATH), // hash模式:createWebHashHistory,history模式:createWebHistory |
| | | scrollBehavior(to, from, savedPosition) { |
| | | return new Promise((resolve) => { |
| | | if (savedPosition) { |