|
@@ -1,22 +1,26 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
<div class="flex position-a forecast-line-btu">
|
|
|
- <div :class="day === 'day'?'btu-checked':'btu-no-checked'" class="forecastLine btu-checked-style flex items-center justify-center" id="day"
|
|
|
+ <div :class="day === 'day'?'btu-checked':'btu-no-checked'"
|
|
|
+ class="forecastLine btu-checked-style flex items-center justify-center" id="day"
|
|
|
@click="changeForecastLine('day')">当日
|
|
|
</div>
|
|
|
- <div :class="day === 'tenDay'?'btu-checked':'btu-no-checked'" class="forecastLine btu-checked-style flex items-center justify-center" id="tenDay"
|
|
|
+ <div :class="day === 'tenDay'?'btu-checked':'btu-no-checked'"
|
|
|
+ class="forecastLine btu-checked-style flex items-center justify-center" id="tenDay"
|
|
|
@click="changeForecastLine('tenDay')">十日
|
|
|
</div>
|
|
|
- <div :class="type === 'wind'?'btu-checked':'btu-no-checked'" class="forecastLineType btu-checked-style flex items-center justify-center" id="wind"
|
|
|
+ <div :class="type === 'wind'?'btu-checked':'btu-no-checked'"
|
|
|
+ class="forecastLineType btu-checked-style flex items-center justify-center" id="wind"
|
|
|
@click="changeForecastLineType('wind')">风电
|
|
|
</div>
|
|
|
- <div :class="type === 'photovoltaic'?'btu-checked':'btu-no-checked'" class="forecastLineType btu-checked-style flex items-center justify-center"
|
|
|
+ <div :class="type === 'photovoltaic'?'btu-checked':'btu-no-checked'"
|
|
|
+ class="forecastLineType btu-checked-style flex items-center justify-center"
|
|
|
id="photovoltaic" @click="changeForecastLineType('photovoltaic')">光伏
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
<div class="position-a echartsFullIcon" @click="openFull">
|
|
|
- <img src="../../../assets/images/dashboard/full.png" style="width: 1.5vw" />
|
|
|
+ <img src="../../../assets/images/dashboard/full.png" style="width: 1.5vw"/>
|
|
|
</div>
|
|
|
<div id="lineChart"/>
|
|
|
<!-- 全屏弹框 -->
|
|
@@ -37,6 +41,7 @@
|
|
|
|
|
|
<script>
|
|
|
import {lineOption} from '../echarts-data'
|
|
|
+
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
@@ -45,8 +50,8 @@ export default {
|
|
|
lineChart: null,
|
|
|
fullChart: null,
|
|
|
chartData: {},
|
|
|
- day:'day',
|
|
|
- type:'wind'
|
|
|
+ day: 'day',
|
|
|
+ type: 'wind'
|
|
|
}
|
|
|
},
|
|
|
props: {
|
|
@@ -74,7 +79,7 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
beforeDestroy() {
|
|
|
- if (this.lineChart !==null) {
|
|
|
+ if (this.lineChart !== null) {
|
|
|
this.lineChart.dispose();
|
|
|
this.lineChart = null
|
|
|
const _this = this
|
|
@@ -88,20 +93,20 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
initChart() {
|
|
|
- if(sessionStorage.getItem('screen-forecast-day')){
|
|
|
+ if (sessionStorage.getItem('screen-forecast-day')) {
|
|
|
this.day = sessionStorage.getItem('screen-forecast-day')
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
this.day = 'day'
|
|
|
}
|
|
|
- if(sessionStorage.getItem('screen-forecast-type')){
|
|
|
+ if (sessionStorage.getItem('screen-forecast-type')) {
|
|
|
this.type = sessionStorage.getItem('screen-forecast-type')
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
this.type = 'wind'
|
|
|
}
|
|
|
this.lineChart = this.$echarts.init(document.getElementById('lineChart'));
|
|
|
this.setOptions(this.chartData)
|
|
|
},
|
|
|
- openFull(){
|
|
|
+ openFull() {
|
|
|
const _this = this
|
|
|
_this.dialogVisible = true// 打开弹窗
|
|
|
_this.$nextTick(() => {
|
|
@@ -111,7 +116,7 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- setOptions({realList, ableList,theoryList,dqList,cdqList,timeList} = {}) {
|
|
|
+ setOptions({realList, ableList, theoryList, dqList, cdqList, timeList} = {}) {
|
|
|
const _this = this
|
|
|
let option = JSON.parse(JSON.stringify(lineOption))
|
|
|
option.series[0].data = realList
|
|
@@ -123,9 +128,15 @@ export default {
|
|
|
this.lineChart.setOption(option, true)
|
|
|
window.addEventListener("resize", this.chartsResize);
|
|
|
},
|
|
|
- setFullOptions({realList, ableList,theoryList,dqList,cdqList,timeList} = {}) {
|
|
|
+ setFullOptions({realList, ableList, theoryList, dqList, cdqList, timeList} = {}) {
|
|
|
this.fullChart = this.$echarts.init(document.getElementById('forecastFullChart'));
|
|
|
let option = JSON.parse(JSON.stringify(lineOption))
|
|
|
+ option.grid = {
|
|
|
+ top: '5%',
|
|
|
+ left: '3%',
|
|
|
+ right: '3%',
|
|
|
+ bottom: '5%',
|
|
|
+ }
|
|
|
option.series[0].data = realList
|
|
|
option.series[1].data = ableList
|
|
|
option.series[2].data = theoryList
|
|
@@ -139,13 +150,13 @@ export default {
|
|
|
* */
|
|
|
changeForecastLine(id) {
|
|
|
const activeItem = document.querySelector('.btu-checked.forecastLine')
|
|
|
- sessionStorage.setItem('screen-forecast-day',id)
|
|
|
+ sessionStorage.setItem('screen-forecast-day', id)
|
|
|
this.checkedClass(id, activeItem)
|
|
|
this.getForecastContrast()
|
|
|
},
|
|
|
changeForecastLineType(id) {
|
|
|
const activeItem = document.querySelector('.btu-checked.forecastLineType')
|
|
|
- sessionStorage.setItem('screen-forecast-type',id)
|
|
|
+ sessionStorage.setItem('screen-forecast-type', id)
|
|
|
this.checkedClass(id, activeItem)
|
|
|
this.getForecastContrast()
|
|
|
},
|
|
@@ -157,33 +168,37 @@ export default {
|
|
|
clickItem.classList.remove('btu-no-checked')
|
|
|
clickItem.classList.add('btu-checked')
|
|
|
},
|
|
|
- chartsResize(){
|
|
|
- if(this.lineChart !== null && this.lineChart !== undefined){
|
|
|
+ chartsResize() {
|
|
|
+ if (this.lineChart !== null && this.lineChart !== undefined) {
|
|
|
this.lineChart.resize();
|
|
|
}
|
|
|
},
|
|
|
- getForecastContrast(){
|
|
|
+ getForecastContrast() {
|
|
|
let forecastType
|
|
|
- if(sessionStorage.getItem('screen-forecast-type')){
|
|
|
+ if (sessionStorage.getItem('screen-forecast-type')) {
|
|
|
forecastType = sessionStorage.getItem('screen-forecast-type')
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
forecastType = 'wind'
|
|
|
}
|
|
|
let forecastDay
|
|
|
- if(sessionStorage.getItem('screen-forecast-day')){
|
|
|
+ if (sessionStorage.getItem('screen-forecast-day')) {
|
|
|
forecastDay = sessionStorage.getItem('screen-forecast-day')
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
forecastDay = 'day'
|
|
|
}
|
|
|
let queryParams = {
|
|
|
"forecastType": forecastType,
|
|
|
"forecastDay": forecastDay
|
|
|
}
|
|
|
- this.$axios({url: '/largeScreenController/forecastContrast', method: 'get',params: queryParams}).then(response => {
|
|
|
+ this.$axios({
|
|
|
+ url: '/largeScreenController/forecastContrast',
|
|
|
+ method: 'get',
|
|
|
+ params: queryParams
|
|
|
+ }).then(response => {
|
|
|
let curveMap = response.data.curveMap
|
|
|
this.chartData = {
|
|
|
realList: curveMap.realList,
|
|
|
- ableList: curveMap.ableList,
|
|
|
+ ableList: curveMap.ableList,
|
|
|
theoryList: curveMap.theoryList,
|
|
|
cdqList: curveMap.cdqList,
|
|
|
dqList: curveMap.dqList,
|
|
@@ -201,7 +216,8 @@ export default {
|
|
|
width: 100%;
|
|
|
height: 30vh;
|
|
|
}
|
|
|
-.forecast-line-btu{
|
|
|
+
|
|
|
+.forecast-line-btu {
|
|
|
top: .5vh;
|
|
|
right: 2.2vw;
|
|
|
}
|