77 lines
2.2 KiB
JavaScript
77 lines
2.2 KiB
JavaScript
import { createRouter, createWebHistory } from 'vue-router';
|
|
import Layout from '@/layouts/index.vue';
|
|
|
|
import resourceRouter from './modules/resource';
|
|
import traceRouter from './modules/trace';
|
|
import productOperateMainRoutes from './modules/productOperateMain';
|
|
import inputSuppliesRoutes from './modules/inputSupplies';
|
|
import plantingAndBreedingRouter from './modules/plantingAndBreeding';
|
|
import systemRouter from './modules/system';
|
|
|
|
export const constantRoutes = [
|
|
{
|
|
path: '/sub-government-affairs-service/404',
|
|
name: '404',
|
|
component: () => import('@/views/error/404.vue'),
|
|
hidden: true,
|
|
},
|
|
{
|
|
path: '/sub-government-affairs-service/403',
|
|
name: '403',
|
|
component: () => import('@/views/error/403.vue'),
|
|
hidden: true,
|
|
},
|
|
{
|
|
path: '/sub-government-affairs-service',
|
|
name: 'layout',
|
|
component: Layout,
|
|
redirect: '/sub-government-affairs-service/home',
|
|
meta: { title: '农业产业政务平台', icon: 'House' },
|
|
children: [
|
|
{
|
|
path: '/sub-government-affairs-service/home',
|
|
component: () => import('@/views/home/index.vue'),
|
|
name: 'home',
|
|
meta: { title: '首页', icon: 'House' },
|
|
},
|
|
],
|
|
},
|
|
...resourceRouter,
|
|
...productOperateMainRoutes,
|
|
...inputSuppliesRoutes,
|
|
{
|
|
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' },
|
|
},
|
|
],
|
|
},
|
|
// ...plantingAndBreedingRouter,
|
|
...traceRouter,
|
|
// ...systemRouter,
|
|
];
|
|
|
|
/**
|
|
* @Title notFoundRouter(找不到路由)
|
|
*/
|
|
export const notFoundRouter = {
|
|
path: '/sub-government-affairs-service/:pathMatch(.*)',
|
|
name: 'notFound',
|
|
redirect: '/sub-government-affairs-service/404',
|
|
};
|
|
|
|
const router = createRouter({
|
|
history: createWebHistory(),
|
|
routes: constantRoutes,
|
|
});
|
|
|
|
export default router;
|