Selaa lähdekoodia

添加健康报告链接

chenminghua 3 vuotta sitten
vanhempi
commit
a452531625
2 muutettua tiedostoa jossa 35 lisäystä ja 12 poistoa
  1. 11 10
      src/components/other/healthReport/index.vue
  2. 24 2
      src/views/HealthControl/HealthTab2.vue

+ 11 - 10
src/components/other/healthReport/index.vue

@@ -113,7 +113,7 @@
                   faultclass[1].monthwarningnum
                 }}次
               </p>
-              <p class="purple">
+              <p class="purple" v-if="yhmxdbs2.length > 0">
                 隐患集中在{{ yhmxdbs2[0] }}、{{ yhmxdbs2[1] }}、{{
                   yhmxdbs2[2]
                 }}
@@ -253,7 +253,7 @@
               yhbjcount.tdgtime
             }}分钟。
           </el-form-item>
-          <el-form-item class="text-indent-2"
+          <el-form-item class="text-indent-2" v-if="bjyhcount.length > 0"
             >其中以{{ bjyhcount[0].yhmx }}发生频次最高,为{{
               bjyhcount[0].count
             }}次;{{ bjyhcount[1].yhmx }}次之,为{{ bjyhcount[1].count }}次;{{
@@ -1877,20 +1877,21 @@ export default {
                 }
                 if (that.yhmxdbs2.length == 3) break;
               }
-              console.log(that.yhmxdbs2);
 
               // 部件隐患数据频次时长统计
-              that.bjyhcount = [];
               let ybmxdj1 = Object.assign([], ybmxdj);
               let ybmxdj2 = Object.assign([], ybmxdj);
               let array1 = ybmxdj1.sort(that.compare("count"));
               let array2 = ybmxdj2.sort(that.compare("times"));
-              that.bjyhcount.push(array1[0]);
-              that.bjyhcount.push(array1[1]);
-              that.bjyhcount.push(array1[2]);
-              that.bjyhcount.push(array2[0]);
-              that.bjyhcount.push(array2[1]);
-              that.bjyhcount.push(array2[2]);
+              if (array1.length > 0 && array2.length > 0){
+                that.bjyhcount = [];
+                that.bjyhcount.push(array1[0]);
+                that.bjyhcount.push(array1[1]);
+                that.bjyhcount.push(array1[2]);
+                that.bjyhcount.push(array2[0]);
+                that.bjyhcount.push(array2[1]);
+                that.bjyhcount.push(array2[2]);
+              }
             }
 
             //切入切出对比

+ 24 - 2
src/views/HealthControl/HealthTab2.vue

@@ -30,7 +30,10 @@
       <panel class="health-report-panel" :title="'已推荐风机'" :showLine="false">
         <div class="report-items scroll">
           <div class="item" v-for="(item, index) in recommenList" :key="index">
-            <div class="title">风机编号:{{ item.wtid }}</div>
+            <div class="title">
+              <div>风机编号:{{ item.wtid }}</div>
+              <span @click="onClickReport(item)">健康报告</span>
+            </div>
             <div class="info">
               <p>推荐理由:{{ item.reason }}</p>
               <p>推荐检修时间:{{ new Date(item.recodedate).formatDate("yyyy-MM-dd hh:mm:ss") }}</p>
@@ -42,15 +45,17 @@
       </panel>
     </div>
   </div>
+  <health-report :show="reportshow" :params="reportparams" @closed="closed" />
 </template>
 
 <script>
 import VertivalBarLineChart from "../../components/chart/combination/vertival-bar-line-chart.vue";
 import SvgIcon from "../../components/coms/icon/svg-icon.vue";
 import Panel from "../../components/coms/panel/panel.vue";
+import HealthReport from "../../components/other/healthReport/index.vue";
 
 export default {
-  components: { SvgIcon, Panel, VertivalBarLineChart },
+  components: { SvgIcon, Panel, VertivalBarLineChart, HealthReport },
   data() {
     return {
       infoList: [
@@ -61,6 +66,8 @@ export default {
       bardata: { area: [], legend: [], data: [] }, // 损失电量分析echart数值
       lineData: [],
       recommenList: [], // 健康报告推荐
+      reportshow: false, //是否显示健康报告
+      reportparams: undefined,
     };
   },
   created() {
@@ -85,6 +92,14 @@ export default {
         }
       });
     },
+    // 查看健康报告
+    onClickReport(item) {
+      this.reportshow = true;
+      this.reportparams = {
+        wtId: item.wtid,
+        recorddate: new Date(item.createdate).formatDate("yyyy-MM-dd"),
+      };
+    },
     // 损失电量分析  type:1 表示24小时健康趋势,2 表示七天健康趋势 3 表示30天健康趋势
     requestCoulometry(type) {
       let that = this;
@@ -243,7 +258,14 @@ export default {
           color: @gray-l;
           line-height: 37px;
           padding-left: 16px;
+          padding-right: 16px;
           font-size: @fontsize-s;
+          display: flex;
+          flex-direction: row;
+          justify-content: space-between;
+          span {
+            cursor: pointer;
+          }
         }
 
         .info {