From 67f022d15637e276e8c9018a6629a6a1397dd815 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=85=B4=E5=87=AF?= <2448379534@qq.com> Date: Tue, 12 May 2026 14:34:58 +0800 Subject: [PATCH] =?UTF-8?q?=20=E5=8F=B3=E4=BE=A7=E6=A8=A1=E5=9D=97?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../JiuZhuZhanQingKuangJieShao.vue | 286 +++++++++++ .../xianZhiYanChenBianHua/index.vue | 203 ++++++++ frontend/src/modules/waterQuality/index.vue | 479 ++++++++++++++++++ frontend/src/permission.ts | 14 +- .../views/home/shuiDianKaiFaZhuangKuang.vue | 4 +- 5 files changed, 976 insertions(+), 10 deletions(-) create mode 100644 frontend/src/modules/DongWuJiuZhuZhan/JiuZhuZhanQingKuangJieShao.vue create mode 100644 frontend/src/modules/shengTaiLiuLiangXieFangSheShiMod/xianZhiYanChenBianHua/index.vue create mode 100644 frontend/src/modules/waterQuality/index.vue diff --git a/frontend/src/modules/DongWuJiuZhuZhan/JiuZhuZhanQingKuangJieShao.vue b/frontend/src/modules/DongWuJiuZhuZhan/JiuZhuZhanQingKuangJieShao.vue new file mode 100644 index 0000000..e1ac0ce --- /dev/null +++ b/frontend/src/modules/DongWuJiuZhuZhan/JiuZhuZhanQingKuangJieShao.vue @@ -0,0 +1,286 @@ + + + + + + \ No newline at end of file diff --git a/frontend/src/modules/shengTaiLiuLiangXieFangSheShiMod/xianZhiYanChenBianHua/index.vue b/frontend/src/modules/shengTaiLiuLiangXieFangSheShiMod/xianZhiYanChenBianHua/index.vue new file mode 100644 index 0000000..6e33b0f --- /dev/null +++ b/frontend/src/modules/shengTaiLiuLiangXieFangSheShiMod/xianZhiYanChenBianHua/index.vue @@ -0,0 +1,203 @@ + + + + + + \ No newline at end of file diff --git a/frontend/src/modules/waterQuality/index.vue b/frontend/src/modules/waterQuality/index.vue new file mode 100644 index 0000000..d8cb6b6 --- /dev/null +++ b/frontend/src/modules/waterQuality/index.vue @@ -0,0 +1,479 @@ + + + + + + + diff --git a/frontend/src/permission.ts b/frontend/src/permission.ts index d4ac5cb..ce1a107 100644 --- a/frontend/src/permission.ts +++ b/frontend/src/permission.ts @@ -16,17 +16,17 @@ function normalizeRoutes(routes: any[]): any[] { return routes.map(route => { // 创建副本以避免直接修改原始数据(可选,视具体需求而定) const normalizedRoute = { ...route }; - + // 修正当前路由的 path if (normalizedRoute.path && !normalizedRoute.path.startsWith('/')) { normalizedRoute.path = `/${normalizedRoute.path}`; } - + // 递归修正子路由 if (normalizedRoute.children && normalizedRoute.children.length > 0) { normalizedRoute.children = normalizeRoutes(normalizedRoute.children); } - + return normalizedRoute; }); } @@ -55,8 +55,6 @@ router.beforeEach(async (to, from, next) => { if (userStore.Token) { // 登录成功,跳转到首页 - if (to.path === '/login') { - //login if (to.path === '/login') { //login next({ path: '/' }); @@ -84,10 +82,12 @@ router.beforeEach(async (to, from, next) => { const { roles } = await userStore.getInfo(); let accessRoutes: RouteRecordRaw[] = await permissionStore.generateRoutes(roles); - + // ✅ 关键修复:在添加路由前,标准化所有路径 accessRoutes = normalizeRoutes(accessRoutes); + console.log('Normalized Access Routes:', accessRoutes); + accessRoutes.forEach((route: any) => { console.log('Adding Route:', route.path); router.addRoute(route); @@ -125,4 +125,4 @@ router.beforeEach(async (to, from, next) => { router.afterEach(() => { NProgress.done(); -}); +}); \ No newline at end of file diff --git a/frontend/src/views/home/shuiDianKaiFaZhuangKuang.vue b/frontend/src/views/home/shuiDianKaiFaZhuangKuang.vue index 17d7a41..b81a98d 100644 --- a/frontend/src/views/home/shuiDianKaiFaZhuangKuang.vue +++ b/frontend/src/views/home/shuiDianKaiFaZhuangKuang.vue @@ -29,14 +29,12 @@ const showMapModal = () => { modelStore.modalVisible = true; modelStore.params.sttp = "ENG"; modelStore.title = "三峡 详情信息"; - modelStore.currentTabKey = "basicInfo"; modelStore.isBasicEdit = true; }; const showMapModal1 = () => { modelStore.modalVisible = true; modelStore.params.sttp = "zh"; - modelStore.title = "三峡222 详情信息"; - modelStore.currentTabKey = "basicInfo"; + modelStore.title = "水质 详情信息"; modelStore.isBasicEdit = false; // modelStore.modalVisible = true; // modelStore.params.sttp = "zh";