|
@@ -1,5 +1,5 @@
|
|
|
<template>
|
|
|
- <div class="powerPredictionPage">
|
|
|
+ <div class="powerPredictionPage" :class="!theme ? 'themeDark' : 'themeLight'">
|
|
|
<el-row class="windStstus">
|
|
|
<el-col :span="11" class="scrollbar">
|
|
|
<!-- <span class="scrollbarName">场站名称:</span> -->
|
|
@@ -28,8 +28,8 @@
|
|
|
<div v-for="item in showpowerLegend" :key="item.name">
|
|
|
<span class="lineColor" :style="{'background': item.color}"></span>
|
|
|
<span class="powerLegendColor" :style="{'background': item.color}"></span>
|
|
|
- <span
|
|
|
- style="font-size: 12px;margin-left: 12px;position: relative;top: 1px; color: #fff">{{item.name}}</span>
|
|
|
+ <span :style="!theme ? 'color: #fff' : ''"
|
|
|
+ style="font-size: 12px;margin-left: 12px;position: relative;top: 1px;">{{item.name}}</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div id="powerChart" :style="chartStyle"></div>
|
|
@@ -102,7 +102,29 @@
|
|
|
pickerTimeDia: [],
|
|
|
itemVal: '',
|
|
|
planFiveMin: '',
|
|
|
- showpowerLegend: []
|
|
|
+ showpowerLegend: [],
|
|
|
+ echartsTheme: '',
|
|
|
+ theme: null
|
|
|
+ }
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ '$store.state.theme': {
|
|
|
+ handler: function (newVal, oldVal) {
|
|
|
+ this.theme = newVal
|
|
|
+ this.echartsTheme = !newVal ? 'dark' : ''
|
|
|
+ this.pickerTime = [
|
|
|
+ new Date(new Date(new Date().getTime()).setHours(0, 0, 0, 0) + 900 * 1000),
|
|
|
+ new Date(new Date(new Date().getTime()).setHours(0, 0, 0, 0) + 24 * 60 * 60 * 1000)
|
|
|
+ ]
|
|
|
+ this.pickerTimeDia = [
|
|
|
+ new Date(new Date(new Date().getTime()).setHours(0, 0, 0, 0) + 900 * 1000),
|
|
|
+ new Date(new Date(new Date().getTime()).setHours(0, 0, 0, 0) + 24 * 60 * 60 * 1000 -
|
|
|
+ 1000)
|
|
|
+ ]
|
|
|
+ this.getStationData()
|
|
|
+
|
|
|
+ },
|
|
|
+ immediate: true
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
@@ -312,8 +334,9 @@
|
|
|
this.$refs.prediction.windTurbines = this.windTurbines
|
|
|
this.$refs.prediction.windTurbinesVal = this.itemVal
|
|
|
this.$nextTick(() => {
|
|
|
- const myChart1 = this.$echarts.init(document.getElementById('powerChart'), 'dark')
|
|
|
- const myChart2 = this.$echarts.init(document.getElementById('windChart'), 'dark')
|
|
|
+ const myChart1 = this.$echarts.init(document.getElementById('powerChart'), this
|
|
|
+ .echartsTheme)
|
|
|
+ const myChart2 = this.$echarts.init(document.getElementById('windChart'), this.echartsTheme)
|
|
|
myChart1.dispatchAction({
|
|
|
type: 'hideTip'
|
|
|
});
|
|
@@ -612,8 +635,8 @@
|
|
|
}
|
|
|
// 基于准备好的dom,初始化echarts实例
|
|
|
let dom = document.getElementById(name);
|
|
|
- dom.removeAttribute("_echarts_instance_")
|
|
|
- let myChart = this.$echarts.init(dom, 'dark');
|
|
|
+ dom.removeAttribute("_echarts_instance_") ? dom.removeAttribute("_echarts_instance_") : ''
|
|
|
+ let myChart = this.$echarts.init(dom, this.echartsTheme);
|
|
|
myChart.setOption(option);
|
|
|
myChart.on('mousemove', this.setTooltip('powerChart', 'windChart', 0))
|
|
|
myChart.on('mouseover', function (params) {
|
|
@@ -624,8 +647,8 @@
|
|
|
})
|
|
|
},
|
|
|
setTooltip(name1, name2, num) {
|
|
|
- const myChart1 = this.$echarts.init(document.getElementById(name1), 'dark')
|
|
|
- const myChart2 = this.$echarts.init(document.getElementById(name2), 'dark')
|
|
|
+ const myChart1 = this.$echarts.init(document.getElementById(name1), this.echartsTheme)
|
|
|
+ const myChart2 = this.$echarts.init(document.getElementById(name2), this.echartsTheme)
|
|
|
this.$utils.setTooltip(myChart1, myChart2, num)
|
|
|
},
|
|
|
// 装机,并网,实时,可用电量
|
|
@@ -746,8 +769,8 @@
|
|
|
};
|
|
|
// 基于准备好的dom,初始化echarts实例
|
|
|
let dom = document.getElementById(name);
|
|
|
- dom.removeAttribute("_echarts_instance_")
|
|
|
- let myChart = this.$echarts.init(dom, 'dark');
|
|
|
+ dom.removeAttribute("_echarts_instance_") ? dom.removeAttribute("_echarts_instance_") : ''
|
|
|
+ let myChart = this.$echarts.init(dom, this.echartsTheme);
|
|
|
myChart.setOption(option);
|
|
|
window.addEventListener("resize", function () {
|
|
|
myChart.resize()
|
|
@@ -830,7 +853,6 @@
|
|
|
minNum = 0
|
|
|
}
|
|
|
let option = {
|
|
|
- backgroundColor: '',
|
|
|
series: [{
|
|
|
type: 'gauge',
|
|
|
min: minNum,
|
|
@@ -872,10 +894,13 @@
|
|
|
}
|
|
|
}]
|
|
|
};
|
|
|
+ if (!this.theme) {
|
|
|
+ option.backgroundColor = ''
|
|
|
+ }
|
|
|
// 基于准备好的dom,初始化echarts实例
|
|
|
let dom = document.getElementById(name);
|
|
|
- dom.removeAttribute("_echarts_instance_")
|
|
|
- let myChart = this.$echarts.init(dom, 'dark');
|
|
|
+ dom.removeAttribute("_echarts_instance_") ? dom.removeAttribute("_echarts_instance_") : ''
|
|
|
+ let myChart = this.$echarts.init(dom, this.echartsTheme);
|
|
|
// let that = this
|
|
|
// setInterval(function () {
|
|
|
// that.getIrradiance()
|
|
@@ -988,8 +1013,8 @@
|
|
|
}
|
|
|
// 基于准备好的dom,初始化echarts实例
|
|
|
let dom = document.getElementById('radarChart');
|
|
|
- dom.removeAttribute("_echarts_instance_")
|
|
|
- let myChart = this.$echarts.init(dom, 'dark');
|
|
|
+ dom.removeAttribute("_echarts_instance_") ? dom.removeAttribute("_echarts_instance_") : ''
|
|
|
+ let myChart = this.$echarts.init(dom, this.echartsTheme);
|
|
|
myChart.setOption(option);
|
|
|
window.addEventListener("resize", function () {
|
|
|
myChart.resize()
|
|
@@ -999,183 +1024,40 @@
|
|
|
}
|
|
|
</script>
|
|
|
|
|
|
-<style lang="less">
|
|
|
- .powerPredictionPage {
|
|
|
- .windStstus {
|
|
|
- display: flex;
|
|
|
- justify-content: space-around;
|
|
|
- align-items: center;
|
|
|
- background: #040c0b;
|
|
|
- margin: 0 10px;
|
|
|
- border: 1px solid #7674d8;
|
|
|
- border-radius: 10px 10px 0 0;
|
|
|
- border-bottom: none;
|
|
|
- height: 40px;
|
|
|
-
|
|
|
- .el-col {
|
|
|
- display: flex;
|
|
|
- }
|
|
|
-
|
|
|
- .scrollbar {
|
|
|
- border-right: 1px dashed #fff;
|
|
|
-
|
|
|
- .scrollbarName {
|
|
|
- width: 10%;
|
|
|
- font-size: 14px;
|
|
|
- color: #fff;
|
|
|
- position: relative;
|
|
|
- top: 10px;
|
|
|
- left: 20px;
|
|
|
- }
|
|
|
-
|
|
|
- .el-scrollbar {
|
|
|
- width: 90%;
|
|
|
-
|
|
|
- .scrollbar-flex-content {
|
|
|
- display: flex;
|
|
|
- width: 50%;
|
|
|
-
|
|
|
- .scrollbar-demo-item {
|
|
|
- flex-shrink: 0;
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- justify-content: center;
|
|
|
- padding: 0px 15px;
|
|
|
- margin: 10px;
|
|
|
- text-align: center;
|
|
|
- border-radius: 4px;
|
|
|
- border: 1px solid #8679df;
|
|
|
- color: #fff;
|
|
|
- font-size: 14px;
|
|
|
- cursor: pointer;
|
|
|
- }
|
|
|
-
|
|
|
- .changeBacksty {
|
|
|
- background-color: #504bb5 !important;
|
|
|
- }
|
|
|
-
|
|
|
- .defaultBacksty {
|
|
|
- background-color: #373590 !important;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- .el-scrollbar__bar {
|
|
|
- display: block !important;
|
|
|
- --el-scrollbar-opacity: 0.8;
|
|
|
- --el-scrollbar-bg-color: #8679df;
|
|
|
- // --el-scrollbar-hover-opacity: 0.5;
|
|
|
- // --el-scrollbar-hover-bg-color: red;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- .everyOne {
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
-
|
|
|
- img {
|
|
|
- width: 21px;
|
|
|
- height: 21px;
|
|
|
- margin-left: 18px;
|
|
|
- }
|
|
|
-
|
|
|
- .statusName {
|
|
|
- margin-left: 10px;
|
|
|
- font-size: 14px;
|
|
|
- }
|
|
|
-
|
|
|
- .statusNum {
|
|
|
- padding: 0 18px;
|
|
|
- position: relative;
|
|
|
- border-right: 1px dashed #fff;
|
|
|
- }
|
|
|
-
|
|
|
- span {
|
|
|
- color: #fff;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- .windLeft {
|
|
|
- display: flex;
|
|
|
-
|
|
|
- .windMsg {
|
|
|
- margin-right: 10px;
|
|
|
- font-weight: 600;
|
|
|
-
|
|
|
- span {
|
|
|
- display: inline-block;
|
|
|
- }
|
|
|
+<style lang="less" scoped>
|
|
|
+ @import '../../viewsCss/powerPredictionPageLess.less';
|
|
|
|
|
|
- span:nth-of-type(1) {
|
|
|
- margin: 0 0 0 20px;
|
|
|
- font-size: 14px;
|
|
|
- color: #fff;
|
|
|
- }
|
|
|
+ .themeDark {
|
|
|
|
|
|
- span:nth-last-child(1) {
|
|
|
- font-size: 16px;
|
|
|
- color: #fff;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ .windStstus {
|
|
|
+ background: #040c0b;
|
|
|
}
|
|
|
|
|
|
.lineMain {
|
|
|
- width: calc(100% - 20px);
|
|
|
- padding: 10px 0 10px 20px;
|
|
|
background: #040c0b;
|
|
|
- border-radius: 10px;
|
|
|
|
|
|
- .lineStyle {
|
|
|
- width: 98%;
|
|
|
- border-radius: 10px;
|
|
|
+ .lineStyle,
|
|
|
+ .lineStyle1 {
|
|
|
background: #161f1e;
|
|
|
- margin-bottom: 10px;
|
|
|
- padding: 10px 0 10px 10px;
|
|
|
- box-shadow: 0 4px 8px 0 rgba(0, 0, 0, .2);
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
- .powerLegendColor {
|
|
|
- width: 11px;
|
|
|
- height: 11px;
|
|
|
- border-radius: 7px;
|
|
|
- display: inline-block;
|
|
|
- margin-top: 2px;
|
|
|
- position: relative;
|
|
|
- top: 3px;
|
|
|
- }
|
|
|
|
|
|
- .lineColor {
|
|
|
- width: 24px;
|
|
|
- height: 2px;
|
|
|
- display: inline-block;
|
|
|
- margin-top: 2px;
|
|
|
- position: relative;
|
|
|
- top: -2px;
|
|
|
- left: 17px;
|
|
|
- }
|
|
|
- }
|
|
|
+ }
|
|
|
|
|
|
- .lineStyle1 {
|
|
|
- width: 96%;
|
|
|
- border-radius: 10px;
|
|
|
- background: #161f1e;
|
|
|
- margin-bottom: 10px;
|
|
|
- padding: 10px 0 10px 10px;
|
|
|
- box-shadow: 0 4px 8px 0 rgba(0, 0, 0, .2);
|
|
|
+ .themeLight {
|
|
|
+ .windStstus {
|
|
|
+ background: linear-gradient(0deg, transparent, #373590);
|
|
|
+ }
|
|
|
|
|
|
- .guageMsg {
|
|
|
- position: relative;
|
|
|
- top: -35px;
|
|
|
- left: 25%;
|
|
|
- width: 50%;
|
|
|
- text-align: center;
|
|
|
+ .lineMain {
|
|
|
+ background: #edeffb;
|
|
|
|
|
|
- p {
|
|
|
- font-size: 16px;
|
|
|
- line-height: 0.5;
|
|
|
- }
|
|
|
- }
|
|
|
+ .lineStyle,
|
|
|
+ .lineStyle1 {
|
|
|
+ background: #fff;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
</style>
|