Biao 2 years ago
parent
commit
fb9c478dfe
3 changed files with 70 additions and 7 deletions
  1. 12 7
      src/App.vue
  2. 56 0
      src/views/HealthControl/zhpj/healthpieChart.vue
  3. 2 0
      src/views/layout/Menu.vue

+ 12 - 7
src/App.vue

@@ -380,7 +380,7 @@ export default {
   },
 
   methods: {
-    windturbineMessage(msg){
+    windturbineMessage(msg) {
       console.log(msg);
     },
     // 切换子系统事件
@@ -404,7 +404,7 @@ export default {
       this.menuIndex = menuIndex;
     },
     clearBackground() {
-      return
+      return;
       let body = $("body.light");
       if (!body) body = $("body.dark");
       body.css({
@@ -606,12 +606,17 @@ body {
 .el-table__body tr.hover-row > td.el-table__cell {
   background-color: rgba(2, 2, 2) !important;
 }
-#appBody.light .el-table th.el-table__cell > .cell{
-  height: 8.2vh!important;
+#appBody.light .el-table th.el-table__cell > .cell {
+  height: 8.2vh !important;
 }
-.power-benchmarking-page .top .top-left .table.el-table thead tr:last-child th .cell{
+.power-benchmarking-page
+  .top
+  .top-left
+  .table.el-table
+  thead
+  tr:last-child
+  th
+  .cell {
   height: 116px !important;
 }
-
-
 </style>

+ 56 - 0
src/views/HealthControl/zhpj/healthpieChart.vue

@@ -0,0 +1,56 @@
+<template>
+   <div
+    class="echart"
+    id="mychart"
+    :style="{ float: 'left', width: '100%', height: '400px' }"
+  ></div>
+</template>
+
+<script>
+export default {
+  data() {
+    return {
+      name: "张雪",
+      xData: ["2020-02", "2020-03", "2020-04", "2020-05"], //横坐标数据
+      yData: [30, 132, 80, 134] //纵坐标数据,与横坐标对应
+    };
+  },
+  mounted() {
+    this.initEcharts();
+  },
+  methods: {
+    initEcharts() {
+      const option = {
+        title: {
+          text: "ECharts 入门示例"
+        },
+        tooltip: {},
+        legend: {
+          data: ["销量"]
+        },
+        xAxis: {
+          data: ["衬衫", "羊毛衫", "雪纺衫", "裤子", "高跟鞋", "袜子"]
+        },
+        yAxis: {},
+        series: [
+          {
+            name: "销量",
+            type: "bar", //类型为柱状图
+            data: [5, 20, 36, 10, 10, 20]
+          }
+        ]
+      };
+      const myChart = echarts.init(document.getElementById("mychart"));// 图标初始化
+      myChart.setOption(option);// 渲染页面
+      //随着屏幕大小调节图表
+      window.addEventListener("resize", () => {
+        myChart.resize();
+      });
+    }
+  }
+}
+
+</script>
+
+<style>
+</style>

+ 2 - 0
src/views/layout/Menu.vue

@@ -1060,6 +1060,8 @@ export default {
                 },
               ],
             },
+
+          
           ],
         },
       ],