Browse Source

点击跳转详情;解决选择某一项后数据不更新

mw_666 3 years ago
parent
commit
2ea4957e94
2 changed files with 19 additions and 1 deletions
  1. 6 0
      src/views/WindSite/pages/Info/Info.vue
  2. 13 1
      src/views/WindSite/pages/Matrix.vue

+ 6 - 0
src/views/WindSite/pages/Info/Info.vue

@@ -234,6 +234,8 @@ export default {
   created() {
     let that = this;
     that.wpId = that.$route.params.wpId;
+	that.wtId = that.$route.params.wtId;
+	this.$router.replace(`/monitor/windsite/info/${that.wpId}/${that.wtId}`);
     that.$nextTick(() => {
       that.requestData(false);
       // that.timmer = setInterval(() => {
@@ -257,6 +259,10 @@ export default {
     //     this.requestData(false);
     //   }, this.$store.state.websocketTimeSec);
     // }
+	sourceMap(res){
+		console.log(res)
+		this.sourceMap = res;
+	}
   }
 };
 </script>

+ 13 - 1
src/views/WindSite/pages/Matrix.vue

@@ -12,7 +12,7 @@
       </div>
     </div>
     <div class="panel-body">
-      <div class="card" v-for="(cItem, cIndex) of sourceMap.fjmap[0]" :key="cIndex" :class="cItem.color">
+      <div class="card" v-for="(cItem, cIndex) of sourceMap.fjmap[0]" :key="cIndex" :class="cItem.color" @click="jumpUrl(cItem.wpId,cItem.wtId)">
         <div class="card-panel">
           <div class="card-left">
             <div class="tag">{{ cItem.wtnum }}</div>
@@ -214,6 +214,17 @@ export default {
         path: `/monitor/windsite/matrix/${res.code}`,
       });
     },
+	jumpUrl(wpId, wtId){
+		if (wpId.indexOf("FDC") !== -1) {
+		  this.$router.push({
+		    path: `/monitor/windsite/info/${wpId}/${wtId}`
+		  });
+		} else {
+		  this.$router.push({
+		    path: `../../windsite/inverter-info/${wpId}/${wtId}`
+		  });
+		}
+	  },
   },
 
   created() {
@@ -307,6 +318,7 @@ export default {
       flex: 1 0 125px;
     }
     .card {
+		cursor: pointer;
       margin-right: 4px;
       margin-top: 4px;
       flex: 1 0 125px;