121 lines
3.2 KiB
JavaScript

/*
* @Description: router
* @Author: zenghua.wang
* @Date: 2023-06-20 11:48:41
* @LastEditors: zenghua.wang
* @LastEditTime: 2025-04-07 17:24:45
*/
import { createRouter, createWebHistory } from 'vue-router';
import Layout from '@/layouts/index.vue';
import Views from '@/layouts/Views.vue';
export const constantRoutes = [
{
path: '/sub-operation-service/404',
name: '404',
component: () => import('@/views/error/404.vue'),
hidden: true,
},
{
path: '/sub-operation-service/403',
name: '403',
component: () => import('@/views/error/403.vue'),
hidden: true,
},
{
path: '/sub-operation-service',
name: 'layout',
component: Layout,
redirect: '/sub-operation-service/home',
meta: { title: '首页' },
children: [
{
path: '/sub-operation-service/home',
component: () => import('@/views/home/index.vue'),
name: 'home',
meta: { title: '首页' },
},
],
},
{
path: '/ecommerce',
name: 'ecommerce',
component: Layout,
redirect: '/sub-operation-service/ecommerce',
meta: { title: '电商交易' },
children: [
{
path: '/sub-operation-service/ecommerce',
component: () => import('@/views/ecommerce/index.vue'),
name: 'agricultural',
meta: { title: '农资交易' },
},
{
path: '/purchaser',
component: Views,
redirect: '/sub-operation-service/purchaser',
name: 'purchaserParent',
meta: { title: '采购商服务' },
children: [
{
path: '/sub-operation-service/purchaser',
component: () => import('@/views/ecommerce/purchaser.vue'),
name: 'purchaser',
meta: { title: '采购商服务' },
},
{
path: '/sub-operation-service/purchaserDetail',
component: () => import('@/views/ecommerce/purchaserDetail.vue'),
name: 'purchaserDetail',
meta: { title: '采购详情' },
},
],
},
{
path: '/sub-operation-service/supplier',
component: () => import('@/views/ecommerce/supplier.vue'),
name: 'supplier',
meta: { title: '供应商服务' },
},
{
path: '/land',
component: Views,
redirect: '/sub-operation-service/land',
name: 'landParent',
meta: { title: '土地交易' },
children: [
{
path: '/sub-operation-service/land',
component: () => import('@/views/ecommerce/land.vue'),
name: 'land',
meta: { title: '土地交易' },
},
{
path: '/sub-operation-service/landDetail',
component: () => import('@/views/ecommerce/landDetail.vue'),
name: 'landDetail',
meta: { title: '土地详情' },
},
],
},
],
},
];
/**
* @Title notFoundRouter(找不到路由)
*/
export const notFoundRouter = {
path: '/sub-operation-service/:pathMatch(.*)',
name: 'notFound',
redirect: '/sub-operation-service/404',
};
const router = createRouter({
history: createWebHistory(), // history
routes: constantRoutes,
});
export default router;