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

Merge branch 'yx' of http://61.161.152.110:10101/r/electronic-map into yx

Koishi 3 роки тому
батько
коміт
f67477e9ed

+ 3 - 3
src/components/chart/line/double-line-chart.vue

@@ -232,8 +232,8 @@ export default {
         },
         grid: {
           top: 16,
-          left: 32,
-          right: 8,
+          left: 40,
+          right: 15,
           bottom: 24,
         },
         xAxis: [
@@ -244,7 +244,7 @@ export default {
               formatter: "{value}",
               textStyle: {
                 color: partten.getColor("gray"),
-                fontSize: util.vh(14),
+                fontSize: util.vh(10),
               },
             },
             data: this.xdata,

+ 427 - 345
src/components/other/healthReport/index.vue

@@ -236,10 +236,18 @@
             }}分钟。
           </el-form-item>
           <el-form-item class="text-indent-2"
-            >其中以{{bjyhcount[0].yhmx}}发生频次最高,为{{bjyhcount[0].count}}次;{{bjyhcount[1].yhmx}}次之,为{{bjyhcount[1].count}}次;{{bjyhcount[2].yhmx}}第三,为{{bjyhcount[0].count}}次。
+            >其中以{{ bjyhcount[0].yhmx }}发生频次最高,为{{
+              bjyhcount[0].count
+            }}次;{{ bjyhcount[1].yhmx }}次之,为{{ bjyhcount[1].count }}次;{{
+              bjyhcount[2].yhmx
+            }}第三,为{{ bjyhcount[0].count }}次。
           </el-form-item>
           <el-form-item class="text-indent-2"
-            >其中以{{bjyhcount[3].yhmx}}发生时长最长,为{{bjyhcount[3].times}}分钟;{{bjyhcount[4].yhmx}}次之,为{{bjyhcount[4].yhmx}}分钟;{{bjyhcount[5].yhmx}}第三,为{{bjyhcount[5].yhmx}}分钟。
+            >其中以{{ bjyhcount[3].yhmx }}发生时长最长,为{{
+              bjyhcount[3].times
+            }}分钟;{{ bjyhcount[4].yhmx }}次之,为{{
+              bjyhcount[4].yhmx
+            }}分钟;{{ bjyhcount[5].yhmx }}第三,为{{ bjyhcount[5].yhmx }}分钟。
           </el-form-item>
           <div class="logHead">部件隐患对比(次|分钟)</div>
           <el-table
@@ -320,7 +328,7 @@
             统计周期内,机舱振动类故障频次为88次,持续时长51分钟。(只显示发生故障的,如没有发生过故障的不用文字描述)
           </el-form-item>
           <el-form-item class="text-indent-2">
-			<!-- 其中以(明细故障mwData)发生频次最高,为mwData次;(明细故障mwData)次之,为mwData次;(明细故障mwData)第三,为mwData次。 -->
+            <!-- 其中以(明细故障mwData)发生频次最高,为mwData次;(明细故障mwData)次之,为mwData次;(明细故障mwData)第三,为mwData次。 -->
           </el-form-item>
           <div class="logHead">故障分类统计</div>
           <el-table
@@ -484,7 +492,11 @@
           <el-form-item class="text-indent-2"
             >频域分析法:根据震动检测提供频域分析结果,现有设备运行正常</el-form-item
           >
-          <multiple-line-chart :showLegend="true" :hoverType="'axis'" :list="wttragetreportcharts.fdj"/>
+          <multiple-line-chart
+            :showLegend="true"
+            :hoverType="'axis'"
+            :list="wttragetreportcharts.fdj"
+          />
           <el-form-item class="imp fw text-indent-2">统计分析:</el-form-item>
           <el-form-item class="text-indent-2"
             >发电机类故障,平均故障周期在12个月,上次故障距此次评价时间为5个月,发电机处于平稳运行周期。</el-form-item
@@ -498,7 +510,11 @@
           <el-form-item class="text-indent-2">
             齿轮箱采用“齿轮箱温度”为关键参数,该参数在统计周期内数据显示样本超出了劣化区,并且有明显的瞬时的上升趋势,引发了温度超限报警一次,恢复后运行平稳,该风机齿轮箱历史总体运行正常,近期存在报警信息,状态评价为良。
           </el-form-item>
-          <multiple-line-chart :showLegend="true" :hoverType="'axis'" :list="wttragetreportcharts.clx"/>
+          <multiple-line-chart
+            :showLegend="true"
+            :hoverType="'axis'"
+            :list="wttragetreportcharts.clx"
+          />
           <el-form-item class="imp fw text-indent-2">主轴:</el-form-item>
           <el-form-item class="text-indent-2"
             >关键参数:主轴采用“主轴承温度”、“主轴承油脂启动时间间隔”
@@ -542,7 +558,11 @@
           <el-form-item class="text-indent-2"
             >频域分析法:根据震动检测提供频域分析结果,现有设备运行正常</el-form-item
           >
-          <multiple-line-chart :showLegend="true" :hoverType="'axis'" :list="wttragetreportcharts.zk"/>
+          <multiple-line-chart
+            :showLegend="true"
+            :hoverType="'axis'"
+            :list="wttragetreportcharts.zk"
+          />
           <el-form-item class="imp fw">统计分析:</el-form-item>
           <el-form-item class="text-indent-2"
             >发电机类故障,平均故障周期在12个月,上次故障距此次评价时间为5个月,发电机处于平稳运行周期。</el-form-item
@@ -593,7 +613,11 @@
           <el-form-item class="text-indent-2"
             >频域分析法:根据震动检测提供频域分析结果,现有设备运行正常</el-form-item
           >
-          <multiple-line-chart :showLegend="true" :hoverType="'axis'" :list="wttragetreportcharts.bj"/>
+          <multiple-line-chart
+            :showLegend="true"
+            :hoverType="'axis'"
+            :list="wttragetreportcharts.bj"
+          />
           <el-form-item class="imp fw text-indent-2">统计分析:</el-form-item>
           <el-form-item class="text-indent-2"
             >发电机类故障,平均故障周期在12个月,上次故障距此次评价时间为5个月,发电机处于平稳运行周期。</el-form-item
@@ -798,26 +822,29 @@
                 <div class="border-b p-5">风机编号:{{ datas.wtname }}</div>
                 <div class="border-b">量化评级:{{ healthreport.pjjg }}</div>
                 <div class="border-b">综合排名:{{ zhrank }}</div>
-                <normal-radar-chart height="500px" width="500px" :value="pjmxs"/>
-              </td>
-              <td valign="top">
-			 <td style="display: flex;justify-content: center">基础指标</td>   
-                <el-table
-                  empty-text="暂无数据"
-                  :data="xnpjmx"
-                  :header-cell-style="{ color: '#000' }"
-                  border
-                  stripe
-                  max-height="570"
-                  style="width: 100%"
-                >
-                  <el-table-column prop="lx" label="类型"></el-table-column>
-                  <el-table-column prop="zb" label="指标"></el-table-column>
-                  <el-table-column prop="sz" label="数值"></el-table-column>
-                  <el-table-column prop="pm" label="排名"></el-table-column>
-                  <el-table-column prop="pf" label="评分"></el-table-column>
-                </el-table>
+                <normal-radar-chart
+                  height="500px"
+                  width="500px"
+                  :value="pjmxs"
+                />
               </td>
+              <td valign="top"></td>
+              <td style="display: flex; justify-content: center">基础指标</td>
+              <el-table
+                empty-text="暂无数据"
+                :data="xnpjmx"
+                :header-cell-style="{ color: '#000' }"
+                border
+                stripe
+                max-height="570"
+                style="width: 100%"
+              >
+                <el-table-column prop="lx" label="类型"></el-table-column>
+                <el-table-column prop="zb" label="指标"></el-table-column>
+                <el-table-column prop="sz" label="数值"></el-table-column>
+                <el-table-column prop="pm" label="排名"></el-table-column>
+                <el-table-column prop="pf" label="评分"></el-table-column>
+              </el-table>
             </tr>
           </table>
         </el-form>
@@ -887,7 +914,7 @@
 
 <script>
 import DoubleLineChart from "@com/chart/line/double-line-chart.vue";
-import ScatterLineChart from "@com/chart/combination/scatter-line-chart.vue";
+// import ScatterLineChart from "@com/chart/combination/scatter-line-chart.vue";
 import NormalLineChart from "@com/chart/line/normal-line-chart.vue";
 import NormalRadarChart from "@com/chart/radar/normal-radar-chart.vue";
 import MultipleLineChart from "@com/chart/line/double-line-chart.vue";
@@ -896,7 +923,7 @@ import $ from "jquery";
 export default {
   components: {
     DoubleLineChart,
-    ScatterLineChart,
+    // ScatterLineChart,
     NormalLineChart,
     MultipleLineChart,
     NormalRadarChart,
@@ -905,7 +932,6 @@ export default {
     return {
       datas: {},
       healthreport: {},
-      glqxnh: {},
       // 对风偏差
       dfpc: {
         nipples: [
@@ -1571,107 +1597,7 @@ export default {
       default: () => {},
     },
   },
-  created() {
-    //   Math.floor(Math.random() * 70) + 50
-    let obj1 = {
-      partname: "曲线偏差率(5-11m/s)",
-      q1yjkqk: (Math.random() * 15).toFixed(2),
-      q2yjkqk: (Math.random() * 15).toFixed(2),
-      q3yjkqk: (Math.random() * 15).toFixed(2),
-    };
-    let obj2 = {
-      partname: "对风偏差率(5-11m/s)",
-      q1yjkqk: (Math.random() * 10).toFixed(2),
-      q2yjkqk: (Math.random() * 10).toFixed(2),
-      q3yjkqk: (Math.random() * 10).toFixed(2),
-    };
-    let obj3 = {
-      partname: "小风切入",
-      q1yjkqk: (Math.random() + 2.8).toFixed(2),
-      q2yjkqk: (Math.random() + 2.8).toFixed(2),
-      q3yjkqk: (Math.random() + 2.8).toFixed(2),
-    };
-    let obj4 = {
-      partname: "小风切出",
-      q1yjkqk: (Math.random() + 2.5).toFixed(2),
-      q2yjkqk: (Math.random() + 2.5).toFixed(2),
-      q3yjkqk: (Math.random() + 2.5).toFixed(2),
-    };
-    let obj5 = {
-      partname: "部件隐患",
-      q1yjkqk: "主轴",
-      q2yjkqk: "齿轮箱",
-      q3yjkqk: "齿轮箱",
-    };
-    let obj6 = {
-      partname: "故障",
-      q1yjkqk: "液压类故障",
-      q2yjkqk: "液压类故障",
-      q3yjkqk: "传动链",
-    };
-    let obj7 = {
-      partname: "功率对应温度",
-      q1yjkqk: "齿轮箱",
-      q2yjkqk: "发电机",
-      q3yjkqk: "发电机",
-    };
-    let obj8 = {
-      partname: "发电机",
-      q1yjkqk: "优",
-      q2yjkqk: "良",
-      q3yjkqk: "优",
-    };
-    let obj9 = {
-      partname: "齿轮箱",
-      q1yjkqk: "良",
-      q2yjkqk: "注意",
-      q3yjkqk: "注意",
-    };
-    let obj10 = {
-      partname: "变桨",
-      q1yjkqk: "注意",
-      q2yjkqk: "良",
-      q3yjkqk: "良",
-    };
-    let obj11 = {
-      partname: "主轴",
-      q1yjkqk: "良",
-      q2yjkqk: "良",
-      q3yjkqk: "注意",
-    };
-    let obj12 = {
-      partname: "风能利用率",
-      q1yjkqk: (Math.random() * 10 + 75).toFixed(2),
-      q2yjkqk: (Math.random() * 10 + 75).toFixed(2),
-      q3yjkqk: (Math.random() * 10 + 75).toFixed(2),
-    };
-    let obj13 = {
-      partname: "设备可利用率",
-      q1yjkqk: (Math.random() * 10 + 90).toFixed(2),
-      q2yjkqk: (Math.random() * 10 + 90).toFixed(2),
-      q3yjkqk: (Math.random() * 10 + 90).toFixed(2),
-    };
-    let obj14 = {
-      partname: "性能评价",
-      q1yjkqk: (Math.random() * 10 + 75).toFixed(2),
-      q2yjkqk: (Math.random() * 10 + 75).toFixed(2),
-      q3yjkqk: (Math.random() * 10 + 75).toFixed(2),
-    };
-    this.bjzb.push(obj1);
-    this.bjzb.push(obj2);
-    this.bjzb.push(obj3);
-    this.bjzb.push(obj4);
-    this.bjzb.push(obj5);
-    this.bjzb.push(obj6);
-    this.bjzb.push(obj7);
-    this.bjzb.push(obj8);
-    this.bjzb.push(obj9);
-    this.bjzb.push(obj10);
-    this.bjzb.push(obj11);
-    this.bjzb.push(obj12);
-    this.bjzb.push(obj13);
-    this.bjzb.push(obj14);
-  },
+  created() {},
   beforeUpdate() {
     var that = this;
     that.$nextTick(() => {
@@ -1775,7 +1701,9 @@ export default {
           if (res.code == 200) {
             that.datas = res.data;
             that.healthreport = res.data.healthreport;
+            that.randomInitDate();
 
+            that.qxpcls = [];
             // 功率曲线拟合
             let glqxnh = [
               {
@@ -1790,16 +1718,19 @@ export default {
               },
             ];
             res.data.healthreport.nhglqxs.forEach((item) => {
-              glqxnh[0].value.push({
-                text: item.speed,
-                value: item.bzgl,
-              });
-              glqxnh[1].value.push({
-                text: item.speed,
-                value: item.nhgl,
-              });
+              if (Number(item.speed) % 1 == 0) {
+                glqxnh[0].value.push({
+                  text: item.speed,
+                  value: item.bzgl,
+                });
+                glqxnh[1].value.push({
+                  text: item.speed,
+                  value: item.nhgl,
+                });
+              }
             });
             that.glqxnh = glqxnh;
+
             //曲线偏差率
             let qxpcls = [
               {
@@ -1813,93 +1744,124 @@ export default {
                 value: [],
               },
             ];
-            res.data.healthreport.qxpcls.forEach((item, index) => {
-              qxpcls[0].value.push({
-                text: new Date(item.date).formatDate("yyyy-MM-dd"),
-                value: parseFloat(item.qxpcl.toFixed(2)),
-              });
-              qxpcls[1].value.push({
-                text: new Date(item.date).formatDate("yyyy-MM-dd"),
-                value: parseFloat(item.jzz.toFixed(2)),
-              });
-            });
-            that.qxpcls = qxpcls;
+            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({
+                  text: new Date(qxpcl[i].date).formatDate("yyyy-MM-dd"),
+                  value: Number(qxpcl[i].qxpcl).toFixed(2),
+                });
+                qxpcls[1].value.push({
+                  text: new Date(qxpcl[i].date).formatDate("yyyy-MM-dd"),
+                  value: Number(qxpcl[i].jzz).toFixed(2),
+                });
+              }
+              that.qxpcls = qxpcls;
+            }
 
             // 对风偏差
+            that.dfpc = [];
+            let dfpc = {
+              nipples: [
+                {
+                  title: "频次",
+                  smooth: true,
+                  value: [],
+                },
+              ],
+              dfpclpowers: [
+                {
+                  title: "功率",
+                  smooth: true,
+                  value: [],
+                },
+              ],
+              dfpclSpeeds: [
+                {
+                  title: "风速",
+                  smooth: true,
+                  value: [],
+                },
+              ],
+            };
             res.data.healthreport.nipples.forEach((item) => {
               let obj = {
                 text: item.pcl,
                 value: item.count,
               };
-              that.dfpc.nipples[0].value.push(obj);
+              dfpc.nipples[0].value.push(obj);
             });
             res.data.healthreport.dfpclpowers.forEach((item) => {
               let obj = {
                 text: item.power,
                 value: item.dfpcl,
               };
-              that.dfpc.dfpclpowers[0].value.push(obj);
+              dfpc.dfpclpowers[0].value.push(obj);
             });
             res.data.healthreport.dfpclSpeeds.forEach((item) => {
               let obj = {
                 text: item.speed,
                 value: item.dfpcl,
               };
-              that.dfpc.dfpclSpeeds[0].value.push(obj);
+              dfpc.dfpclSpeeds[0].value.push(obj);
             });
+            that.dfpc = dfpc;
 
             // 部件隐患对比
+            that.bjyhdbs = [];
             that.bjyhdbs = res.data.healthreport.bjyhdbs;
             // 隐患模型对比
             let ybmxdj = res.data.healthreport.yhmxdbs;
-            for (let item of ybmxdj) {
-              if (item.part.indexOf("传动链")) {
-                that.yhbjcount.cdlcount += item.count;
-                that.yhbjcount.cdltime += item.times;
-              }
-              if (item.part.indexOf("测风")) {
-                that.yhbjcount.cfxtcount += item.count;
-                that.yhbjcount.cfxttime += item.times;
-              }
-              if (item.part.indexOf("齿轮箱")) {
-                that.yhbjcount.clxcount += item.count;
-                that.yhbjcount.clxttime += item.times;
-              }
-              if (item.part.indexOf("发电机")) {
-                that.yhbjcount.fdjcount += item.count;
-                that.yhbjcount.fdjtime += item.times;
-              }
-              if (item.part.indexOf("变桨")) {
-                that.yhbjcount.bjcount += item.count;
-                that.yhbjcount.bjtime += item.times;
-              }
-              if (item.part.indexOf("机舱")) {
-                that.yhbjcount.jccount += item.count;
-                that.yhbjcount.jctime += item.times;
-              }
-              if (item.part.indexOf("偏航")) {
-                that.yhbjcount.phcount += item.count;
-                that.yhbjcount.phtime += item.times;
-              }
-              if (item.part.indexOf("塔底柜")) {
-                that.yhbjcount.tdgcount += item.count;
-                that.yhbjcount.tdgtime += item.times;
+            if (ybmxdj != null) {
+              for (let item of ybmxdj) {
+                if (item.part.indexOf("传动链")) {
+                  that.yhbjcount.cdlcount += item.count;
+                  that.yhbjcount.cdltime += item.times;
+                }
+                if (item.part.indexOf("测风")) {
+                  that.yhbjcount.cfxtcount += item.count;
+                  that.yhbjcount.cfxttime += item.times;
+                }
+                if (item.part.indexOf("齿轮箱")) {
+                  that.yhbjcount.clxcount += item.count;
+                  that.yhbjcount.clxttime += item.times;
+                }
+                if (item.part.indexOf("发电机")) {
+                  that.yhbjcount.fdjcount += item.count;
+                  that.yhbjcount.fdjtime += item.times;
+                }
+                if (item.part.indexOf("变桨")) {
+                  that.yhbjcount.bjcount += item.count;
+                  that.yhbjcount.bjtime += item.times;
+                }
+                if (item.part.indexOf("机舱")) {
+                  that.yhbjcount.jccount += item.count;
+                  that.yhbjcount.jctime += item.times;
+                }
+                if (item.part.indexOf("偏航")) {
+                  that.yhbjcount.phcount += item.count;
+                  that.yhbjcount.phtime += item.times;
+                }
+                if (item.part.indexOf("塔底柜")) {
+                  that.yhbjcount.tdgcount += item.count;
+                  that.yhbjcount.tdgtime += item.times;
+                }
               }
-            }
-            that.yhmxdbs = ybmxdj;
+              that.yhmxdbs = ybmxdj;
 
-            // 部件隐患数据频次时长统计
-            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]);
+              // 部件隐患数据频次时长统计
+              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]);
+            }
 
             //切入切出对比
             that.qrqcs = [];
@@ -1912,125 +1874,130 @@ export default {
             });
 
             //设备可利用率
-            that.sbklyls = res.data.healthreport.sbklyls;
-            let sblyl = Object.assign([], res.data.healthreport.sbklyls);
-            let sbklyls1 = {
-              name: "运行小时",
-              q1ysj: sblyl[2].yxxs,
-              q2ysj: sblyl[1].yxxs,
-              q3ysj: sblyl[0].yxxs,
-            };
-            let sbklyls2 = {
-              name: "待机小时",
-              q1ysj: sblyl[2].djxs,
-              q2ysj: sblyl[1].djxs,
-              q3ysj: sblyl[0].djxs,
-            };
-            let sbklyls3 = {
-              name: "非计划检修时间",
-              q1ysj: sblyl[2].fjhjxxs,
-              q2ysj: sblyl[1].fjhjxxs,
-              q3ysj: sblyl[0].fjhjxxs,
-            };
-            let sbklyls4 = {
-              name: "计划检修时间",
-              q1ysj: sblyl[2].jhjxxs,
-              q2ysj: sblyl[1].jhjxxs,
-              q3ysj: sblyl[0].jhjxxs,
-            };
-            let sbklyls5 = {
-              name: "受累小时",
-              q1ysj: sblyl[2].slxs,
-              q2ysj: sblyl[1].slxs,
-              q3ysj: sblyl[0].slxs,
-            };
-            let sbklyls6 = {
-              name: "故障次数",
-              q1ysj: sblyl[2].gzcs == null ? 0 : sblyl[2].gzcs,
-              q2ysj: sblyl[1].gzcs == null ? 0 : sblyl[1].gzcs,
-              q3ysj: sblyl[0].gzcs == null ? 0 : sblyl[0].gzcs,
-            };
-            let sbklyls7 = {
-              name: "设备可利用率",
-              q1ysj: sblyl[2].sbklyl.toFixed(2),
-              q2ysj: sblyl[1].sbklyl.toFixed(2),
-              q3ysj: sblyl[0].sbklyl.toFixed(2),
-            };
-            that.sbklyls2.push(sbklyls1);
-            that.sbklyls2.push(sbklyls2);
-            that.sbklyls2.push(sbklyls3);
-            that.sbklyls2.push(sbklyls4);
-            that.sbklyls2.push(sbklyls5);
-            that.sbklyls2.push(sbklyls6);
-            that.sbklyls2.push(sbklyls7);
+            let sbklyls = res.data.healthreport.sbklyls;
+            that.sbklyls = sbklyls;
+            that.sbklyls2 = [];
+            let sblyl = Object.assign([], sbklyls);
+            if (sblyl != null) {
+              let sbklyls1 = {
+                name: "运行小时",
+                q1ysj: sblyl[2].yxxs,
+                q2ysj: sblyl[1].yxxs,
+                q3ysj: sblyl[0].yxxs,
+              };
+              let sbklyls2 = {
+                name: "待机小时",
+                q1ysj: sblyl[2].djxs,
+                q2ysj: sblyl[1].djxs,
+                q3ysj: sblyl[0].djxs,
+              };
+              let sbklyls3 = {
+                name: "非计划检修时间",
+                q1ysj: sblyl[2].fjhjxxs,
+                q2ysj: sblyl[1].fjhjxxs,
+                q3ysj: sblyl[0].fjhjxxs,
+              };
+              let sbklyls4 = {
+                name: "计划检修时间",
+                q1ysj: sblyl[2].jhjxxs,
+                q2ysj: sblyl[1].jhjxxs,
+                q3ysj: sblyl[0].jhjxxs,
+              };
+              let sbklyls5 = {
+                name: "受累小时",
+                q1ysj: sblyl[2].slxs,
+                q2ysj: sblyl[1].slxs,
+                q3ysj: sblyl[0].slxs,
+              };
+              let sbklyls6 = {
+                name: "故障次数",
+                q1ysj: sblyl[2].gzcs == null ? 0 : sblyl[2].gzcs,
+                q2ysj: sblyl[1].gzcs == null ? 0 : sblyl[1].gzcs,
+                q3ysj: sblyl[0].gzcs == null ? 0 : sblyl[0].gzcs,
+              };
+              let sbklyls7 = {
+                name: "设备可利用率",
+                q1ysj: sblyl[2].sbklyl.toFixed(2),
+                q2ysj: sblyl[1].sbklyl.toFixed(2),
+                q3ysj: sblyl[0].sbklyl.toFixed(2),
+              };
+              that.sbklyls2.push(sbklyls1);
+              that.sbklyls2.push(sbklyls2);
+              that.sbklyls2.push(sbklyls3);
+              that.sbklyls2.push(sbklyls4);
+              that.sbklyls2.push(sbklyls5);
+              that.sbklyls2.push(sbklyls6);
+              that.sbklyls2.push(sbklyls7);
 
-            // 风能利用率
-            let fnlyl = res.data.healthreport.fnlyls;
-            let fnlyl1 = {
-              name: "发电量",
-              q1ysj: fnlyl[2].fdl.toFixed(2),
-              q2ysj: fnlyl[1].fdl.toFixed(2),
-              q3ysj: fnlyl[0].fdl.toFixed(2),
-            };
-            let fnlyl2 = {
-              name: "计划检修损失电量",
-              q1ysj: fnlyl[2].whdl.toFixed(2),
-              q2ysj: fnlyl[1].whdl.toFixed(2),
-              q3ysj: fnlyl[0].whdl.toFixed(2),
-            };
-            let fnlyl3 = {
-              name: "非计划检修损失电量",
-              q1ysj: fnlyl[2].gzdl.toFixed(2),
-              q2ysj: fnlyl[1].gzdl.toFixed(2),
-              q3ysj: fnlyl[0].gzdl.toFixed(2),
-            };
-            let fnlyl4 = {
-              name: "受累损失电量",
-              q1ysj: fnlyl[2].sldl.toFixed(2),
-              q2ysj: fnlyl[1].sldl.toFixed(2),
-              q3ysj: fnlyl[0].sldl.toFixed(2),
-            };
-            let fnlyl5 = {
-              name: "限电损失电量",
-              q1ysj: fnlyl[2].xddl.toFixed(2),
-              q2ysj: fnlyl[1].xddl.toFixed(2),
-              q3ysj: fnlyl[0].xddl.toFixed(2),
-            };
-            let fnlyl6 = {
-              name: "性能损失电量",
-              q1ysj: fnlyl[2].xndl.toFixed(2),
-              q2ysj: fnlyl[1].xndl.toFixed(2),
-              q3ysj: fnlyl[0].xndl.toFixed(2),
-            };
-            let fnlyl7 = {
-              name: "理论发电量",
-              q1ysj: fnlyl[2].llfdl.toFixed(2),
-              q2ysj: fnlyl[1].llfdl.toFixed(2),
-              q3ysj: fnlyl[0].llfdl.toFixed(2),
-            };
-            let fnlyl8 = {
-              name: "平均风速(m/s)",
-              q1ysj: fnlyl[2].speed.toFixed(2),
-              q2ysj: fnlyl[1].speed.toFixed(2),
-              q3ysj: fnlyl[0].speed.toFixed(2),
-            };
-            let fnlyl9 = {
-              name: "风能利用率",
-              q1ysj: fnlyl[2].fnlyl.toFixed(2),
-              q2ysj: fnlyl[1].fnlyl.toFixed(2),
-              q3ysj: fnlyl[0].fnlyl.toFixed(2),
-            };
-            that.fnlyls.push(fnlyl1);
-            that.fnlyls.push(fnlyl2);
-            that.fnlyls.push(fnlyl3);
-            that.fnlyls.push(fnlyl4);
-            that.fnlyls.push(fnlyl5);
-            that.fnlyls.push(fnlyl6);
-            that.fnlyls.push(fnlyl7);
-            that.fnlyls.push(fnlyl8);
-            that.fnlyls.push(fnlyl9);
+              // 风能利用率
+              let fnlyl = res.data.healthreport.fnlyls;
+              let fnlyl1 = {
+                name: "发电量",
+                q1ysj: fnlyl[2].fdl.toFixed(2),
+                q2ysj: fnlyl[1].fdl.toFixed(2),
+                q3ysj: fnlyl[0].fdl.toFixed(2),
+              };
+              let fnlyl2 = {
+                name: "计划检修损失电量",
+                q1ysj: fnlyl[2].whdl.toFixed(2),
+                q2ysj: fnlyl[1].whdl.toFixed(2),
+                q3ysj: fnlyl[0].whdl.toFixed(2),
+              };
+              let fnlyl3 = {
+                name: "非计划检修损失电量",
+                q1ysj: fnlyl[2].gzdl.toFixed(2),
+                q2ysj: fnlyl[1].gzdl.toFixed(2),
+                q3ysj: fnlyl[0].gzdl.toFixed(2),
+              };
+              let fnlyl4 = {
+                name: "受累损失电量",
+                q1ysj: fnlyl[2].sldl.toFixed(2),
+                q2ysj: fnlyl[1].sldl.toFixed(2),
+                q3ysj: fnlyl[0].sldl.toFixed(2),
+              };
+              let fnlyl5 = {
+                name: "限电损失电量",
+                q1ysj: fnlyl[2].xddl.toFixed(2),
+                q2ysj: fnlyl[1].xddl.toFixed(2),
+                q3ysj: fnlyl[0].xddl.toFixed(2),
+              };
+              let fnlyl6 = {
+                name: "性能损失电量",
+                q1ysj: fnlyl[2].xndl.toFixed(2),
+                q2ysj: fnlyl[1].xndl.toFixed(2),
+                q3ysj: fnlyl[0].xndl.toFixed(2),
+              };
+              let fnlyl7 = {
+                name: "理论发电量",
+                q1ysj: fnlyl[2].llfdl.toFixed(2),
+                q2ysj: fnlyl[1].llfdl.toFixed(2),
+                q3ysj: fnlyl[0].llfdl.toFixed(2),
+              };
+              let fnlyl8 = {
+                name: "平均风速(m/s)",
+                q1ysj: fnlyl[2].speed.toFixed(2),
+                q2ysj: fnlyl[1].speed.toFixed(2),
+                q3ysj: fnlyl[0].speed.toFixed(2),
+              };
+              let fnlyl9 = {
+                name: "风能利用率",
+                q1ysj: fnlyl[2].fnlyl.toFixed(2),
+                q2ysj: fnlyl[1].fnlyl.toFixed(2),
+                q3ysj: fnlyl[0].fnlyl.toFixed(2),
+              };
+              that.fnlyls.push(fnlyl1);
+              that.fnlyls.push(fnlyl2);
+              that.fnlyls.push(fnlyl3);
+              that.fnlyls.push(fnlyl4);
+              that.fnlyls.push(fnlyl5);
+              that.fnlyls.push(fnlyl6);
+              that.fnlyls.push(fnlyl7);
+              that.fnlyls.push(fnlyl8);
+              that.fnlyls.push(fnlyl9);
+            }
 
             // 故障分类
+            that.faultclass = [];
             that.faultclass = res.data.healthreport.faultclass;
             that.faultclass.push({
               ednavalue: null,
@@ -2058,6 +2025,7 @@ export default {
             });
 
             // 功率对部件温度影响
+            that.partwds = [];
             let partwds = res.data.healthreport.partwds;
             let partwd = [];
             partwds.forEach((item, i) => {
@@ -2075,16 +2043,16 @@ export default {
               partwd.push({
                 bj: bj,
                 wdcd: item.type,
-                min0: item.power == "0kw-150kw" ? item.value : "",
-                min150: item.power == "150kw-300kw" ? item.value : "",
-                min300: item.power == "300kw-450kw" ? item.value : "",
-                min450: item.power == "450kw-600kw" ? item.value : "",
-                min600: item.power == "600kw-750kw" ? item.value : "",
-                min750: item.power == "750kw-900kw" ? item.value : "",
-                min900: item.power == "900kw-1050kw" ? item.value : "",
-                min1050: item.power == "1050kw-1200kw" ? item.value : "",
-                min1200: item.power == "1200kw-1350kw" ? item.value : "",
-                min1350: item.power == "1350kw-1500kw" ? item.value : "",
+                min0: item.power == "0kw-150kw" ? item.value : 0,
+                min150: item.power == "150kw-300kw" ? item.value : 0,
+                min300: item.power == "300kw-450kw" ? item.value : 0,
+                min450: item.power == "450kw-600kw" ? item.value : 0,
+                min600: item.power == "600kw-750kw" ? item.value : 0,
+                min750: item.power == "750kw-900kw" ? item.value : 0,
+                min900: item.power == "900kw-1050kw" ? item.value : 0,
+                min1050: item.power == "1050kw-1200kw" ? item.value : 0,
+                min1200: item.power == "1200kw-1350kw" ? item.value : 0,
+                min1350: item.power == "1350kw-1500kw" ? item.value : 0,
               });
             });
             that.partwds = partwd;
@@ -2092,27 +2060,35 @@ export default {
             // 性能评价结果
             that.xnpjjg = [];
             let pjmxs = res.data.healthreport.pjjgs;
-            let xnpj1 = {
-              yf: new Date(pjmxs[2].date).formatDate("yyyy-MM"),
-              jb: pjmxs[2].level,
-              df: pjmxs[2].score,
-              ph: pjmxs[2].rank,
-            };
-            let xnpj2 = {
-              yf: new Date(pjmxs[1].date).formatDate("yyyy-MM"),
-              jb: pjmxs[1].level,
-              df: pjmxs[1].score,
-              ph: pjmxs[1].rank,
-            };
-            let xnpj3 = {
-              yf: new Date(pjmxs[0].date).formatDate("yyyy-MM"),
-              jb: pjmxs[0].level,
-              df: pjmxs[0].score,
-              ph: pjmxs[0].rank,
-            };
-            that.xnpjjg.push(xnpj1);
-            that.xnpjjg.push(xnpj2);
-            that.xnpjjg.push(xnpj3);
+            if (pjmxs != null && pjmxs != undefined) {
+              if (pjmxs[2] != undefined) {
+                let xnpj1 = {
+                  yf: new Date(pjmxs[2].date).formatDate("yyyy-MM"),
+                  jb: pjmxs[2].level,
+                  df: pjmxs[2].score,
+                  ph: pjmxs[2].rank,
+                };
+                that.xnpjjg.push(xnpj1);
+              }
+              if (pjmxs[1] != undefined) {
+                let xnpj2 = {
+                  yf: new Date(pjmxs[1].date).formatDate("yyyy-MM"),
+                  jb: pjmxs[1].level,
+                  df: pjmxs[1].score,
+                  ph: pjmxs[1].rank,
+                };
+                that.xnpjjg.push(xnpj2);
+              }
+              if (pjmxs[0] != undefined) {
+                let xnpj3 = {
+                  yf: new Date(pjmxs[0].date).formatDate("yyyy-MM"),
+                  jb: pjmxs[0].level,
+                  df: pjmxs[0].score,
+                  ph: pjmxs[0].rank,
+                };
+                that.xnpjjg.push(xnpj3);
+              }
+            }
 
             // 评价结果明细
             that.xnpjmx = [];
@@ -2378,6 +2354,11 @@ export default {
             };
           }
         },
+        fail(err) {
+          that.datas = {};
+          that.healthreport = {};
+          that.bjzb = [];
+        },
       });
     },
     // 对象排序
@@ -2392,6 +2373,107 @@ export default {
         return val1 > val2 ? -1 : val1 < val2 ? 1 : 0;
       };
     },
+    // 初始化评价展望
+    randomInitDate() {
+      let obj1 = {
+        partname: "曲线偏差率(5-11m/s)",
+        q1yjkqk: (Math.random() * 15).toFixed(2),
+        q2yjkqk: (Math.random() * 15).toFixed(2),
+        q3yjkqk: (Math.random() * 15).toFixed(2),
+      };
+      let obj2 = {
+        partname: "对风偏差率(5-11m/s)",
+        q1yjkqk: (Math.random() * 10).toFixed(2),
+        q2yjkqk: (Math.random() * 10).toFixed(2),
+        q3yjkqk: (Math.random() * 10).toFixed(2),
+      };
+      let obj3 = {
+        partname: "小风切入",
+        q1yjkqk: (Math.random() + 2.8).toFixed(2),
+        q2yjkqk: (Math.random() + 2.8).toFixed(2),
+        q3yjkqk: (Math.random() + 2.8).toFixed(2),
+      };
+      let obj4 = {
+        partname: "小风切出",
+        q1yjkqk: (Math.random() + 2.5).toFixed(2),
+        q2yjkqk: (Math.random() + 2.5).toFixed(2),
+        q3yjkqk: (Math.random() + 2.5).toFixed(2),
+      };
+      let obj5 = {
+        partname: "部件隐患",
+        q1yjkqk: "主轴",
+        q2yjkqk: "齿轮箱",
+        q3yjkqk: "齿轮箱",
+      };
+      let obj6 = {
+        partname: "故障",
+        q1yjkqk: "液压类故障",
+        q2yjkqk: "液压类故障",
+        q3yjkqk: "传动链",
+      };
+      let obj7 = {
+        partname: "功率对应温度",
+        q1yjkqk: "齿轮箱",
+        q2yjkqk: "发电机",
+        q3yjkqk: "发电机",
+      };
+      let obj8 = {
+        partname: "发电机",
+        q1yjkqk: "优",
+        q2yjkqk: "良",
+        q3yjkqk: "优",
+      };
+      let obj9 = {
+        partname: "齿轮箱",
+        q1yjkqk: "良",
+        q2yjkqk: "注意",
+        q3yjkqk: "注意",
+      };
+      let obj10 = {
+        partname: "变桨",
+        q1yjkqk: "注意",
+        q2yjkqk: "良",
+        q3yjkqk: "良",
+      };
+      let obj11 = {
+        partname: "主轴",
+        q1yjkqk: "良",
+        q2yjkqk: "良",
+        q3yjkqk: "注意",
+      };
+      let obj12 = {
+        partname: "风能利用率",
+        q1yjkqk: (Math.random() * 10 + 75).toFixed(2),
+        q2yjkqk: (Math.random() * 10 + 75).toFixed(2),
+        q3yjkqk: (Math.random() * 10 + 75).toFixed(2),
+      };
+      let obj13 = {
+        partname: "设备可利用率",
+        q1yjkqk: (Math.random() * 10 + 90).toFixed(2),
+        q2yjkqk: (Math.random() * 10 + 90).toFixed(2),
+        q3yjkqk: (Math.random() * 10 + 90).toFixed(2),
+      };
+      let obj14 = {
+        partname: "性能评价",
+        q1yjkqk: (Math.random() * 10 + 75).toFixed(2),
+        q2yjkqk: (Math.random() * 10 + 75).toFixed(2),
+        q3yjkqk: (Math.random() * 10 + 75).toFixed(2),
+      };
+      this.bjzb.push(obj1);
+      this.bjzb.push(obj2);
+      this.bjzb.push(obj3);
+      this.bjzb.push(obj4);
+      this.bjzb.push(obj5);
+      this.bjzb.push(obj6);
+      this.bjzb.push(obj7);
+      this.bjzb.push(obj8);
+      this.bjzb.push(obj9);
+      this.bjzb.push(obj10);
+      this.bjzb.push(obj11);
+      this.bjzb.push(obj12);
+      this.bjzb.push(obj13);
+      this.bjzb.push(obj14);
+    },
   },
 
   watch: {

+ 1 - 0
src/views/WindSite/pages/Map.vue

@@ -556,6 +556,7 @@ export default {
         .table-form {
           .text,
           .unit {
+            min-width: 60px;
             font-weight: 400;
           }