Переглянути джерело

1.李宁让注释的console.log,减少2秒加载时间;
2.健康报告改

mw_666 3 роки тому
батько
коміт
4fcbc15530

+ 92 - 96
src/components/other/healthReport/index.vue

@@ -142,7 +142,7 @@
           <normal-line-chart :list="qxpcls" />
         </el-form>
       </div>
-
+ 
       <div class="textBox">
         <el-form>
           <el-form-item class="imp fw text-indent-2">对风偏差:</el-form-item>
@@ -194,7 +194,7 @@
           />
         </el-form>
       </div>
-
+ 
       <div class="textBox">
         <el-form>
           <el-form-item class="imp fw text-indent-2">切入切出:</el-form-item>
@@ -227,7 +227,7 @@
           </el-table>
         </el-form>
       </div>
-
+ 
       <div class="textBox">
         <el-form>
           <el-form-item class="imp fw text-indent-2"
@@ -338,7 +338,7 @@
           </el-table>
         </el-form>
       </div>
-
+ 
       <div class="textBox">
         <el-form>
           <el-form-item class="imp fw text-indent-2">故障分类:</el-form-item>
@@ -392,7 +392,7 @@
           </el-table>
         </el-form>
       </div>
-
+ 
       <div class="textBox">
         <el-form>
           <el-form-item class="imp fw text-indent-2"
@@ -432,7 +432,7 @@
           </el-table>
         </el-form>
       </div>
-
+ 
       <div class="textBox">
         <el-form>
           <el-form-item class="imp fw text-indent-2"
@@ -463,7 +463,7 @@
           </el-table>
         </el-form>
       </div>
-
+ 
       <div class="textBox">
         <el-form>
           <el-form-item class="imp fw text-indent-2">发电机:</el-form-item>
@@ -492,7 +492,7 @@
           </el-table>
         </el-form>
       </div>
-
+ 
       <div class="textBox">
         <el-form>
           <el-form-item class="imp fw text-indent-2"
@@ -521,7 +521,7 @@
           >
         </el-form>
       </div>
-
+ 
       <div class="textBox">
         <el-form>
           <el-form-item class="imp fw text-indent-2">齿轮箱:</el-form-item>
@@ -616,7 +616,7 @@
             <el-table-column prop="scz" label="实测值"></el-table-column>
             <el-table-column prop="df" label="得分"></el-table-column>
           </el-table>
-
+ 
           <el-form-item class="imp fw text-indent-2">震动监测:</el-form-item>
           <el-form-item class="text-indent-2">时域分析分析法</el-form-item>
           <el-form-item class="text-indent-2"
@@ -642,7 +642,7 @@
           >
         </el-form>
       </div>
-
+ 
       <div class="textBox">
         <el-form>
           <el-form-item class="imp fw text-indent-2"
@@ -696,7 +696,7 @@
           </el-table>
         </el-form>
       </div>
-
+ 
       <div class="textBox">
         <el-form>
           <el-form-item class="imp fw text-indent-2"
@@ -743,7 +743,7 @@
               :label="sbklyls[0].date"
             ></el-table-column>
           </el-table>
-
+ 
           <el-form-item class="imp fw text-indent-2"
             >2、设备可利用率</el-form-item
           >
@@ -827,7 +827,7 @@
           <div class="logHead">
             {{ datas.year }}年{{ datas.month }}月性能评价明细
           </div>
-
+ 
           <table
             border="1"
             class="xnpjfx"
@@ -867,7 +867,7 @@
           </table>
         </el-form>
       </div>
-
+ 
       <div class="textBox" v-if="Number(datas.isrecommend) == 1">
         <el-form>
           <el-form-item class="imp fw"><b>推荐检修方案</b></el-form-item>
@@ -918,7 +918,7 @@
           >
         </el-form>
       </div>
-
+ 
       <div class="textBox">
         <el-form>
           <el-form-item class="fw" style="margin: 10px 0; text-align: center"
@@ -929,7 +929,7 @@
     </div>
   </el-dialog>
 </template>
-
+ 
 <script>
 import DoubleLineChart from "@com/chart/line/double-line-chart.vue";
 // import ScatterLineChart from "@com/chart/combination/scatter-line-chart.vue";
@@ -1106,7 +1106,7 @@ export default {
       xnpjmx: [],
       pjmxs: [],
       wttragetreportcharts: [],
-
+ 
       zhrank: 2,
       // 维修换件频次
       wxhjpc: [
@@ -1605,7 +1605,7 @@ export default {
       reqData: {},
     };
   },
-
+ 
   props: {
     show: {
       type: Boolean,
@@ -1616,15 +1616,12 @@ export default {
       default: () => {},
     },
   },
-  created() {
-	  this.getReport();
-  },
+  created() {},
   beforeUpdate() {
     var that = this;
     that.$nextTick(() => {
       that.others();
     });
-	
   },
   mounted() {
     this.dialogVisible = this.show;
@@ -1634,7 +1631,7 @@ export default {
       $(".bjyhdb .el-table__header-wrapper table .is-group tr").eq(1).remove();
     },
     yhmxdbMethod({ row, column, rowIndex, columnIndex }) {
-      // 	console.log(rowIndex + "==" + columnIndex)
+      //     console.log(rowIndex + "==" + columnIndex)
       if (rowIndex < 8) {
         if (rowIndex === 0 && columnIndex === 0) {
           return [8, 1];
@@ -1690,22 +1687,22 @@ export default {
         "健康评价报告概述"
       );
     },
-
+ 
     // 关闭弹窗
     dialogClosed() {
       this.dialogVisible = false;
       this.$emit("closed", false);
     },
-
+ 
     // 改变列颜色
     columnStyle({ row, column, rowIndex, columnIndex }) {
       if (columnIndex === 0) {
         return "background:rgb(204,255,255);";
       }
     },
-
+ 
     // 获取报告详情
-    getReport(wtid,recorddate) {
+    getReport() {
       let that = this;
       let reqData = this.params;
       that.API.requestData({
@@ -1714,17 +1711,18 @@ export default {
         baseURL: "http://10.155.32.4:8034/",
         subUrl: "/healthreport/healthReport",
         data: {
-    //       wtid: reqData.wtId,
-		  // date: reqData.recorddate,
-          wtid: wtid,
-          date: recorddate,
+          wtid: reqData.wtId,
+          // wtid: "MG01_01",
+          // date: "2021-07-30",
+          date: reqData.recorddate,
         }, // 请求所携带参数,默认为空,可缺省
         success(res) {
           if (res.code == 200) {
-				that.datas = res.data;
-				that.healthreport = that.datas.healthreport;
-				that.randomInitDate();
-    
+            that.datas = res.data;
+            that.healthreport = res.data.healthreport;
+            that.randomInitDate();
+ 
+            that.qxpcls = [];
             // 功率曲线拟合
             let glqxnh = [
               {
@@ -1738,7 +1736,7 @@ export default {
                 value: [],
               },
             ];
-            that.datas.healthreport.nhglqxs && that.datas.healthreport.nhglqxs.forEach((item) => {
+            res.data.healthreport.nhglqxs && res.data.healthreport.nhglqxs.forEach((item) => {
               if (Number(item.speed) % 1 == 0) {
                 glqxnh[0].value.push({
                   text: item.speed,
@@ -1751,9 +1749,8 @@ export default {
               }
             });
             that.glqxnh = glqxnh;
-
+ 
             //曲线偏差率
-	        that.qxpcls = [];
             let qxpcls = [
               {
                 title: "曲线偏差率",
@@ -1766,7 +1763,7 @@ export default {
                 value: [],
               },
             ];
-            let qxpcl = that.datas.healthreport.qxpcls.sort(that.compare("date"));
+            let qxpcl = res.data.healthreport.qxpcls.sort(that.compare("date"));
             if (qxpcl != null && qxpcl != undefined) {
               for (var i = qxpcl.length - 1; i >= 0; i--) {
                 qxpcls[0].value.push({
@@ -1780,7 +1777,7 @@ export default {
               }
               that.qxpcls = qxpcls;
             }
-
+ 
             // 对风偏差
             that.dfpc = [];
             let dfpc = {
@@ -1806,21 +1803,21 @@ export default {
                 },
               ],
             };
-            that.datas.healthreport.nipples && that.datas.healthreport.nipples.forEach((item) => {
+            res.data.healthreport.nipples && res.data.healthreport.nipples.forEach((item) => {
               let obj = {
                 text: item.pcl,
                 value: item.count,
               };
               dfpc.nipples[0].value.push(obj);
             });
-            that.datas.healthreport.dfpclpowers && that.datas.healthreport.dfpclpowers.forEach((item) => {
+            res.data.healthreport.dfpclpowers && res.data.healthreport.dfpclpowers.forEach((item) => {
               let obj = {
                 text: item.power,
                 value: item.dfpcl,
               };
               dfpc.dfpclpowers[0].value.push(obj);
             });
-            that.datas.healthreport.dfpclSpeeds && that.datas.healthreport.dfpclSpeeds.forEach((item) => {
+            res.data.healthreport.dfpclSpeeds && res.data.healthreport.dfpclSpeeds.forEach((item) => {
               let obj = {
                 text: item.speed,
                 value: item.dfpcl,
@@ -1828,12 +1825,12 @@ export default {
               dfpc.dfpclSpeeds[0].value.push(obj);
             });
             that.dfpc = dfpc;
-
+ 
             // 部件隐患对比
             that.bjyhdbs = [];
-            that.bjyhdbs = that.datas.healthreport.bjyhdbs;
+            that.bjyhdbs = res.data.healthreport.bjyhdbs;
             // 隐患模型对比
-            let ybmxdj = that.datas.healthreport.yhmxdbs;
+            let ybmxdj = res.data.healthreport.yhmxdbs;
             if (ybmxdj != null) {
               for (let item of ybmxdj) {
                 if (item.part.indexOf("传动链")) {
@@ -1880,7 +1877,7 @@ export default {
                 }
                 if (that.yhmxdbs2.length == 3) break;
               }
-
+ 
               // 部件隐患数据频次时长统计
               let ybmxdj1 = Object.assign([], ybmxdj);
               let ybmxdj2 = Object.assign([], ybmxdj);
@@ -1896,19 +1893,19 @@ export default {
                 that.bjyhcount.push(array2[2]);
               }
             }
-
+ 
             //切入切出对比
             that.qrqcs = [];
-            that.datas.healthreport.qrqcs && that.datas.healthreport.qrqcs.forEach((item) => {
+            res.data.healthreport.qrqcs && res.data.healthreport.qrqcs.forEach((item) => {
               item.xfqr = item.xfqr == null ? 0 : item.xfqr.toFixed(2);
               item.xfqc = item.xfqc == null ? 0 : item.xfqc.toFixed(2);
               item.dfqr = item.dfqr == null ? 0 : item.dfqr.toFixed(2);
               item.dfqc = item.dfqc == null ? 0 : item.dfqc.toFixed(2);
               that.qrqcs.push(item);
             });
-
+ 
             //设备可利用率
-            let sbklyls = that.datas.healthreport.sbklyls;
+            let sbklyls = res.data.healthreport.sbklyls;
             that.sbklyls = sbklyls;
             that.sbklyls2 = [];
             let sblyl = Object.assign([], sbklyls);
@@ -1962,9 +1959,9 @@ export default {
               that.sbklyls2.push(sbklyls5);
               that.sbklyls2.push(sbklyls6);
               that.sbklyls2.push(sbklyls7);
-
+ 
               // 风能利用率
-              let fnlyl = that.datas.healthreport.fnlyls;
+              let fnlyl = res.data.healthreport.fnlyls;
               let fnlyl1 = {
                 name: "发电量",
                 q1ysj: fnlyl[2].fdl.toFixed(2),
@@ -2029,15 +2026,15 @@ export default {
               that.fnlyls.push(fnlyl8);
               that.fnlyls.push(fnlyl9);
             }
-
+ 
             // 故障分类
-            that.faultclass = that.datas.healthreport.faultclass.sort(
+            that.faultclass = res.data.healthreport.faultclass.sort(
               that.compare("monthwarningnum")
             );
-
+ 
             // 功率对部件温度影响
             that.partwds = [];
-            let partwds = that.datas.healthreport.partwds;
+            let partwds = res.data.healthreport.partwds;
             let partwd = [];
             partwds && partwds.forEach((item, i) => {
               let bj = "";
@@ -2060,7 +2057,7 @@ export default {
               } else if (item.part.indexOf("cf")) {
                 bj = "测风系统";
               }
-
+ 
               partwd.push({
                 bj: bj,
                 wdcd: item.type,
@@ -2077,10 +2074,10 @@ export default {
               });
             });
             that.partwds = partwd;
-
+ 
             // 性能评价结果
             that.xnpjjg = [];
-            let pjmxs = that.datas.healthreport.pjjgs;
+            let pjmxs = res.data.healthreport.pjjgs;
             if (pjmxs != null && pjmxs != undefined) {
               if (pjmxs[2] != undefined) {
                 let xnpj1 = {
@@ -2110,10 +2107,10 @@ export default {
                 that.xnpjjg.push(xnpj3);
               }
             }
-
+ 
             // 评价结果明细
             that.xnpjmx = [];
-            let pjmx = that.datas.healthreport.pjmxs[0];
+            let pjmx = res.data.healthreport.pjmxs[0];
             that.zhrank = pjmx.rank;
             let xnpjmx1 = {
               lx: "",
@@ -2276,7 +2273,7 @@ export default {
             that.xnpjmx.push(xnpjmx19);
             that.xnpjmx.push(xnpjmx20);
             // 评价明细蜘蛛图
-            let pjmxsE = that.datas.healthreport.pjmxs[0];
+            let pjmxsE = res.data.healthreport.pjmxs[0];
             that.pjmxs = [
               {
                 indicator: [
@@ -2310,7 +2307,7 @@ export default {
                 ],
               },
             ];
-
+ 
             // 部件劣化状态4张图表
             let fdj = [
                 {
@@ -2340,8 +2337,8 @@ export default {
                   value: [],
                 },
               ];
-
-            that.datas.healthreport.wttragetreportcharts && that.datas.healthreport.wttragetreportcharts.forEach((item) => {
+ 
+            res.data.healthreport.wttragetreportcharts && res.data.healthreport.wttragetreportcharts.forEach((item) => {
               var recorddate = new Date(item.recorddate).formatDate(
                 "yyyy-MM-dd hh:mm"
               );
@@ -2496,14 +2493,13 @@ export default {
       this.bjzb.push(obj14);
     },
   },
-
+ 
   watch: {
     show(value) {
       this.dialogVisible = value;
-	  // console.log(value)
-      // if (value) {
-      //   this.datas();
-      // }
+      if (value) {
+        this.getReport();
+      }
     },
     params(res) {
       this.reqData = res;
@@ -2511,66 +2507,66 @@ export default {
   },
 };
 </script>
-
+ 
 <style lang="less" scoped>
 .cDialog {
   position: relative;
-
+ 
   .pdfDom {
     padding: 30px 50px;
   }
-
+ 
   .title {
     text-align: center;
     font-size: 24px;
     font-weight: 700;
   }
-
+ 
   .tableBox {
     width: 100%;
     display: flex;
     justify-content: space-between;
     align-items: center;
-
+ 
     .l,
     .r {
       width: 49%;
       align-self: flex-start;
     }
-
+ 
     .fw {
       font-weight: 700;
     }
   }
-
+ 
   .infoBox {
     margin-top: 10px;
     font-size: 16px;
-
+ 
     .red {
       color: #f25656;
     }
-
+ 
     .purple {
       color: rgb(112, 88, 209);
     }
-
+ 
     .info {
       color: #1595fa;
     }
-
+ 
     p {
       text-indent: 2em;
     }
   }
-
+ 
   .textBox {
     width: 100%;
     margin-top: 10px;
     font-size: 16px;
   }
 }
-
+ 
 .logHead {
   display: flex;
   width: 100%;
@@ -2581,52 +2577,52 @@ export default {
   justify-content: center;
   margin-top: 15px;
 }
-
+ 
 .border-b {
   border-bottom: 1px solid #c0ccda;
 }
-
+ 
 .p-5 {
   padding: 5px;
 }
-
+ 
 .m-b-10 {
   margin-bottom: 10px;
 }
-
+ 
 .text-indent-2 {
   text-indent: 2em;
 }
-
+ 
 .text-indent-4 {
   text-indent: 4em;
 }
 </style>
-
+ 
 <style lang="less">
 .cDialog {
   .cell {
     text-align: center;
   }
-
+ 
   .el-dialog__body {
     max-height: 850px;
     overflow-y: scroll;
     padding: 0;
   }
-
+ 
   .el-form-item.imp {
     .el-form-item__content {
       font-size: 24px;
     }
   }
-
+ 
   .el-form-item {
     margin-bottom: 0;
   }
-
+ 
   .el-table td {
     color: black;
   }
 }
-</style>
+</style>

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

@@ -67,7 +67,7 @@
               <div class="fan-code-label font-md gray-l" style="margin-left:100px">中频:</div>
               <div class="fan-code-value font-md green">{{stoptypemap && stoptypemap.top2type}}</div>
               <div class="fan-code-label font-md gray-l" style="margin-left:65px">低频:</div>
-              <div class="fan-code-value font-md green">{{stoptypemap && stoptypemap.top3type}}</div>
+              <div class="fan-code-value font-md green">{{stoptypemap && (stoptypemap.top3type == 'null'?'暂无数据':stoptypemap.top3type)}}</div>
             </div>
             <!-- <span class="svg-icon svg-icon-white svg-icon-md mg-l-16">
               <SvgIcon svgid="svg-wind-site"></SvgIcon>

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

@@ -45,7 +45,7 @@
       </panel>
     </div>
   </div>
-  <health-report :show="reportshow" :params="reportparams" @closed="closed" />
+  <health-report :show="reportshow" :params="reportparams" @closed="closed"/>
 </template>
 
 <script>

+ 3 - 3
src/views/NewPages/multiple-y-line-chart-normal.vue

@@ -298,9 +298,9 @@ export default {
         xdata() {
             console.log('this.list[0].value:',this.list)
             if(this.list.length > 1){
-                this.list[1].value.forEach((lEle,lIndex)=>{
-                    console.log( this.list[1].value.indexOf(this.list[1].value[lIndex].text == "00:00") )
-                })
+                // this.list[1].value.forEach((lEle,lIndex)=>{
+                //     console.log( this.list[1].value.indexOf(this.list[1].value[lIndex].text == "00:00") )
+                // })
                   return this.list[1]?.value.map((t) => {
                 return t.text;
             });