ufutx_official_website/src/router/index.js
2026-03-03 15:50:38 +08:00

243 lines
5.8 KiB
JavaScript

import { createRouter as _createRouter, createWebHashHistory } from 'vue-router'
// const pages = import.meta.glob('../src/pages/**/*.vue')
// const routes = Object.keys(pages).map((path)=>{
// let name = path.match(/\/pages(.*)\.vue$/)[1].toLowerCase();
// if(name.substring(name.length - 5) == 'index'){
// name = name.slice(0, -5);//去掉最后的index
// }
// return {
// path: name === '/home' ? '/': name,
// component: pages[path]
// }
// })
const routes = [
{
path: '/',
name: 'PageView',
redirect: '/home',
component: () => import('@/view/PageView.vue'),
children: [
{
path: '/home',
name: 'Home',
component: () => import('@/view/HomePage.vue'),
meta: {
title: '首页'
}
},
{
path: '/software',
name: 'software',
component: () => import('@/view/Software.vue'),
redirect: '/software/smartTown',
meta: {
title: '软件产品'
},
children: [
{
path: '/software/smartTown',
name: 'smartTown',
component: () => import('@/view/Software_smartTown.vue'),
meta: {
title: '软件产品丨智能小镇管理系统'
}
},
{
path: '/software/bigData',
name: 'bigData',
component: () => import('@/view/Software_bigData.vue'),
meta: {
title: '软件产品丨大数据管理系统'
}
}
]
},
{
path: '/health',
name: 'health',
component: () => import('@/view/health.vue'),
props: true,
meta: {
title: '智能健康'
}
},
{
path: '/startABusiness',
name: 'startABusiness',
component: () => import('@/view/StartABusiness.vue'),
props: true,
meta: {
title: '友福创业'
}
},
{
path: '/news',
name: 'news',
component: () => import('@/view/News.vue'),
// props: true,
meta: {
title: '友福新闻'
},
children: []
},
{
path: '/news/newsDetail',
name: 'newsDetail',
component: () => import('@/view/newsDetail.vue'),
meta: {
title: '新闻详情'
}
},
{
path: '/joinUs',
name: 'joinUs',
component: () => import('@/view/JoinUs.vue'),
meta: {
title: '加入我们'
}
},
{
path: '/aboutUs',
name: 'aboutUs',
component: () => import('@/view/AboutUs.vue'),
meta: {
title: '关于我们'
}
},
{
path: '/productMap',
name: 'productMap',
component: () => import('@/view/ProductMap.vue'),
meta: {
title: '业务布局'
}
},
{
path: '/servicedetail',
name: 'serviceDetail',
component: () => import('@/view/ServiceDetail.vue'),
props: true,
meta: {
title: '相关服务-详情'
}
},
{
path: '/newsinformation',
name: 'newsInformation',
component: () => import('@/view/NewsInformation.vue'),
meta: {
title: '新闻动态'
}
},
{
path: '/companyintroduction',
name: 'companyIntroduction',
component: () => import('@/view/CompanyIntroduction.vue'),
meta: {
title: '公司介绍'
}
},
{
path: '/jobchance',
name: 'jobChance',
component: () => import('@/view/JobChance.vue'),
meta: {
title: '工作机会'
}
},
{
path: '/contactus',
name: 'contactUs',
component: () => import('@/view/ContactUs.vue'),
meta: {
title: '联系我们'
}
},
{
path: '/examHome',
name: 'examHome',
component: () => import('@/view/examHome.vue'),
meta: {
title: '培训认证系统'
}
},
{
path: '/examDetail',
name: 'examDetail',
component: () => import('@/view/examDetail.vue'),
meta: {
title: '考试详情'
}
},
{
path: '/examGuide',
name: 'examGuide',
component: () => import('@/view/examGuide.vue'),
meta: {
title: '考试说明'
}
},
{
path: '/examHomeReport',
name: 'examHomeReport',
component: () => import('@/view/examHomeReport.vue'),
meta: {
title: '考试说明'
}
},
{
path: '/onlineTest',
name: 'onlineTest',
component: () => import('@/view/onlineTest.vue'),
meta: {
title: '考试内容'
}
},
{
path: '/reportCard',
name: 'reportCard',
component: () => import('@/view/reportCard.vue'),
meta: {
title: '成绩单'
}
},
{
path: '/examPdf',
name: 'examPdf',
component: () => import('@/view/examPdf.vue'),
meta: {
title: '查看'
}
},
{
path: '/examCheckCertificate',
name: 'examCheckCertificate',
component: () => import('@/view/examCheckCertificate.vue'),
meta: {
title: '查询证书'
}
}
]
}
]
export function createRouter() {
return _createRouter({
history: createWebHashHistory(),
routes,
// scrollBehavior (to, from, savedPosition) {
// if (savedPosition) {
// return savedPosition
// } else {
// // vue2.0 x y 控制
// // vue3.0 left top 控制
// return { x: 0, y: 0 }
// }
// }
})
}