Browse Source

路由修改

yangxiao 3 years ago
parent
commit
1b9872e20c

+ 2 - 2
src/router/index.js

@@ -155,11 +155,11 @@ const routes = [
     path: '/health/health4',
     name: 'health4',
     children: [{
-      path: 'healthLineChart', // 健康趋势
+      path: 'healthLineChart/:wtId', // 健康趋势
       component: () => import(/* webpackChunkName: "healthLineChart" */ '../views/HealthControl/healthLineChart.vue'),
     },
     {
-      path: 'healthLineChart2', // 健康趋势
+      path: 'healthLineChart2/:wtId', // 健康趋势
       component: () => import(/* webpackChunkName: "healthLineChart2" */ '../views/HealthControl/healthLineChart2.vue'),
     }],
     component: () => import('../views/HealthControl/Health4.vue'),

+ 5 - 1
src/views/HealthControl/Health4.vue

@@ -31,6 +31,7 @@ export default {
   data() {
     return {
       activeIndex:0,
+      wtId:"",
       menuDatas: [{
         icon: "svg-agc",
         path: "/health/health4/healthLineChart",
@@ -43,7 +44,10 @@ export default {
   },
 
   created() {
-   
+   this.wtId = this.$route.params.wtId;
+   this.menuDatas.forEach(ele=>{
+     ele.path += ('/'+this.wtId);
+   });
   },
   
   methods:{

+ 1 - 1
src/views/HealthControl/Health5.vue

@@ -90,7 +90,7 @@ export default {
     // 跳转按钮
     onClickJump(item){
        this.$router.push({
-        path: `/health/health7/${item.wtId}`
+        path: `/health/health4/healthLineChart2/${item.wtId}`
       });
     }
   }

+ 1 - 1
src/views/HealthControl/healthLineChart.vue

@@ -18,7 +18,7 @@ export default {
   },
 
   created() {
-    
+    this.wtId = this.$route.params.wtId;
   },
   
   methods:{