xusl 5 місяців тому
батько
коміт
2dbf1b88d0

+ 9 - 0
cpp-admin/src/main/java/com/cpp/web/controller/largeScreen/LargeScreenController.java

@@ -536,6 +536,7 @@ public class LargeScreenController {
         List<Object> theoryList = new ArrayList<>();
         List<Object> cdqList = new ArrayList<>();
         List<Object> dqList = new ArrayList<>();
+        List<Object> timeList = new ArrayList<>();
 
         if (!stationCodeList.isEmpty()){
             // 查询实际功率、可用、理论
@@ -567,6 +568,13 @@ public class LargeScreenController {
 
             Long momentTime = 15 * 60 * 1000L;
             for (Long tempTime = dayStartTime.getTime(); tempTime <= dayEndTime.getTime(); tempTime = tempTime + momentTime) {
+                if ("day".equals(forecastDay)){
+                    timeList.add(DateUtil.format(new Date(tempTime), "HH:mm"));
+                }
+                else{
+                    timeList.add(DateUtil.format(new Date(tempTime), "yyyy-MM-dd HH:mm"));
+                }
+
                 // 统计实际功率、可用、理论曲线
                 if (powerStationStatusDataGroup.get(tempTime)!=null){
                     // 对每个时间点的所有场站数据进行求和
@@ -624,6 +632,7 @@ public class LargeScreenController {
 
         // 定义曲线map
         Map<String,List> curveMap = new HashMap();
+        curveMap.put("timeList",timeList);
         curveMap.put("realList",realList);
         curveMap.put("ableList",ableList);
         curveMap.put("theoryList",theoryList);

+ 6 - 3
cpp-ui/src/views/largeScreen/components/center-bottom.vue

@@ -111,7 +111,7 @@ export default {
         }
       })
     },
-    setOptions({realList, ableList,theoryList,dqList,cdqList} = {}) {
+    setOptions({realList, ableList,theoryList,dqList,cdqList,timeList} = {}) {
       const _this = this
       let option = JSON.parse(JSON.stringify(lineOption))
       option.series[0].data = realList
@@ -119,10 +119,11 @@ export default {
       option.series[2].data = theoryList
       option.series[3].data = dqList
       option.series[4].data = cdqList
+      option.xAxis[0].data = timeList
       this.lineChart.setOption(option, true)
       window.addEventListener("resize", this.chartsResize);
     },
-    setFullOptions({realList, ableList,theoryList,dqList,cdqList} = {}) {
+    setFullOptions({realList, ableList,theoryList,dqList,cdqList,timeList} = {}) {
       this.fullChart = this.$echarts.init(document.getElementById('main'));
       let option = JSON.parse(JSON.stringify(lineOption))
       option.series[0].data = realList
@@ -130,6 +131,7 @@ export default {
       option.series[2].data = theoryList
       option.series[3].data = dqList
       option.series[4].data = cdqList
+      option.xAxis[0].data = timeList
       this.fullChart.setOption(option, true)
     },
     /**
@@ -183,7 +185,8 @@ export default {
             ableList: response.data.ableList,
           theoryList: response.data.theoryList,
           cdqList: response.data.cdqList,
-          dqList: response.data.dqList
+          dqList: response.data.dqList,
+          timeList: response.data.timeList,
         }
         this.setOptions(this.chartData)
       }).catch(err => {

+ 11 - 28
cpp-ui/src/views/largeScreen/echarts-data.js

@@ -131,7 +131,11 @@ export let lineOption = {
         backgroundColor: '#505765'
       }
     }
-  }, grid: {
+  },
+  dataZoom: [{
+    type: 'inside'
+  }],
+  grid: {
     left: 55,
     right: 30,
     bottom: 30
@@ -163,32 +167,7 @@ export let lineOption = {
         show: false, // 隐藏X轴轴线
         alignWithLabel: true
       },
-      data: ['00:00',
-        '00:15', '00:30', '00:45', '01:00',
-        '01:15', '01:30', '01:45', '02:00',
-        '02:15', '02:30', '02:45', '03:00',
-        '03:15', '03:30', '03:45', '04:00',
-        '04:15', '04:30', '04:45', '05:00',
-        '05:15', '05:30', '05:45', '06:00',
-        '06:15', '06:30', '06:45', '07:00',
-        '07:15', '07:30', '07:45', '08:00',
-        '08:15', '08:30', '08:45', '09:00',
-        '09:15', '09:30', '09:45', '10:00',
-        '10:15', '10:30', '10:45', '11:00',
-        '11:15', '11:30', '11:45', '12:00',
-        '12:15', '12:30', '12:45', '13:00',
-        '13:15', '13:30', '14:45', '14:00',
-        '14:15', '14:30', '14:45', '15:00',
-        '15:15', '15:30', '15:45', '16:00',
-        '16:15', '16:30', '16:45', '17:00',
-        '17:15', '17:30', '17:45', '18:00',
-        '18:15', '18:30', '18:45', '19:00',
-        '19:15', '19:30', '19:45', '20:00',
-        '20:15', '20:30', '20:45', '21:00',
-        '21:15', '21:30', '21:45', '22:00',
-        '22:15', '22:30', '22:45', '23:00',
-        '23:15', '23:30', '23:45'
-      ]
+      data: []
     }
   ],
   yAxis: [
@@ -364,7 +343,11 @@ export let weatherLineOption = {
         backgroundColor: '#505765'
       }
     }
-  }, grid: {
+  },
+  dataZoom: [{
+    type: 'inside'
+  }],
+  grid: {
     left: 30,
     right: 30,
     bottom: 30

+ 18 - 2
cpp-ui/src/views/largeScreen/index.vue

@@ -563,8 +563,23 @@ export default {
       }else{
         weatherType = 'wind'
       }
+      let forecastDay
+      if(sessionStorage.getItem('screen-forecast-day')){
+        forecastDay = sessionStorage.getItem('screen-forecast-day')
+      }else{
+        forecastDay = 'day'
+      }
+      let forecastType
+      if(sessionStorage.getItem('screen-forecast-type')){
+        forecastType = sessionStorage.getItem('screen-forecast-type')
+      }else{
+        forecastType = 'wind'
+      }
+
+
       let queryParams = {
-        "weatherType": weatherType
+        "forecastDay": forecastDay,
+        "forecastType": forecastType,
       }
 
       await this.$axios({url: '/largeScreenController/getBizData', method: 'get',params: queryParams}).then(response => {
@@ -598,7 +613,8 @@ export default {
           ableList: curveMap.ableList,
           theoryList: curveMap.theoryList,
           cdqList: curveMap.cdqList,
-          dqList: curveMap.dqList
+          dqList: curveMap.dqList,
+          timeList: curveMap.timeList,
         }
 
         // 限电信息