Просмотр исходного кода

光伏矩阵页面 点击跳转详情页

630 3 лет назад
Родитель
Сommit
5e23c77fcc

+ 1 - 1
src/router/index.js

@@ -73,7 +73,7 @@ const routes = [{
 				component: () =>
 					import( /* webpackChunkName: "windsitetower" */ '../views/WindSite/pages/Tower.vue'),
 			}, {
-				path: 'inverter-info/:wpId',
+				path: 'inverter-info/:wpId/:wtId',
 				component: () =>
 					import( /* webpackChunkName: "inverter-info" */
 					'../views/WindSite/pages/Inverter-Info.vue'),

+ 7 - 2
src/views/LightMatrix/LightMatrix.vue

@@ -69,7 +69,7 @@
             </div>
           </div>
           <div class="panel-body">
-            <div class="card" v-for="(cItem, cIndex) in pItem" :key="cIndex" :class="cItem.color">
+            <div class="card" v-for="(cItem, cIndex) in pItem" :key="cIndex" :class="cItem.color" @click="gotoInverter(cItem)">
               <div class="card-panel">
                 <div class="card-left">
                   <div class="tag">{{ cItem.wtnum }}</div>
@@ -368,6 +368,11 @@ export default {
         },
       });
     },
+    gotoInverter(item){
+      this.$router.push({
+        path: `/monitor/windsite/inverter-info/${item.wpId}/${item.wtId}`,
+      });
+    }
   },
 
   created() {
@@ -754,7 +759,7 @@ export default {
 
       .card {
         border: 1px solid;
-
+        cursor: pointer;
         .card-panel {
           display: flex;
           flex-grow: row;

+ 7 - 1
src/views/WindSite/pages/Inverter-Info.vue

@@ -151,8 +151,12 @@ export default {
     },
     // 点击左侧菜单
     clickMenu(res) {
+      // console.log(res);
+      this.wpId = res.wpId;
       this.wtId = res.wtId;
+      this.$router.replace(`/monitor/windsite/inverter-info/${res.wpId}/${res.wtId}`);
       this.getData();
+      this.getLineChart();
     },
     async buildSelectList() {
       let res = await this.API.requestData({
@@ -288,12 +292,14 @@ export default {
     // 创建前
   },
   created() {
+    // debugger;
+    let that = this;
+    this.wtId = that.$route.params.wtId;
     this.buildSelectList();
     this.getTurbinesState();
     this.getData();
     // this.getDIData();
     this.getLineChart();
-    let that = this;
     that.timmer = setInterval(() => {
       that.getData();
       // that.getDIData();