337 lines
11 KiB
JavaScript
Raw Normal View History

2025-01-25 02:48:00 +00:00
/*
* @Description: router
* @Author: zenghua.wang
* @Date: 2023-06-20 11:48:41
* @LastEditors: zenghua.wang
2025-04-14 02:33:18 +01:00
* @LastEditTime: 2025-04-14 09:27:05
2025-01-25 02:48:00 +00:00
*/
import { createRouter, createWebHistory } from 'vue-router';
import Layout from '@/layouts/index.vue';
import Views from '@/layouts/Views.vue';
2025-04-11 17:32:55 +08:00
import userCentre from '@/layouts/userCentre.vue';
2025-01-25 02:48:00 +00:00
export const constantRoutes = [
{
path: '/sub-operation-service/404',
2025-01-25 02:48:00 +00:00
name: '404',
component: () => import('@/views/error/404.vue'),
hidden: true,
},
{
path: '/sub-operation-service/403',
2025-01-25 02:48:00 +00:00
name: '403',
component: () => import('@/views/error/403.vue'),
hidden: true,
},
2025-05-20 13:05:37 +08:00
// {
// path: '/sub-operation-service/userCenter',
// name: 'userCenter',
// component: () => import('@/views/userCenter/shoppingCart.vue'),
// hidden: true,
// },
{
path: '/sub-operation-service/userCenter',
name: 'userCenter',
// component: Layout,
redirect: '/sub-operation-service/userCenter',
meta: { title: '个人中心' },
children: [
{
path: '/sub-operation-service/userCenter',
component: () => import('@/views/userCenter/shoppingCart.vue'),
name: 'shoppingCart',
meta: { title: '我的购物车' },
},
{
path: '/sub-operation-service/sureOrder',
component: () => import('@/views/userCenter/sureOrder.vue'),
name: 'sureOrder',
meta: { title: '结算' },
},
{
path: '/sub-operation-service/orderSuccess',
component: () => import('@/views/userCenter/orderSuccess.vue'),
name: 'orderSuccess',
meta: { title: '提交订单' },
},
{
path: '/sub-operation-service/paySuccess',
component: () => import('@/views/userCenter/paySuccess.vue'),
name: 'paySuccess',
meta: { title: '支付成功' },
},
{
path: '/sub-operation-service/userOrders',
component: () => import('@/views/userCenter/userOrders.vue'),
name: 'userOrders',
meta: { title: '我的订单' },
},
2025-05-21 10:14:25 +08:00
{
2025-05-20 13:05:37 +08:00
path: '/sub-operation-service/userLands',
component: () => import('@/views/userCenter/userLands.vue'),
name: 'userLands',
meta: { title: '我的土地' },
},
],
},
2025-01-25 02:48:00 +00:00
{
path: '/sub-operation-service',
2025-01-25 02:48:00 +00:00
name: 'layout',
component: Layout,
redirect: '/sub-operation-service/smartFarm',
2025-04-14 02:33:18 +01:00
meta: { title: '运营服务' },
2025-01-25 02:48:00 +00:00
children: [
{
path: '/sub-operation-service/home',
2025-01-25 02:48:00 +00:00
component: () => import('@/views/home/index.vue'),
name: 'home',
2025-04-03 17:20:49 +08:00
meta: { title: '首页' },
2025-01-25 02:48:00 +00:00
},
{
path: '/sub-operation-service/dashboard',
component: () => import('@/views/dashboard/index.vue'),
name: 'dashboard',
meta: { title: '综合看板' },
},
],
},
{
path: '/sub-operation-service/smartFarm',
name: 'smartFarm',
component: Layout,
redirect: '/sub-operation-service/smartFarm/main',
meta: { title: '智慧种植' },
children: [
{
path: '/sub-operation-service/smartFarm/main',
component: () => import('@/views/smartFarm/index.vue'),
name: 'smartFarmMain',
meta: { title: '智慧种植首页' },
},
{
path: '/sub-operation-service/smartFarm/fieldInspection',
2025-05-20 09:48:38 +08:00
component: () => import('@/views/smartFarm/inspection/fieldInspection.vue'),
name: 'fieldInspection',
2025-05-20 09:48:38 +08:00
meta: { title: '田间监测' },
},
{
path: '/sub-operation-service/smartFarm/waterInspection',
component: () => import('@/views/smartFarm/inspection/waterInspection.vue'),
name: 'waterInspection',
meta: { title: '水质监测' },
},
{
path: '/sub-operation-service/smartFarm/bugInspection',
component: () => import('@/views/smartFarm/inspection/bugInspection.vue'),
name: 'bugInspection',
meta: { title: '病虫害监测' },
},
{
path: '/sub-operation-service/smartFarm/envInspection',
component: () => import('@/views/smartFarm/inspection/envInspection.vue'),
name: 'envInspection',
meta: { title: '环境监测' },
},
2025-05-21 10:14:25 +08:00
{
path: '/sub-operation-service/smartFarm/intelligentFertilizer',
component: () => import('@/views/smartFarm/inspection/intelligentFertilizer.vue'),
name: 'intelligentFertilizer',
meta: { title: '智能配肥' },
},
{
path: '/sub-operation-service/smartFarm/growSeedlings',
component: () => import('@/views/smartFarm/growSeedlings/index.vue'),
name: 'growSeedlings',
meta: { title: '一体育苗' },
},
2025-05-20 17:49:10 +08:00
{
path: '/sub-operation-service/smartFarm/pestPrevention',
component: () => import('@/views/smartFarm/pestPrevention/index.vue'),
name: 'pestPrevention',
meta: { title: '病虫害防治' },
},
{
path: '/sub-operation-service/smartFarm/irrigationSystem',
component: () => import('@/views/smartFarm/irrigationSystem/index.vue'),
name: 'irrigationSystem',
meta: { title: '喷灌滴灌' },
},
{
path: '/sub-operation-service/smartFarm/drainageControl',
component: () => import('@/views/smartFarm/drainageControl/index.vue'),
name: 'drainageControl',
meta: { title: '排集水控制' },
},
{
path: '/sub-operation-service/smartFarm/openCurtain',
component: () => import('@/views/smartFarm/openCurtain/index.vue'),
name: 'openCurtain',
meta: { title: '开窗卷帘' },
},
],
},
{
path: '/sub-operation-service/ruralFinance',
name: 'ruralFinance',
component: Layout,
redirect: '/sub-operation-service/ruralFinance/index',
meta: { title: '涉农金融' },
children: [
{
path: '/sub-operation-service/ruralFinance/index',
component: () => import('@/views/ruralFinance/index.vue'),
name: 'ruralFinanceMain',
meta: { title: '涉农金融首页' },
},
],
},
{
path: '/sub-operation-service/packaging',
name: 'packaging',
component: Layout,
redirect: '/sub-operation-service/packaging/index',
meta: { title: '分拣包装' },
children: [
{
path: '/sub-operation-service/packaging/index',
component: () => import('@/views/packaging/index.vue'),
name: 'packagingMain',
meta: { title: '分拣包装首页' },
},
],
},
{
path: '/sub-operation-service/warehouseLogistics',
name: 'warehouseLogistics',
component: Layout,
redirect: '/sub-operation-service/warehouseLogistics/index',
meta: { title: '仓储物流' },
children: [
{
path: '/sub-operation-service/warehouseLogistics/index',
component: () => import('@/views/warehouseLogistics/index.vue'),
name: 'warehouseLogisticsMain',
meta: { title: '仓储物流首页' },
},
],
},
{
path: '/sub-operation-service/brand',
name: 'brand',
component: Layout,
redirect: '/sub-operation-service/brand/index',
meta: { title: '公共品牌' },
children: [
{
path: '/sub-operation-service/brand/index',
component: () => import('@/views/brand/index.vue'),
name: 'brandMain',
meta: { title: '公共品牌首页' },
},
2025-01-25 02:48:00 +00:00
],
},
{
2025-04-09 17:25:08 +08:00
path: '/sub-operation-service/ecommerce',
name: 'ecommerce',
component: Layout,
2025-04-09 17:25:08 +08:00
redirect: '/sub-operation-service/ecommerce-agricultural',
2025-04-03 17:20:49 +08:00
meta: { title: '电商交易' },
children: [
{
2025-04-09 17:25:08 +08:00
path: '/ecommerce',
component: Views,
redirect: '/sub-operation-service/ecommerce-agricultural',
name: 'agriculturalParent',
2025-04-12 15:57:15 +08:00
meta: { title: '农资交易', headerActive: 'ecommerce' },
2025-04-09 17:25:08 +08:00
children: [
{
path: '/sub-operation-service/ecommerce-agricultural',
component: () => import('@/views/ecommerce/index.vue'),
name: 'agricultural',
2025-04-12 15:57:15 +08:00
meta: { title: '农资交易', headerActive: 'ecommerce' },
2025-04-09 17:25:08 +08:00
},
{
2025-04-11 17:32:55 +08:00
path: '/sub-operation-service/ecommerce-agriculturalDetail',
2025-04-09 17:25:08 +08:00
component: () => import('@/views/ecommerce/agriculturalDetail.vue'),
name: 'agriculturalDetail',
2025-04-12 15:57:15 +08:00
meta: { title: '农资详情', headerActive: 'ecommerce' },
2025-04-09 17:25:08 +08:00
},
2025-04-11 17:32:55 +08:00
{
path: '/sub-operation-service/ecommerce-sourceCodeDetail',
component: () => import('@/views/ecommerce/sourceCodeDetail.vue'),
name: 'sourceCodeDetail',
2025-04-12 15:57:15 +08:00
meta: { title: '溯源详情', headerActive: 'ecommerce' },
2025-04-11 17:32:55 +08:00
},
2025-04-09 17:25:08 +08:00
],
},
{
2025-04-09 17:25:08 +08:00
path: '/sub-operation-service/purchaser',
2025-04-03 17:20:49 +08:00
component: Views,
2025-04-09 17:25:08 +08:00
redirect: '/sub-operation-service/ecommerce-purchaser',
2025-04-03 17:20:49 +08:00
name: 'purchaserParent',
2025-04-12 15:57:15 +08:00
meta: { title: '采购商服务', headerActive: 'ecommerce' },
2025-04-03 17:20:49 +08:00
children: [
{
2025-04-09 17:25:08 +08:00
path: '/sub-operation-service/ecommerce-purchaser',
2025-04-03 17:20:49 +08:00
component: () => import('@/views/ecommerce/purchaser.vue'),
name: 'purchaser',
2025-04-12 15:57:15 +08:00
meta: { title: '采购商服务', headerActive: 'ecommerce' },
2025-04-03 17:20:49 +08:00
},
{
2025-04-09 17:25:08 +08:00
path: '/sub-operation-service/ecommerce-purchaserDetail',
2025-04-03 17:20:49 +08:00
component: () => import('@/views/ecommerce/purchaserDetail.vue'),
name: 'purchaserDetail',
2025-04-12 15:57:15 +08:00
meta: { title: '采购详情', headerActive: 'ecommerce' },
2025-04-03 17:20:49 +08:00
},
],
},
2025-04-03 17:20:49 +08:00
{
2025-04-09 17:25:08 +08:00
path: '/sub-operation-service/ecommerce-supplier',
component: () => import('@/views/ecommerce/supplier.vue'),
name: 'supplier',
2025-04-12 15:57:15 +08:00
meta: { title: '供应商服务', headerActive: 'ecommerce' },
},
{
2025-04-09 17:25:08 +08:00
path: '/sub-operation-service/ecommerce-land',
2025-04-03 17:20:49 +08:00
component: Views,
2025-04-09 17:25:08 +08:00
redirect: '/sub-operation-service/ecommerce-land',
2025-04-03 17:20:49 +08:00
name: 'landParent',
2025-04-12 15:57:15 +08:00
meta: { title: '土地交易', headerActive: 'ecommerce' },
2025-04-03 17:20:49 +08:00
children: [
{
2025-04-09 17:25:08 +08:00
path: '/sub-operation-service/ecommerce-land',
2025-04-03 17:20:49 +08:00
component: () => import('@/views/ecommerce/land.vue'),
name: 'land',
2025-04-12 15:57:15 +08:00
meta: { title: '土地交易', headerActive: 'ecommerce' },
2025-04-03 17:20:49 +08:00
},
{
2025-04-09 17:25:08 +08:00
path: '/sub-operation-service/ecommerce-landDetail',
2025-04-03 17:20:49 +08:00
component: () => import('@/views/ecommerce/landDetail.vue'),
name: 'landDetail',
2025-04-12 15:57:15 +08:00
meta: { title: '土地详情', headerActive: 'ecommerce' },
2025-04-03 17:20:49 +08:00
},
],
},
],
},
2025-05-12 17:46:49 +08:00
// ...demo,
2025-01-25 02:48:00 +00:00
];
/**
* @Title notFoundRouter(找不到路由)
*/
export const notFoundRouter = {
path: '/sub-operation-service/:pathMatch(.*)',
2025-01-25 02:48:00 +00:00
name: 'notFound',
redirect: '/sub-operation-service/404',
2025-01-25 02:48:00 +00:00
};
const router = createRouter({
history: createWebHistory(), // history
2025-01-25 02:48:00 +00:00
routes: constantRoutes,
});
export default router;