341 lines
8.1 KiB
TypeScript
341 lines
8.1 KiB
TypeScript
import type { App } from 'vue'
|
|
import { createRouter, createWebHashHistory, type RouteRecordRaw } from 'vue-router'
|
|
|
|
export const Layout = () => import('@/layouts/index.vue')
|
|
|
|
// 静态路由
|
|
export const constantRoutes: RouteRecordRaw[] = [
|
|
{
|
|
path: '/login',
|
|
component: () => import('@/views/login/index.vue'),
|
|
meta: { hidden: true }
|
|
},
|
|
{
|
|
path: '/',
|
|
name: '/',
|
|
component: Layout,
|
|
redirect: '/dashboard',
|
|
children: [
|
|
{
|
|
path: 'dashboard',
|
|
component: () => import('@/views/dashboard/index.vue'),
|
|
// 用于 keep-alive 功能,需要与 SFC 中自动推导或显式声明的组件名称一致
|
|
// 参考文档: https://cn.vuejs.org/guide/built-ins/keep-alive.html#include-exclude
|
|
name: 'Dashboard',
|
|
meta: {
|
|
title: 'dashboard',
|
|
icon: 'homepage',
|
|
affix: true,
|
|
keepAlive: true
|
|
}
|
|
},
|
|
{
|
|
path: '401',
|
|
component: () => import('@/views/error/401.vue'),
|
|
meta: { hidden: true }
|
|
},
|
|
{
|
|
path: '404',
|
|
component: () => import('@/views/error/404.vue'),
|
|
meta: { hidden: true }
|
|
},
|
|
{
|
|
path: 'profile',
|
|
name: 'Profile',
|
|
component: () => import('@/views/profile/index.vue'),
|
|
meta: { title: '个人中心', icon: 'user', hidden: true }
|
|
},
|
|
{
|
|
path: 'my-notice',
|
|
name: 'MyNotice',
|
|
component: () => import('@/views/system/notice/components/MyNotice.vue'),
|
|
meta: { title: '我的通知', icon: 'user', hidden: true }
|
|
},
|
|
{
|
|
path: '/detail/:id(\\d+)',
|
|
name: 'DemoDetail',
|
|
component: () => import('@/views/demo/detail.vue'),
|
|
meta: { title: '详情页缓存', icon: 'user', hidden: true, keepAlive: true }
|
|
}
|
|
]
|
|
},
|
|
// 人员管理模块
|
|
{
|
|
path: '/personnel',
|
|
component: Layout,
|
|
name: 'Personnel',
|
|
meta: {
|
|
title: '人员管理',
|
|
icon: 'setting'
|
|
},
|
|
children: [
|
|
{
|
|
path: 'user',
|
|
name: 'PersonnelUser',
|
|
component: () => import('@/views/calibration/personnelManagement/index.vue'),
|
|
meta: {
|
|
title: '人事管理'
|
|
}
|
|
},
|
|
{
|
|
path: 'role',
|
|
name: 'PersonnelRole',
|
|
component: () => import('@/views/calibration/department/index.vue'),
|
|
meta: {
|
|
title: '角色管理'
|
|
}
|
|
}
|
|
]
|
|
},
|
|
// 财务管理模块
|
|
{
|
|
path: '/finance',
|
|
component: Layout,
|
|
name: 'Finance',
|
|
meta: {
|
|
title: '财务管理',
|
|
icon: 'setting'
|
|
},
|
|
children: [
|
|
{
|
|
path: 'onboardingRegistration',
|
|
name: 'OnboardingRegistration',
|
|
component: () => import('@/views/calibration/onboardingRegistration/index.vue'),
|
|
// component: () => import("@/views/system/user/index.vue"),
|
|
meta: {
|
|
title: '入职财务登记'
|
|
}
|
|
},
|
|
{
|
|
path: 'departure ',
|
|
name: 'Departure',
|
|
component: () => import('@/views/calibration/departureFinancialRegistration/index.vue'),
|
|
meta: {
|
|
title: '离职财务登记'
|
|
}
|
|
},
|
|
{
|
|
path: 'invoiceApplication',
|
|
name: 'InvoiceApplication',
|
|
component: () => import('@/views/calibration/invoiceApplication/index.vue'),
|
|
meta: {
|
|
title: '开票申请'
|
|
}
|
|
},
|
|
{
|
|
path: 'revenueRecognition',
|
|
name: 'RevenueRecognition',
|
|
component: () => import('@/views/calibration/revenueRecognition/index.vue'),
|
|
meta: {
|
|
title: '收入确认'
|
|
}
|
|
},
|
|
{
|
|
path: 'accountAdjustmentApplication',
|
|
name: 'AccountAdjustmentApplication',
|
|
component: () => import('@/views/calibration/accountAdjustmentApplication/index.vue'),
|
|
meta: {
|
|
title: '调账申请'
|
|
}
|
|
},
|
|
{
|
|
path: 'paymentApplicationForm',
|
|
name: 'PaymentApplicationForm',
|
|
component: () => import('@/views/calibration/paymentApplicationForm/index.vue'),
|
|
meta: {
|
|
title: '付款申请单'
|
|
}
|
|
},
|
|
{
|
|
path: 'reimbursement',
|
|
name: 'Reimbursement',
|
|
component: () => import('@/views/calibration/reimbursement/index.vue'),
|
|
meta: {
|
|
title: '报销'
|
|
}
|
|
},
|
|
{
|
|
path: 'salaryBonusAdjustment',
|
|
name: 'SalaryBonusAdjustment',
|
|
component: () => import('@/views/calibration/salaryBonusAdjustment/index.vue'),
|
|
meta: {
|
|
title: '工资/奖金变更'
|
|
}
|
|
}
|
|
]
|
|
},
|
|
// 业务管理模块
|
|
{
|
|
path: '/business',
|
|
component: Layout,
|
|
name: 'Business',
|
|
meta: {
|
|
title: '业务管理',
|
|
icon: 'setting'
|
|
},
|
|
children: [
|
|
{
|
|
path: 'conflictOfInterestSearch',
|
|
name: 'ConflictOfInterestSearch',
|
|
component: () =>
|
|
import('@/views/calibration/businessSystem/conflictOfInterestSearch/index.vue'),
|
|
// component: () => import('@/views/business/conflict/index.vue'),
|
|
meta: {
|
|
title: '利益冲突检索'
|
|
}
|
|
},
|
|
{
|
|
path: 'preRegistration',
|
|
name: 'PreRegistration',
|
|
// component: () => import('@/views/business/preRegistration/index.vue'),
|
|
component: () => import('@/views/calibration/businessSystem/preRegistration/index.vue'),
|
|
meta: {
|
|
title: '预立案登记'
|
|
}
|
|
}
|
|
]
|
|
},
|
|
// 案件管理模块
|
|
{
|
|
path: '/case',
|
|
component: Layout,
|
|
name: 'Case',
|
|
meta: {
|
|
title: '案件管理',
|
|
icon: 'setting'
|
|
},
|
|
children: [
|
|
{
|
|
path: 'caseManagement',
|
|
name: 'CaseManagement',
|
|
component: () => import('@/views/calibration/caseManagement/index.vue'),
|
|
meta: {
|
|
title: '案件管理'
|
|
}
|
|
}
|
|
]
|
|
},
|
|
// 申请用印
|
|
{
|
|
path: '/stamp',
|
|
name: 'StampApplication',
|
|
component: Layout,
|
|
meta: {
|
|
title: '申请用印',
|
|
icon: 'setting'
|
|
},
|
|
redirect: '/stamp/index',
|
|
children: [
|
|
{
|
|
path: 'index',
|
|
name: 'StampApplicationIndex',
|
|
component: () => import('@/views/stamp-application/index.vue'),
|
|
meta: {
|
|
title: '申请用印'
|
|
}
|
|
}
|
|
]
|
|
},
|
|
// 业绩
|
|
{
|
|
path: '/performance',
|
|
name: 'StampPerformance',
|
|
component: Layout,
|
|
meta: {
|
|
title: '业绩展示',
|
|
icon: 'setting'
|
|
},
|
|
redirect: '/performance/index',
|
|
children: [
|
|
{
|
|
path: 'index',
|
|
name: 'StampPerformanceIndex',
|
|
component: () => import('@/views/performance/list/index.vue'),
|
|
meta: {
|
|
title: '业绩展示'
|
|
}
|
|
}
|
|
]
|
|
},
|
|
// 入库登记
|
|
{
|
|
path: '/registration',
|
|
name: 'Registration',
|
|
component: Layout,
|
|
meta: {
|
|
title: '入库登记',
|
|
icon: 'setting'
|
|
},
|
|
redirect: '/registration/index',
|
|
children: [
|
|
{
|
|
path: 'index',
|
|
name: 'RegistrationIndex',
|
|
component: () => import('@/views/registration/index.vue'),
|
|
meta: {
|
|
title: '入库登记'
|
|
}
|
|
}
|
|
]
|
|
},
|
|
// 公告
|
|
{
|
|
path: '/notice',
|
|
name: 'Notice',
|
|
component: Layout,
|
|
meta: {
|
|
title: '公告管理',
|
|
icon: 'setting'
|
|
},
|
|
redirect: '/notice/index',
|
|
children: [
|
|
{
|
|
path: 'index',
|
|
name: 'NoticeIndex',
|
|
component: () => import('@/views/notice/index.vue'),
|
|
meta: {
|
|
title: '公告管理'
|
|
}
|
|
}
|
|
]
|
|
},
|
|
// 律所标准文件
|
|
{
|
|
path: '/lawyer-file',
|
|
name: 'LawyerFile',
|
|
component: Layout,
|
|
meta: {
|
|
title: '律所标准文件',
|
|
icon: 'setting'
|
|
},
|
|
redirect: '/lawyer-file/index',
|
|
children: [
|
|
{
|
|
path: 'index',
|
|
name: 'LawyerFileIndex',
|
|
component: () => import('@/views/lawyer/index.vue'),
|
|
meta: {
|
|
title: '律所标准文件'
|
|
}
|
|
}
|
|
]
|
|
}
|
|
]
|
|
|
|
/**
|
|
* 创建路由
|
|
*/
|
|
const router = createRouter({
|
|
history: createWebHashHistory(),
|
|
routes: constantRoutes,
|
|
// 刷新时,滚动条位置还原
|
|
scrollBehavior: () => ({ left: 0, top: 0 })
|
|
})
|
|
|
|
// 全局注册 router
|
|
export function setupRouter(app: App<Element>) {
|
|
app.use(router)
|
|
}
|
|
|
|
export default router
|