77 lines
2.2 KiB
JavaScript
Raw Normal View History

2025-01-23 09:27:53 +00:00
import { createRouter, createWebHistory } from 'vue-router';
2025-01-23 01:10:59 +00:00
import Layout from '@/layouts/index.vue';
import resourceRouter from './modules/resource';
2025-03-06 08:16:59 +00:00
import traceRouter from './modules/trace';
2025-03-10 09:05:01 +08:00
import productOperateMainRoutes from './modules/productOperateMain';
2025-03-07 14:36:54 +08:00
import inputSuppliesRoutes from './modules/inputSupplies';
2025-03-11 09:59:39 +01:00
import plantingAndBreedingRouter from './modules/plantingAndBreeding';
2025-03-27 09:11:25 +01:00
import systemRouter from './modules/system';
2025-01-23 01:10:59 +00:00
export const constantRoutes = [
{
2025-02-28 06:28:54 +00:00
path: '/sub-government-affairs-service/404',
2025-01-23 01:10:59 +00:00
name: '404',
component: () => import('@/views/error/404.vue'),
hidden: true,
},
{
2025-02-28 06:28:54 +00:00
path: '/sub-government-affairs-service/403',
2025-01-23 01:10:59 +00:00
name: '403',
component: () => import('@/views/error/403.vue'),
hidden: true,
},
{
2025-02-28 06:28:54 +00:00
path: '/sub-government-affairs-service',
2025-01-23 01:10:59 +00:00
name: 'layout',
component: Layout,
2025-02-28 06:28:54 +00:00
redirect: '/sub-government-affairs-service/home',
2025-06-05 17:40:58 +08:00
meta: { title: '农业产业政务平台', icon: 'House' },
2025-01-23 01:10:59 +00:00
children: [
{
2025-02-28 06:28:54 +00:00
path: '/sub-government-affairs-service/home',
2025-01-23 01:10:59 +00:00
component: () => import('@/views/home/index.vue'),
name: 'home',
2025-02-17 06:43:55 +00:00
meta: { title: '首页', icon: 'House' },
2025-01-23 01:10:59 +00:00
},
],
},
2025-02-27 01:24:25 +00:00
...resourceRouter,
2025-03-10 09:05:01 +08:00
...productOperateMainRoutes,
2025-03-07 14:36:54 +08:00
...inputSuppliesRoutes,
2025-06-16 13:31:47 +08:00
{
path: '/sub-government-affairs-service/output-products',
name: 'outputProducts',
component: Layout,
redirect: '/sub-government-affairs-service/output-products/index',
meta: { title: '产出品管理', icon: 'Box' },
children: [
{
path: '/sub-government-affairs-service/output-products/index',
component: () => import('@/views/outputProductsManage/index.vue'),
name: 'outputProductsIndex',
meta: { title: '产出品管理', icon: 'List' },
},
],
},
2025-05-23 14:33:04 +08:00
// ...plantingAndBreedingRouter,
2025-03-14 10:18:26 +01:00
...traceRouter,
2025-05-23 14:33:04 +08:00
// ...systemRouter,
2025-01-23 01:10:59 +00:00
];
/**
* @Title notFoundRouter(找不到路由)
*/
export const notFoundRouter = {
2025-02-28 06:28:54 +00:00
path: '/sub-government-affairs-service/:pathMatch(.*)',
2025-02-27 01:24:25 +00:00
name: 'notFound',
2025-02-28 06:28:54 +00:00
redirect: '/sub-government-affairs-service/404',
2025-01-23 01:10:59 +00:00
};
const router = createRouter({
2025-02-28 06:28:54 +00:00
history: createWebHistory(),
2025-01-23 01:10:59 +00:00
routes: constantRoutes,
});
export default router;