浏览代码

4-20 场内对标

zhaomiao 4 年之前
父节点
当前提交
d075c1bfe1
共有 3 个文件被更改,包括 98 次插入2 次删除
  1. 29 1
      src/assets/js/benchmarkingSys/yardBenchmark.js
  2. 1 1
      src/main.js
  3. 68 0
      src/tools/echartsToolzm.js

+ 29 - 1
src/assets/js/benchmarkingSys/yardBenchmark.js

@@ -267,7 +267,35 @@ export default {
           
         }
 
-        this.drawhistogram();
+        //this.drawhistoram();
+        this.ECZM.getBar("histogram",[
+          {
+            name: "限电损失电量(单位:万kwh)",
+            type: "bar",
+            data: this.histogram.xdss,
+          },
+          {
+            name: "故障损失电量(单位:万kwh)",
+            type: "bar",
+            data: this.histogram.gzss,
+          },
+          ,
+          {
+            name: "检修损失电量(单位:万kwh)",
+            type: "bar",
+            data: this.histogram.jxss,
+          },
+          {
+            name: "性能损失电量(单位:万kwh)",
+            type: "bar",
+            data: this.histogram.xnss,
+          },
+          {
+            name: "受累损失电量(单位:万kwh)",
+            type: "bar",
+            data: this.histogram.slss,
+          },
+        ],this.histogram.date);
       });
     },
     /**

+ 1 - 1
src/main.js

@@ -12,7 +12,7 @@ Vue.prototype.API = axios;
 import base from "@tools/base"; // 公共方法
 Vue.prototype.BASE = base;
 
-import ECzm from "@tools/echartsTool_zm"; // echarts处理
+import ECzm from "@tools/echartsToolzm"; // echarts处理
  Vue.prototype.ECZM = ECzm;
 // import formCheck from "@tools/formCheck"; // 表单的处理
 // Vue.prototype.FC = formCheck;

+ 68 - 0
src/tools/echartsToolzm.js

@@ -0,0 +1,68 @@
+import EC from 'echarts'
+const color = ["#00FFF0","#014EB5","#A800FF","#e82edb","#B5454C","#443bff","#e8cb25","#3dffb0","#e8a425","#ff7aab","#e84b1e","#552ce2","#ffae21","#e8861e","#d441ff","#35e8e4","#9c7aff","#e86fd8","#ffee38"];
+
+/*
+ *  获取 自浮云 - 常用1
+ *  id: 元素ID
+ *  data: [{
+      name: "发动机卡了", // 值
+      value: 100, // 权重
+      textStyle: {
+        emphasis: {
+          color: 'red' // 光标移入颜色
+        }
+      }
+    },{
+      name: "发动了", // 值
+      value: 20, // 权重
+      textStyle: {
+        emphasis: {
+          color: 'red' // 光标移入颜色
+        }
+      }
+    }]
+ *  name: 提示框name
+ * */
+export function getBar(id, data , xdata) {
+  if(data === undefined){
+    message.error("没有找到报表数据,请检查!");
+    return;
+  }
+  var myChart = EC.init(document.getElementById(id));
+  option = {
+    title: {
+      text: "损失电量分析",
+    },
+    tooltip: {
+      trigger: "axis",
+      axisPointer: {
+        type: "shadow",
+      },
+    },
+    legend: {
+      data: [
+        "限电损失电量(单位:万kwh)",
+        "故障损失电量(单位:万kwh)",
+        "检修损失电量(单位:万kwh)",
+        "性能损失电量(单位:万kwh)",
+        "受累损失电量(单位:万kwh)",
+      ],
+    },
+    grid: {
+      left: "3%",
+      right: "4%",
+      bottom: "3%",
+      containLabel: true,
+    },
+    yAxis: {
+      type: "value",
+      boundaryGap: [0, 0.01],
+    },
+    xAxis: {
+      type: "category",
+      data: xdata,
+    },
+    series: data,
+  };
+  myChart.setOption(option, true);
+}