|
@@ -1,5 +1,20 @@
|
|
<template>
|
|
<template>
|
|
<div>
|
|
<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"
|
|
|
|
+ @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"
|
|
|
|
+ @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"
|
|
|
|
+ @click="changeForecastLineType('wind')">风电
|
|
|
|
+ </div>
|
|
|
|
+ <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">
|
|
<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>
|
|
@@ -29,7 +44,9 @@ export default {
|
|
screenHeight: window.innerHeight,
|
|
screenHeight: window.innerHeight,
|
|
lineChart: null,
|
|
lineChart: null,
|
|
fullChart: null,
|
|
fullChart: null,
|
|
- chartData: {}
|
|
|
|
|
|
+ chartData: {},
|
|
|
|
+ day:'day',
|
|
|
|
+ type:'wind'
|
|
}
|
|
}
|
|
},
|
|
},
|
|
props: {
|
|
props: {
|
|
@@ -60,6 +77,10 @@ export default {
|
|
if (this.lineChart !==null) {
|
|
if (this.lineChart !==null) {
|
|
this.lineChart.dispose();
|
|
this.lineChart.dispose();
|
|
this.lineChart = null
|
|
this.lineChart = null
|
|
|
|
+ const _this = this
|
|
|
|
+ window.removeEventListener("resize", function () {
|
|
|
|
+ _this.lineChart.resize();
|
|
|
|
+ });
|
|
}
|
|
}
|
|
if (this.fullChart !== null) {
|
|
if (this.fullChart !== null) {
|
|
this.fullChart.dispose();
|
|
this.fullChart.dispose();
|
|
@@ -69,6 +90,16 @@ export default {
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
initChart() {
|
|
initChart() {
|
|
|
|
+ if(localStorage.getItem('screen-forecast-day')){
|
|
|
|
+ this.day = localStorage.getItem('screen-forecast-day')
|
|
|
|
+ }else{
|
|
|
|
+ this.day = 'day'
|
|
|
|
+ }
|
|
|
|
+ if(localStorage.getItem('screen-forecast-type')){
|
|
|
|
+ this.type = localStorage.getItem('screen-forecast-type')
|
|
|
|
+ }else{
|
|
|
|
+ this.type = 'wind'
|
|
|
|
+ }
|
|
this.lineChart = this.$echarts.init(document.getElementById('lineChart'));
|
|
this.lineChart = this.$echarts.init(document.getElementById('lineChart'));
|
|
this.setOptions(this.chartData)
|
|
this.setOptions(this.chartData)
|
|
},
|
|
},
|
|
@@ -104,7 +135,29 @@ export default {
|
|
option.series[3].data = dqList
|
|
option.series[3].data = dqList
|
|
option.series[4].data = cdqList
|
|
option.series[4].data = cdqList
|
|
this.fullChart.setOption(option, true)
|
|
this.fullChart.setOption(option, true)
|
|
- }
|
|
|
|
|
|
+ },
|
|
|
|
+ /**
|
|
|
|
+ * 切换功率曲线按钮
|
|
|
|
+ * */
|
|
|
|
+ changeForecastLine(id) {
|
|
|
|
+ const activeItem = document.querySelector('.btu-checked.forecastLine')
|
|
|
|
+ localStorage.setItem('screen-forecast-day',id)
|
|
|
|
+ this.checkedClass(id, activeItem)
|
|
|
|
+ },
|
|
|
|
+ changeForecastLineType(id) {
|
|
|
|
+ const activeItem = document.querySelector('.btu-checked.forecastLineType')
|
|
|
|
+ localStorage.setItem('screen-forecast-type',id)
|
|
|
|
+ this.checkedClass(id, activeItem)
|
|
|
|
+ },
|
|
|
|
+ checkedClass(id, activeItem) {
|
|
|
|
+ let clickItem = document.getElementById(id)
|
|
|
|
+ // let activeItem = document.querySelector('.btu-checked')
|
|
|
|
+ activeItem.classList.remove('btu-checked')
|
|
|
|
+ activeItem.classList.add('btu-no-checked')
|
|
|
|
+ clickItem.classList.remove('btu-no-checked')
|
|
|
|
+ clickItem.classList.add('btu-checked')
|
|
|
|
+ },
|
|
|
|
+
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|
|
@@ -113,4 +166,8 @@ export default {
|
|
width: 100%;
|
|
width: 100%;
|
|
height: 30vh;
|
|
height: 30vh;
|
|
}
|
|
}
|
|
|
|
+.forecast-line-btu{
|
|
|
|
+ top: .5vh;
|
|
|
|
+ right: 2.2vw;
|
|
|
|
+}
|
|
</style>
|
|
</style>
|