From 92e4c0f5deeba69d52603da02bea2ab7836bb9f6 Mon Sep 17 00:00:00 2001
From: web <candymxq888@outlook.com>
Date: 星期一, 05 五月 2025 17:21:08 +0800
Subject: [PATCH] fix:修改水温深度选择

---
 src/router/index.js |  165 ++++++++++++++++++++++++++++++------------------------
 1 files changed, 91 insertions(+), 74 deletions(-)

diff --git a/src/router/index.js b/src/router/index.js
index f901959..88ad225 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -7,9 +7,6 @@
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
 import { createWebHashHistory, createRouter } from 'vue-router'
-/* Layout */
-import Layout from '@/layout'
-import Screen from '@/screen'
 
 /**
  * Note: 路由配置项
@@ -33,82 +30,14 @@
 // 公共路由
 export const constantRoutes = [
   {
-    path: '/redirect',
-    component: Layout,
-    hidden: true,
-    children: [
-      {
-        path: '/redirect/:path(.*)',
-        component: () => import('@/views/redirect/index.vue')
-      }
-    ]
-  },
-  {
     path: '/',
-    component: Layout,
-    redirect: '/user',
-    children: [
-      {
-        path: '/userCenter',
-        component: () => import('@/views/userCenter.vue'),
-        name: 'userCenter',
-        meta: { title: '个人中心', icon: 'PhUserCircleFill', affix: true }
-      },
-    ]
+    hidden: true,
+    redirect: '/screen',
   },
   {
     path: '/login',
     component: () => import('@/views/login'),
     hidden: true
-  },
-  {
-    path: '/screen',
-    component: Screen,
-    redirect: '/overview',
-    children: [
-      {
-        path: '/overview',
-        component: () => import('@/views/screen/overView/index'),
-        name: 'overview',
-        meta: { title: '总览'}
-      },
-      {
-        path: '/irrigate',
-        component: () => import('@/views/screen/irrigate/index'),
-        name: 'irrigate',
-        meta: { title: '智慧灌溉'}
-      },
-      {
-        path: '/revenue',
-        component: () => import('@/views/screen/revenue/index'),
-        name: 'revenue',
-        meta: { title: '营收管理'}
-      },
-      {
-        path: '/facility-screen',
-        component: () => import('@/views/screen/facility/index'),
-        name: 'facility',
-        meta: { title: '设备管理'}
-      },
-      {
-        path: '/statistics',
-        component: () => import('@/views/screen/statistics/index'),
-        name: 'statistics',
-        meta: { title: '统计分析'}
-      },
-      {
-        path: '/alarm-screen',
-        component: () => import('@/views/screen/alarm/index'),
-        name: 'alarm',
-        meta: { title: '报警管理'}
-      },
-      {
-        path: '/pump',
-        component: () => import('@/views/screen/pump/index'),
-        name: 'pump',
-        meta: { title: '泵站控制'}
-      },
-    ]
   },
   {
     path: "/:pathMatch(.*)*",
@@ -120,6 +49,94 @@
     component: () => import('@/views/error/401'),
     hidden: true
   },
+  {
+    path: '/screen',
+    component: () => import('@/screen/index.vue'),
+    hidden: true
+  },
+  {
+    path: '',  //单独添加得后台路由,需要一层layout
+    hidden: true,
+    component: () => import('@/layout/index.vue'),
+    children: [
+      {
+        path: '/userCenter',
+        component: () => import('@/views/userCenter.vue'),
+        name: 'userCenter',
+        meta: { title: '个人中心', icon: 'PhUserCircleFill', affix: true }
+      },
+    ]
+  }
+]
+
+// 流量大屏路由
+const FlowScreenRouter = [
+  {
+    path: '/flow',
+    component: () => import('@/screen/flow.vue'),
+    redirect: '/flow/home',
+    children: [
+      {
+        path: 'home',
+        component: () => import('@/views/screen/flow/home/index.vue')
+      },
+      {
+        path: 'ecology',
+        component: () => import('@/views/screen/flow/ecology/index.vue')
+      },
+      {
+        path: 'graphic/:id?',
+        component: () => import('@/views/screen/flow/graphic/index.vue')
+      },
+      {
+        path: 'shebei',
+        component: () => import('@/views/screen/flow/shebei/index.vue')
+      },
+      {
+        path: 'warning',
+        component: () => import('@/views/screen/flow/warning/index.vue')
+      },
+      {
+        path: 'report',
+        component: () => import('@/views/screen/flow/report/index.vue')
+      },
+    ]
+  },
+]
+
+// 温度大屏路由
+const TempScreenRouter = [
+  {
+    path: '/temp',
+    component: () => import('@/screen/temp.vue'),
+    redirect: '/temp/home',
+    children: [
+      {
+        path: 'home',
+        component: () => import('@/views/screen/temperature/home/index.vue')
+      },
+      {
+        path: 'shebei',
+        component: () => import('@/views/screen/temperature/shebei/index.vue')
+      },
+      {
+        path: 'monitor',
+        component: () => import('@/views/screen/temperature/monitor/index.vue')
+      },
+      {
+        path: 'graphic',
+        component: () => import('@/views/screen/temperature/graphic/index.vue')
+      },
+      {
+        path: 'statics',
+        component: () => import('@/views/screen/temperature/statics/index.vue')
+      },
+      {
+        path: 'report',
+        component: () => import('@/views/screen/temperature/report/index.vue')
+      },
+    ]
+  }
 ]
 
 // 动态路由,基于用户权限动态去加载
@@ -128,7 +145,7 @@
 
 const router = createRouter({
   history: createWebHashHistory(),
-  routes: constantRoutes,
+  routes: [...constantRoutes, ...FlowScreenRouter, ...TempScreenRouter],
   scrollBehavior(to, from, savedPosition) {
     if (savedPosition) {
       return savedPosition

--
Gitblit v1.9.3