ly 3 жил өмнө
parent
commit
455ae813e4

+ 9 - 0
ui/src/api/aspen/dashboarddata.js

@@ -18,6 +18,15 @@ export function selectLast(query) {
   })
 }
 
+// 查询月度dashboard抓取数据
+export function selectMonth(query) {
+  return request({
+    url: '/aspen/dashboardday/month',
+    method: 'get',
+    params: query
+  })
+}
+
 // 查询dashboard抓取数据详细
 export function getDashboarddata(id) {
   return request({

+ 1 - 0
ui/src/views/front/bottomEnergy.vue

@@ -27,6 +27,7 @@ const animationDuration = 6000
 export default {
   mixins: [resize],
   props: {
+    monthData: {},
     width: {
       type: String,
       default: '100%'

+ 1 - 0
ui/src/views/front/bottomLeft.vue

@@ -27,6 +27,7 @@ const animationDuration = 6000
 export default {
   mixins: [resize],
   props: {
+    monthData: {},
     width: {
       type: String,
       default: '100%'

+ 23 - 6
ui/src/views/monitor/elec/index.vue

@@ -104,10 +104,10 @@
             <product-tank :dashboarddata = 'dashboarddata'/>
           </dv-border-box-12>
           <dv-border-box-12 style="width: 438px;height: 260px;">
-            <bottom-left :dashboarddata = 'dashboarddata'/>
+            <bottom-left :monthData = 'monthData'/>
           </dv-border-box-12>
           <dv-border-box-12 style="width: 438px;height: 260px;">
-            <bottom-energy :dashboarddata = 'dashboarddata'/>
+            <bottom-energy :monthData = 'monthData'/>
           </dv-border-box-12>
           <dv-border-box-12 style="width: 438px;height: 260px;">
             <bottom-right :dashboarddata = 'dashboarddata'/>
@@ -182,7 +182,7 @@
   import dayjs from "dayjs";
   import '@/common/flexible.js';
   import dataV from '@jiaminghi/data-view';
-  import {selectLast} from "@/api/aspen/dashboarddata";
+  import {selectLast, selectMonth} from "@/api/aspen/dashboarddata";
 
   export default {
     data() {
@@ -302,7 +302,8 @@
           outputAnnual: null,
           instantaneous: null,
           cumulative: null
-        }
+        },
+        monthData: {}
       };
     },
     components: {
@@ -337,13 +338,22 @@
     },
     created() {
       this.getList();
+      this.getMonthList()
       // 每隔30秒请求一次数据
-      window.setInterval(() => {undefined
-        setTimeout(() => {undefined
+      window.setInterval(() => {
+        setTimeout(() => {
           ///调取接口获取数据
           this.getList();
         }, 0)
       }, 20000)
+
+      // 一天请求一次数据
+      window.setInterval(() => {
+        setTimeout(() => {
+          ///调取接口获取数据
+          this.getMonthList();
+        }, 0)
+      }, 1000 * 60 * 4)
     },
     beforeDestroy(){
       if(this.timer){
@@ -358,6 +368,13 @@
           this.dashboarddata = response.data;
         });
       },
+      /** 查询dashboard抓取数据列表 */
+      getMonthList()
+      {
+        selectMonth(this.queryParams).then(response => {
+          this.monthData = response.data;
+        });
+      },
       cancelLoading() {
         setTimeout(() => {
           this.loading = false;