Эх сурвалжийг харах

Merge branch 'master' of http://git.xt.wenhq.top:8083/hs/zhny_ui

hsshuxian 10 сар өмнө
parent
commit
96602062f2

+ 0 - 1
demo/ny_code/src/components/globals/v-charts/options/line.ts

@@ -26,7 +26,6 @@ const options: LineECOption = {
   xAxis: [
     {
       type: "category",
-      boundaryGap: false,
       data: ["1", "2", "3", "4", "5", "6", "7"],
       axisLabel: {
         color: "#768F95",

+ 1 - 0
ems-ui/src/components/Block/charts/BarChartBlock.vue

@@ -44,6 +44,7 @@ const opts = {
   },
   xAxis: {
     type: 'category',
+    boundaryGap: true,
     data: [],
     axisTick: {
       alignWithLabel: true,

+ 1 - 1
ems-ui/src/utils/DateTool.js

@@ -21,7 +21,7 @@ export const DateTool = {
    */
   getTime: function (timeSplit = 5) {
     const now = dayjs();
-    let zero = dayjs().startOf('date');
+    let zero = dayjs().startOf('date').add(1, 'hour');
     const result = [];
     while (zero.isSameOrBefore(now)) {
       result.push(zero.format('HH:mm'));

+ 0 - 1
ems-ui/src/views/analysis/device/index.vue

@@ -128,7 +128,6 @@ export default {
         unit:"  ",
         xAxis: {
           type: 'category',
-          boundaryGap: false,
           data: [
             '1月',
             '2月',

+ 0 - 2
ems-ui/src/views/analysis/device/warn.vue

@@ -139,7 +139,6 @@ export default {
         unit: '  ',
         xAxis: {
           type: 'category',
-          boundaryGap: false,
           data: [],
         },
         series: [],
@@ -148,7 +147,6 @@ export default {
         unit: '  ',
         xAxis: {
           type: 'category',
-          boundaryGap: false,
           data: [],
         },
         series: [],

+ 0 - 4
ems-ui/src/views/analysis/power/prod.vue

@@ -91,7 +91,6 @@ export default {
       pvData: {
         xAxis: {
           type: 'category',
-          boundaryGap: false,
           data: [],
         },
         series: [
@@ -110,7 +109,6 @@ export default {
       pvPower: {
         xAxis: {
           type: 'category',
-          boundaryGap: false,
           data: [
             '00:00',
             '01:00',
@@ -157,7 +155,6 @@ export default {
       pvEff: {
         xAxis: {
           type: 'category',
-          boundaryGap: false,
           data: [
             '00:00',
             '01:00',
@@ -204,7 +201,6 @@ export default {
       pvWeek: {
         xAxis: {
           type: 'category',
-          boundaryGap: false,
           data: [
             '08-01',
             '08-02',

+ 0 - 1
ems-ui/src/views/dashboard/LineChart.vue

@@ -65,7 +65,6 @@ export default {
       this.chart.setOption({
         xAxis: {
           data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
-          boundaryGap: false,
           axisTick: {
             show: false
           }

+ 47 - 4
ems-ui/src/views/mgr/powergrid.vue

@@ -5,7 +5,7 @@
         <el-row type="flex" :gutter="20" style="margin-top: 20px">
           <el-col :span="12">
             <PieChartBlock
-                title="日供电量(单位:kw·h)"
+                title="日供电量(单位:kw·h)"
                 :opt-cfg="elecQuantity"
             />
           </el-col>
@@ -16,8 +16,8 @@
         <el-row type="flex" :gutter="20" style="margin-top: 20px">
           <el-col :span="24">
             <BarChartBlock
-                title="日供电量柱状图"
-                :opt-cfg="devcNum"
+                title="日供电量柱状图"
+                :opt-cfg="pvSupplyIndex"
             />
           </el-col>
         </el-row>
@@ -215,6 +215,14 @@ export default {
           },
         ],
       },
+      pvSupplyIndex: {
+        unit: '  ',
+        xAxis: {
+          type: 'category',
+          data: [],
+        },
+        series: [],
+      },
     };
   },
   computed: {
@@ -466,7 +474,42 @@ export default {
         data,
         code,
       } = await get('pg/supply/hour/summery/h');
-
+      if (ApiCode.SUCCESS !== code || !data || data.length < 1) {
+        return;
+      }
+      const xaxis = DateTool.getTime(60);
+      const {
+        pv,
+        supply,
+      } = data;
+      const series = [
+        {
+          name: '光伏',
+          type: 'bar',
+          barWidth: '30%', // 调整柱状图宽度
+          data: [],
+        }, {
+          name: '市电',
+          type: 'bar',
+          barWidth: '30%', // 调整柱状图宽度
+          data: [],
+        },
+      ];
+      xaxis.forEach((item, index) => {
+        let timeIndex = index + 1;
+        if (!pv || !pv[timeIndex]) {
+          series[0].data.push(0);
+        } else {
+          series[0].data.push(pv[timeIndex].useQuantity);
+        }
+        if (!supply || !supply[timeIndex]) {
+          series[1].data.push(0);
+        } else {
+          series[1].data.push(supply[timeIndex].quantity);
+        }
+      });
+      this.pvSupplyIndex.series = series;
+      this.pvSupplyIndex.xAxis.data = xaxis;
     },
     getList() {
       this.loading = true;