Biao 2 years ago
parent
commit
052f404f88

+ 316 - 0
src/components/chart/line/DayPowerChart.vue

@@ -0,0 +1,316 @@
+<template>
+  <div class="chart" :id="id"></div>
+</template>
+
+<script>
+import util from "@/helper/util.js";
+import partten from "@/helper/partten.js";
+import * as echarts from "echarts";
+
+export default {
+  name: "double-line-chart",
+  componentName: "double-line-chart",
+  props: {
+    width: {
+      type: String,
+      default: "100%",
+    },
+    height: {
+      type: String,
+      default: "13.889vh",
+    },
+    // 传入数据
+    list: {
+      type: Array,
+      default: () => [
+        {
+          title: "绿线",
+          smooth: true,
+          value: [
+            {
+              text: "",
+              value: 0,
+            },
+            {
+              text: "0:00",
+              value: 20,
+            },
+            {
+              text: "10:00",
+              value: 1,
+            },
+            {
+              text: "11:00",
+              value: 40,
+            },
+            {
+              text: "12:00",
+              value: 10,
+            },
+            {
+              text: "13:00",
+              value: 15,
+            },
+            {
+              text: "14:00",
+              value: 30,
+            },
+            {
+              text: "15:00",
+              value: 40,
+            },
+            {
+              text: "",
+              value: 10,
+            },
+          ],
+        },
+        {
+          title: "黄线",
+          smooth: true,
+          value: [
+            {
+              text: "",
+              value: 0,
+            },
+            {
+              text: "0:00",
+              value: 40,
+            },
+            {
+              text: "10:00",
+              value: 20,
+            },
+            {
+              text: "11:00",
+              value: 20,
+            },
+            {
+              text: "12:00",
+              value: 10,
+            },
+            {
+              text: "13:00",
+              value: 40,
+            },
+            {
+              text: "14:00",
+              value: 50,
+            },
+            {
+              text: "15:00",
+              value: 40,
+            },
+            {
+              text: "",
+              value: 10,
+            },
+          ],
+        },
+      ],
+    },
+    // 单位
+    unit: {
+      type: String,
+      default: "",
+    },
+    showLegend: {
+      type: Boolean,
+      default: false,
+    },
+  },
+  data() {
+    return {
+      id: "",
+      chart: null,
+      color: ["#05bb4c", "#f8de5b", "#4b55ae", "#fa8c16", "#1DA0D7", "#DD5044"],
+      newlist: null,
+    };
+  },
+  watch: {
+    list: {
+      handler(newValue, oldValue) {
+        this.newlist = newValue;
+        this.$nextTick(() => {
+          this.initChart();
+        });
+      },
+      deep: true,
+    },
+    "$store.state.themeName"() {
+      this.initChart();
+    },
+  },
+  computed: {
+    colorValue() {
+      return partten.getColor(this.color);
+    },
+    datas() {
+      return this.newlist.map((t) => {
+        return t.value;
+      });
+    },
+    legend() {
+      if (this.newlist) {
+        return this.newlist.map((t) => {
+          return t.title;
+        });
+      }
+    },
+    xdata() {
+      return this.newlist[0]?.value.map((t) => {
+        return t.speed;
+      });
+    },
+    series() {
+      let result = [];
+      this.newlist.forEach((value, index) => {
+        result.push({
+          name: value.name,
+          type: "line",
+          // smooth: value.smooth,
+          showSymbol: false,
+          zlevel: index,
+          lineStyle: {
+            normal: {
+              color: this.color[index],
+              width: 1,
+            },
+          },
+          yAxisIndex: value.yAxisIndex ||0,
+          data: value.value.map((t) => {
+            return t.actualpower;
+          }),
+        });
+      });
+
+      return result;
+    },
+    yAxis() {
+      let result = [];
+      result.push({
+        type: "value",
+        name: this.unit,
+        axisLabel: {
+          formatter: "{value}",
+          fontSize: util.vh(14),
+        },
+        boundaryGap: false,
+        //分格线
+        splitLine: {
+          show: false,
+        },
+      });
+      return result;
+    },
+  },
+  methods: {
+    resize() {},
+    initChart() {
+      const chart = echarts.init(this.$el);
+
+      let option = {
+        color: this.color,
+        tooltip: {
+          trigger: "axis",
+          backgroundColor:
+            this.$store.state.themeName === "dark"
+              ? "rgba(0,0,0,0.4)"
+              : "rgba(255,255,255,0.4)",
+          borderColor:
+            this.$store.state.themeName === "dark"
+              ? partten.getColor("gray")
+              : "#000",
+          textStyle: {
+            color: this.$store.state.themeName === "dark" ? "#fff" : "#000",
+            fontSize: util.vh(16),
+          },
+        },
+        legend: {
+          show: this.showLegend,
+          data: this.legend,
+          right: 56,
+          icon: "circle",
+          itemWidth: 6,
+          inactiveColor:
+            this.$store.state.themeName === "dark"
+              ? partten.getColor("gray")
+              : "#000",
+          textStyle: {
+            color:
+              this.$store.state.themeName === "dark"
+                ? partten.getColor("grayl")
+                : "#000",
+            fontSize: 12,
+          },
+        },
+        grid: {
+          top: 16,
+          left: 40,
+          right: 15,
+          bottom: 24,
+        },
+        xAxis: [
+          {
+            type: "category",
+            boundaryGap: false,
+            axisLabel: {
+              formatter: "{value}",
+              textStyle: {
+                color:
+                  this.$store.state.themeName === "dark"
+                    ? partten.getColor("gray")
+                    : "#000",
+                fontSize: util.vh(10),
+              },
+            },
+            data: this.xdata,
+          },
+        ],
+        yAxis: this.yAxis,
+        series: this.series,
+      };
+
+      chart.clear();
+      chart.setOption(option);
+
+      this.resize = function () {
+        chart.resize();
+      };
+
+      window.addEventListener("resize", this.resize);
+    },
+  },
+  created() {
+    this.$nextTick(() => {
+      this.id = "pie-chart-" + util.newGUID();
+    });
+    this.newlist = this.list;
+    console.warn(this.list);
+    console.warn(this.newlist);
+  },
+  mounted() {
+    this.$nextTick(() => {
+      this.$el.style.width = this.width;
+      this.$el.style.height = this.height;
+      this.initChart();
+    });
+  },
+  updated() {
+    this.$nextTick(() => {
+      this.initChart();
+    });
+  },
+  unmounted() {
+    window.removeEventListener("resize", this.resize);
+  },
+};
+</script>
+
+<style lang="less">
+.chart {
+  width: 100%;
+  height: 100%;
+  display: inline-block;
+}
+</style>

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

@@ -159,7 +159,7 @@ export default {
     },
     xdata() {
       return this.newlist[0]?.value.map((t) => {
-        return t.speed;
+        return t.text;
       });
     },
     series() {
@@ -179,7 +179,7 @@ export default {
           },
           yAxisIndex: value.yAxisIndex ||0,
           data: value.value.map((t) => {
-            return t.actualpower;
+            return t.value;
           }),
         });
       });

+ 1 - 1
src/views/Decision/Decision3Db.vue

@@ -143,7 +143,7 @@
 </template>
 
 <script>
-import DoubleLineChart from "../../components/chart/line/double-line-chart.vue";
+import DoubleLineChart from "../../components/chart/line/DayPowerChart.vue";
 import NormalRadarChart from "../../components/chart/radar/normal-radar-chart.vue";
 import SvgIcon from "../../components/coms/icon/svg-icon.vue";
 import ToolbarPanel from "../../components/coms/panel/toolbar-panel.vue";

+ 14 - 7
src/views/Home/Home.vue

@@ -932,13 +932,21 @@ export default {
 
   methods: {
 
+       mGetDate(){
+     var date = new Date();
+     var year = date.getFullYear();
+     var month = date.getMonth()+1;
+     var d = new Date(year, month, 0);
+     return d.getDate();
+},
+
     getDAY(){
-   let curDate = new Date();
-   let curMonth = curDate.getMonth(); //当前月份 需要加1
-   curDate.setMonth(curMonth + 1); 
-   curDate.setDate(0) //关键
-   curDate.getDate(); //计算的当月总天数
-   return curDate.getDate()-new Date().getDate() // new Date().getDate()当前几号  总天数-当前即可
+  //  let curDate = new Date();
+  //  let curMonth = curDate.getMonth(); //当前月份 需要加1
+  //  curDate.setMonth(curMonth+1); 
+  //  curDate.setDate(0) //关键
+  //  curDate.getDate(); //计算的当月总天数
+   return this.mGetDate()-new Date().getDate()?this.mGetDate()-new Date().getDate():1 // new Date().getDate()当前几号  总天数-当前即可
     },
     // 打开天气弹窗
     openWeatherDialog() {
@@ -1204,7 +1212,6 @@ export default {
           });
 
           this.DayPower = DayPower;
-          console.log(DayPower,'DayPower');
           this.Powertrend = Powertrend;
         });
     },

+ 31 - 6
src/views/WindSite/pages/Matrix.vue

@@ -165,7 +165,7 @@ export default {
           return "orange";
           break;
         case 5:
-          return "purple";
+          return "pink";
           break;
         case 6:
           return "write";
@@ -413,11 +413,11 @@ export default {
         color: #fff !important;
         .card-panel {
           .card-left {
-            background-color: #00a5db;
+            background-color: #00a5db!important;
             border-color: #fff !important;
 
             .tag {
-              background-color: #00a5db;
+              background-color: #00a5db!important;
               color: #fff !important;
             }
           }
@@ -432,6 +432,30 @@ export default {
           border: 2px solid black;
         }
       }
+         &.purple {
+        // color: @darkBlue;
+        color: #fff !important;
+        .card-panel {
+          .card-left {
+            background-color:#b10e7e;
+            border-color: #fff !important;
+
+            .tag {
+              background-color: #b10e7e;
+              color: #fff !important;
+            }
+          }
+          .card-right {
+            background-color: #b10e7e;
+            .num {
+              color: #fff !important;
+            }
+          }
+        }
+        .card-percent {
+          border: 2px solid black;
+        }
+      }
 
       &.pink {
         // color: @darkBlue;
@@ -562,16 +586,16 @@ export default {
         color: #fff !important;
         .card-panel {
           .card-left {
-            background-color: #24a13a;
+            background-color: #24a13a!important;
             border-color: #fff !important;
 
             .tag {
-              background-color: #24a13a;
+               background-color: #24a13a!important;
               color: #fff !important;
             }
           }
           .card-right {
-            background-color: #24a13a;
+              background-color: #24a13a!important;
             .num {
               color: #fff !important;
             }
@@ -783,6 +807,7 @@ export default {
           border-color: @orange;
         }
       }
+      
 
       &.gray {
         border-color: @darkgray;

+ 7 - 7
src/views/layout/Header.vue

@@ -72,13 +72,13 @@ export default {
           path: "/decision/pb",
           isActive: false,
         },
-        // {
-        //   id: "health",
-        //   text: "智慧检修",
-        //   // path: '/sandtable',
-        //   path: "/health/sandtable",
-        //   isActive: false,
-        // },
+        {
+          id: "health",
+          text: "智慧检修",
+          // path: '/sandtable',
+          path: "/health/sandtable",
+          isActive: false,
+        },
         // {
         //   id: "decision",
         //   text: "决策支持",

+ 17 - 11
src/views/layout/Menu.vue

@@ -14,7 +14,7 @@
             class="item"
             effect="dark"
             :content="menu.text"
-            placement="bottom"
+            placement="right"
             :show-after="500"
             :enterable="false"
             hide-after="10"
@@ -25,7 +25,9 @@
             >
               <SvgIcon :svgid="menu.icon"></SvgIcon>
             </div>
+            
           </el-tooltip>
+          
         </router-link>
         <!-- <div v-if="menu.children" class="sub-menu-item">
           <div class="menu-icon svg-icon" :class="activeIndex == index ? 'svg-icon-green' : 'svg-icon-gray'">
@@ -58,6 +60,7 @@
             :class="subIndex == index ? 'green' : 'gray'"
           >
             {{ menu.text }}
+            {{ menu.text }}
           </div>
         </router-link>
       </li>
@@ -331,12 +334,12 @@ export default {
                 },
               ],
             },
-              // {
-              //   text: "气象分析",
-              //   icon: "svg-qxfx",
-              //   path: "/decision/fs",
-              // },
-          
+            // {
+            //   text: "气象分析",
+            //   icon: "svg-qxfx",
+            //   path: "/decision/fs",
+            // },
+
             // {
             //   text: "电量预测",
             //   icon: "svg-dlyc",
@@ -1040,11 +1043,11 @@ export default {
             //     // }
             //   ],
             // },
-              {
+            {
               text: "报表管理",
               icon: "svg-统计分析",
               path: "/others/statisticAnalysis",
-               children: [
+              children: [
                 {
                   text: "统计分析",
                   icon: "svg-matrix",
@@ -1055,7 +1058,6 @@ export default {
                   icon: "svg-matrix",
                   path: "/others/statisticAnalysis/daily",
                 },
-             
               ],
             },
           ],
@@ -1130,6 +1132,9 @@ export default {
 </script>
  
 <style lang="less">
+.item{
+  // z-index: 999;
+}
 .menu {
   padding-top: 1.481vh;
 
@@ -1164,7 +1169,7 @@ export default {
   position: absolute;
   top: 0;
   left: 5.3704vh;
-  width: 158px;
+  width: 165px;
   height: 100%;
   padding-top: 1.481vh;
   background: fade(#192a26, 75);
@@ -1218,6 +1223,7 @@ export default {
       .sub-menu-text {
         margin-left: 1.1111vh;
         color: @gray-l;
+        z-index: 999;
       }
 
       & + .menu-item {