|
@@ -5,42 +5,50 @@
|
|
|
<div :class="current===1?'recommend_on':'recommend'" @click="ChangeBar(1)">推荐</div>
|
|
|
<div :class="current===2?'manual_on':'manual'" @click="ChangeBar(2)">手动</div>
|
|
|
</div>
|
|
|
- <div class="dataArea">
|
|
|
- <div class="dataBlock">
|
|
|
- <div class="dataName">风能利用率</div>
|
|
|
- <div class="numerical">
|
|
|
- <div class="data">
|
|
|
- <div class="values">{{datas.windEnergyRate}}</div>
|
|
|
- <div class="unit">%</div>
|
|
|
- </div>
|
|
|
- <img v-if="winFlag === 1" class="images" src="../../assets/img/type/up.png" alt="">
|
|
|
- <img v-if="winFlag === 2" class="images" src="../../assets/img/type/down.png" alt="">
|
|
|
- <div v-if="winFlag === 0" class="images_none"></div>
|
|
|
+ <div style="display: flex;flex-direction: row;z-index: 2;">
|
|
|
+ <div class="dataShow">
|
|
|
+ <div class="number">
|
|
|
+ <div class="dataName">健康指数</div>
|
|
|
+ <div class="numbers">{{showDate.healthIndex}}</div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
- <div class="dataBlock">
|
|
|
- <div class="dataName">曲线跟随率</div>
|
|
|
- <div class="numerical">
|
|
|
- <div class="data">
|
|
|
- <div class="values">{{datas.curveFollowingRate}}</div>
|
|
|
- <div class="unit">%</div>
|
|
|
- </div>
|
|
|
- <img v-if="curveFlag === 1" class="images" src="../../assets/img/type/up.png" alt="">
|
|
|
- <img v-if="curveFlag === 2" class="images" src="../../assets/img/type/down.png" alt="">
|
|
|
- <div v-if="curveFlag === 0" class="images_none"></div>
|
|
|
+ <div class="progress">
|
|
|
+ <div class="progressNum" :style="healthStyle"></div>
|
|
|
+ </div>
|
|
|
+ <div class="number">
|
|
|
+ <div class="dataName">资源指数</div>
|
|
|
+ <div class="numbers">{{showDate.resourceIndex}}</div>
|
|
|
+ </div>
|
|
|
+ <div class="progress">
|
|
|
+ <div class="progressNum" :style="resourceStyle"></div>
|
|
|
</div>
|
|
|
+ <!-- <div class="wind">
|
|
|
+ <div class="windNum">88%</div>
|
|
|
+ <div class="windTitle">风能利用率</div>
|
|
|
+ </div> -->
|
|
|
</div>
|
|
|
- <div class="dataBlock">
|
|
|
- <div class="dataName">场用电率</div>
|
|
|
- <div class="numerical">
|
|
|
- <div class="data">
|
|
|
- <div class="values">{{datas.fieldElectricityRate}}</div>
|
|
|
- <div class="unit">%</div>
|
|
|
- </div>
|
|
|
- <img v-if="fieldFlag === 1" class="images" src="../../assets/img/type/up.png" alt="">
|
|
|
- <img v-if="fieldFlag === 2" class="images" src="../../assets/img/type/down.png" alt="">
|
|
|
- <div v-if="fieldFlag === 0" class="images_none"></div>
|
|
|
+ <div id="mainEcharts" class="echarts"></div>
|
|
|
+ <div class="dataShows">
|
|
|
+ <div class="number">
|
|
|
+ <div class="numbers-right">88%</div>
|
|
|
+ <div class="dataName-right">{{showDate.windEnergyRate}}%</div>
|
|
|
+ </div>
|
|
|
+ <div class="progress-right">
|
|
|
+ <div class="progressNum-right" :style="windStyle"></div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+
|
|
|
+ <div class="number">
|
|
|
+ <div class="numbers-right">{{showDate.curveFollowingRate}}%</div>
|
|
|
+ <div class="dataName-right">曲线跟随率</div>
|
|
|
</div>
|
|
|
+ <div class="progress-right">
|
|
|
+ <div class="progressNum-right" :style="curveStyle"></div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <!-- <div class="follow">
|
|
|
+ <div class="followNum">88%</div>
|
|
|
+ <div class="followTitle">曲线跟随率</div>
|
|
|
+ </div> -->
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -48,6 +56,8 @@
|
|
|
<script>
|
|
|
import BackgroundData from 'utils/BackgroundData'
|
|
|
import api from "api/index";
|
|
|
+ import MessageBridge from 'utils/MessageBridge'
|
|
|
+ import * as echarts from "echarts";
|
|
|
export default {
|
|
|
props: {
|
|
|
current: {
|
|
@@ -58,39 +68,232 @@
|
|
|
return {
|
|
|
current: 1,
|
|
|
datas: {},
|
|
|
+ list: {},
|
|
|
+ showDate:{},
|
|
|
winFlag: 0,
|
|
|
curveFlag: 0,
|
|
|
fieldFlag: 0,
|
|
|
+ healthWidth: 0,
|
|
|
+ resourceWidth: 0,
|
|
|
+ windWidth: 0,
|
|
|
+ curveWidth: 0,
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
|
+ this.initData();
|
|
|
this.getData(),
|
|
|
- this.refreshTimer = setInterval(this.getData, 20000);
|
|
|
+ this.refreshTimer = setInterval(this.getData, 20000);
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ healthStyle() {
|
|
|
+ return `width: ${this.healthWidth}%;`
|
|
|
+ },
|
|
|
+ resourceStyle() {
|
|
|
+ return `width: ${this.resourceWidth}%;`
|
|
|
+ },
|
|
|
+ windStyle() {
|
|
|
+ return `width: ${this.windWidth}%;`
|
|
|
+ },
|
|
|
+ curveStyle() {
|
|
|
+ return `width: ${this.curveWidth}%;`
|
|
|
+ },
|
|
|
},
|
|
|
mounted() {
|
|
|
this.current = this.$props.current
|
|
|
- console.log(this.current);
|
|
|
+ this.$nextTick(() => {
|
|
|
+ if (document.getElementById('mainEcharts')) {
|
|
|
+ this.getEcharts()
|
|
|
+ }
|
|
|
+ });
|
|
|
},
|
|
|
methods: {
|
|
|
+ initData() {
|
|
|
+ var mb = MessageBridge.getInstance();
|
|
|
+ var vss = [{ key: "/topic/voice-control", action: this.windturbineMessage }];
|
|
|
+ var vs = [{ key: "/topic/title-info", action: this.getEcharts }];
|
|
|
+ mb.register(vs);
|
|
|
+ mb.register(vss);
|
|
|
+ },
|
|
|
+ windturbineMessage(msg) {
|
|
|
+ let arr = []
|
|
|
+ if (msg === 'CLOSE') {
|
|
|
+ arr.push(msg)
|
|
|
+ } else {
|
|
|
+ arr = msg.split('-')
|
|
|
+ }
|
|
|
+ this.dialogVisible = false
|
|
|
+ this.showSvg = false
|
|
|
+ this.svgWeb = ''
|
|
|
+ console.log(arr);
|
|
|
+ if (arr[0] === 'OPEN_PAGE_MANUAL') {
|
|
|
+ this.ChangeBar(2)
|
|
|
+ } else if (arr[0] === 'OPEN_PAGE_AUTOMATIC') {
|
|
|
+ this.ChangeBar(0)
|
|
|
+ } else if (arr[0] === 'OPEN_PAGE_RECOMMENDATION') {
|
|
|
+ this.ChangeBar(1)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ getEcharts(msg) {
|
|
|
+ let data = msg ? JSON.parse(msg) : this.$store.state.titleInfo
|
|
|
+ if (Object.keys(data).length>0) {
|
|
|
+ data.healthIndex = Number(data.healthIndex).toFixed(2)
|
|
|
+ data.resourceIndex = Number(data.resourceIndex).toFixed(2)
|
|
|
+ data.realTimePower = data.realTimePower.toFixed(2)
|
|
|
+ data.theoreticalPower = data.theoreticalPower.toFixed(2)
|
|
|
+ data.agcPowerSet = data.agcPowerSet.toFixed(2)
|
|
|
+ data.windEnergyRate = data.windEnergyRate.toFixed(2)
|
|
|
+ data.curveFollowingRate = data.curveFollowingRate.toFixed(2)
|
|
|
+ }
|
|
|
+ var chartDom = document.getElementById('mainEcharts');
|
|
|
+ var myChart = echarts.init(chartDom, '#000000');
|
|
|
+ var option;
|
|
|
+ option = {
|
|
|
+ series: [{
|
|
|
+ type: 'gauge',
|
|
|
+ max: 600,
|
|
|
+ anchor: {
|
|
|
+ show: true,
|
|
|
+ showAbove: true,
|
|
|
+ size: 9,
|
|
|
+ width: 5,
|
|
|
+ itemStyle: {
|
|
|
+ color: '#FAC858'
|
|
|
+ }
|
|
|
+ },
|
|
|
+ pointer: {
|
|
|
+ icon: '',
|
|
|
+ width: 3,
|
|
|
+ length: '80%',
|
|
|
+ offsetCenter: [0, '8%']
|
|
|
+ },
|
|
|
+
|
|
|
+ progress: {
|
|
|
+ show: true,
|
|
|
+ overlap: true,
|
|
|
+ roundCap: true
|
|
|
+ },
|
|
|
+ axisLine: {
|
|
|
+ lineStyle: {//仪表盘轴线相关配置。
|
|
|
+ width: 2,
|
|
|
+ color: [[1, '#8c929d']]
|
|
|
+ }
|
|
|
+ },
|
|
|
+ axisLabel: {
|
|
|
+ // textStyle: {//数字刻度样式
|
|
|
+ // color: '#000000',
|
|
|
+ // fontSize: 12,
|
|
|
+ // }
|
|
|
+ },
|
|
|
+ splitLine: {//分隔线样式相关
|
|
|
+ length: 0,//分割线的长度
|
|
|
+ lineStyle: {
|
|
|
+ width: 1,
|
|
|
+ color: '#000000'
|
|
|
+ }
|
|
|
+ },
|
|
|
+ data: [{
|
|
|
+ value: 21,
|
|
|
+ name: '实际功率',
|
|
|
+ itemStyle: {
|
|
|
+ color: 'rgba(75, 85, 174, 1)'
|
|
|
+ },
|
|
|
+ title: {
|
|
|
+ color: '#999999',
|
|
|
+ offsetCenter: ['-60%', '80%']
|
|
|
+ },
|
|
|
+ detail: {
|
|
|
+ width: 45,
|
|
|
+ height: 12,
|
|
|
+ fontSize: 18,
|
|
|
+ offsetCenter: ['-60%', '95%']
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value: 24,
|
|
|
+ name: '理论功率',
|
|
|
+ itemStyle: {
|
|
|
+ color: 'rgba(05, 187, 76, 1)'
|
|
|
+ },
|
|
|
+ title: {
|
|
|
+ color: '#999999',
|
|
|
+ offsetCenter: ['0%', '80%']
|
|
|
+ },
|
|
|
+ detail: {
|
|
|
+ width: 45,
|
|
|
+ height: 12,
|
|
|
+ fontSize: 18,
|
|
|
+ offsetCenter: ['0%', '95%']
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value: 73,
|
|
|
+ name: 'AGC有功设定',
|
|
|
+ itemStyle: {
|
|
|
+ color: 'rgba(186, 50, 55, 1)'
|
|
|
+ },
|
|
|
+ title: {
|
|
|
+ color: '#999999',
|
|
|
+ offsetCenter: ['60%', '80%']
|
|
|
+ },
|
|
|
+ detail: {
|
|
|
+ width: 45,
|
|
|
+ height: 12,
|
|
|
+ fontSize: 18,
|
|
|
+ offsetCenter: ['60%', '95%']
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ title: {
|
|
|
+ fontSize: 12
|
|
|
+ },
|
|
|
+ detail: {
|
|
|
+ width: 20,
|
|
|
+ height: 7,
|
|
|
+ fontSize: 12,
|
|
|
+ color: '#fff',
|
|
|
+ backgroundColor: 'auto',
|
|
|
+ borderRadius: 3,
|
|
|
+ formatter: ''
|
|
|
+ }
|
|
|
+ }]
|
|
|
+ };
|
|
|
+ option.series[0].data[0].value = Number(data.realTimePower);
|
|
|
+ option.series[0].data[1].value = Number(data.theoreticalPower);
|
|
|
+ option.series[0].data[2].value = Number(data.agcPowerSet);
|
|
|
+ this.healthWidth= (data.healthIndex/4000)*100
|
|
|
+ this.resourceWidth= (data.resourceIndex/4000)*100
|
|
|
+ this.windWidth= data.windEnergyRate
|
|
|
+ this.curveWidth= data.curveFollowingRate
|
|
|
+ this.showDate = data
|
|
|
+ myChart.setOption(option, true);
|
|
|
+ },
|
|
|
getData() {
|
|
|
api.getOverview().then(res => {
|
|
|
if (res) {
|
|
|
let data = res.data
|
|
|
- this.datas.curveFollowingRate ?
|
|
|
- (this.datas.curveFollowingRate > data.curveFollowingRate) ?
|
|
|
- (this.curveFlag = 2)
|
|
|
- : (this.datas.curveFollowingRate === data.curveFollowingRate) ? (this.curveFlag = 0) : (this.curveFlag = 1)
|
|
|
- : (this.curveFlag = 0)
|
|
|
- this.datas.fieldElectricityRate ?
|
|
|
- (this.datas.fieldElectricityRate > data.fieldElectricityRate) ?
|
|
|
- (this.fieldFlag = 2)
|
|
|
- : (this.datas.fieldElectricityRate === data.fieldElectricityRate) ? (this.fieldFlag = 0) : (this.fieldFlag = 1)
|
|
|
- : (this.fieldFlag = 0)
|
|
|
- this.datas.windEnergyRate ?
|
|
|
- (this.datas.windEnergyRate > data.windEnergyRate) ?
|
|
|
- (this.winFlag = 2)
|
|
|
- : (this.datas.windEnergyRate === data.windEnergyRate) ? (this.winFlag = 0) : (this.winFlag = 1)
|
|
|
- : (this.winFlag = 0)
|
|
|
+ if (this.datas.curveFollowingRate > data.curveFollowingRate) {
|
|
|
+ this.curveFlag = 2
|
|
|
+ } else if (this.datas.curveFollowingRate < data.curveFollowingRate) {
|
|
|
+ this.curveFlag = 1
|
|
|
+ } else {
|
|
|
+ this.curveFlag = 0
|
|
|
+ }
|
|
|
+
|
|
|
+ if (this.datas.fieldElectricityRate > data.fieldElectricityRate) {
|
|
|
+ this.fieldFlag = 2
|
|
|
+ } else if (this.datas.fieldElectricityRate < data.fieldElectricityRate) {
|
|
|
+ this.fieldFlag = 1
|
|
|
+ } else {
|
|
|
+ this.fieldFlag = 0
|
|
|
+ }
|
|
|
+
|
|
|
+ if (this.datas.windEnergyRate > data.windEnergyRate) {
|
|
|
+ this.winFlag = 2
|
|
|
+ } else if (this.datas.windEnergyRate < data.windEnergyRate) {
|
|
|
+ this.winFlag = 1
|
|
|
+ } else {
|
|
|
+ this.winFlag = 0
|
|
|
+ }
|
|
|
data.curveFollowingRate = data.curveFollowingRate.toFixed(2)
|
|
|
data.fieldElectricityRate = data.fieldElectricityRate.toFixed(2)
|
|
|
data.windEnergyRate = data.windEnergyRate.toFixed(2)
|
|
@@ -116,10 +319,10 @@
|
|
|
this.current = values
|
|
|
this.$emit('clicks', values);
|
|
|
} else if (values === 2 && this.current !== 2) {
|
|
|
- this.$router.push('/ManualPage?current=' + values)
|
|
|
+ this.$router.push(`/ManualPage?current=${values}`)
|
|
|
// this.current = values
|
|
|
} else {
|
|
|
- this.$router.push('/?current=' + values)
|
|
|
+ this.$router.push(`/?current=${values}`)
|
|
|
}
|
|
|
}
|
|
|
},
|
|
@@ -132,13 +335,17 @@
|
|
|
<style scoped>
|
|
|
.body {
|
|
|
width: 100%;
|
|
|
- height: 18.5vh;
|
|
|
+ height: 28.5vh;
|
|
|
/* background-color: #ffffff; */
|
|
|
margin-left: 15px;
|
|
|
margin-top: 20px;
|
|
|
border-left: 1px solid #373737;
|
|
|
border-right: 1px solid #373737;
|
|
|
border-bottom: 1px solid #373737;
|
|
|
+ /* background-image: url('../../assets/img/type/background.png'); */
|
|
|
+ background-repeat: no-repeat;
|
|
|
+ background-position: center;
|
|
|
+ background-size: cover;
|
|
|
}
|
|
|
|
|
|
.control {
|
|
@@ -147,7 +354,10 @@
|
|
|
align-items: center;
|
|
|
font-size: 14px;
|
|
|
color: #ffffff;
|
|
|
- margin-right: 5px;
|
|
|
+ /* margin-right: 5px; */
|
|
|
+ position: absolute;
|
|
|
+ right: 10px;
|
|
|
+ z-index: 99;
|
|
|
}
|
|
|
|
|
|
.manual {
|
|
@@ -244,10 +454,23 @@
|
|
|
}
|
|
|
|
|
|
.dataName {
|
|
|
- font-size: 16px;
|
|
|
- color: #FFFFFF;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: row-reverse;
|
|
|
+ font-size: 12px;
|
|
|
+ color: #999999;
|
|
|
+ /* margin-bottom: 6px; */
|
|
|
margin-left: 26px;
|
|
|
- margin-bottom: 6px;
|
|
|
+ /* margin-bottom: 20px; */
|
|
|
+ }
|
|
|
+
|
|
|
+ .dataName-right {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: row;
|
|
|
+ font-size: 14px;
|
|
|
+ color: #999999;
|
|
|
+ /* margin-bottom: 6px; */
|
|
|
+ margin-right: 50px;
|
|
|
+ /* margin-bottom: 20px; */
|
|
|
}
|
|
|
|
|
|
.numerical {
|
|
@@ -289,4 +512,120 @@
|
|
|
border-radius: 1px;
|
|
|
margin-top: -3px;
|
|
|
}
|
|
|
+
|
|
|
+ .dataShow {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ width: 200px;
|
|
|
+ position: absolute;
|
|
|
+ left: 1px;
|
|
|
+ top: 62%;
|
|
|
+ line-height: 35px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .dataShows {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ width: 200px;
|
|
|
+ position: absolute;
|
|
|
+ right: -35px;
|
|
|
+ top: 62%;
|
|
|
+ line-height: 35px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .number {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: row;
|
|
|
+ align-items: center;
|
|
|
+ font-size: 16px;
|
|
|
+ color: #ffffff;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: space-between;
|
|
|
+ }
|
|
|
+
|
|
|
+ .progress {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ margin-left: 20px;
|
|
|
+ width: 130px;
|
|
|
+ height: 10px;
|
|
|
+ border: 1px solid rgba(83, 92, 93, 0.5);
|
|
|
+ background-color: #000000;
|
|
|
+ margin-bottom: 20px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .progress-right {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: row-reverse;
|
|
|
+ align-items: center;
|
|
|
+ margin-left: 20px;
|
|
|
+ width: 130px;
|
|
|
+ height: 10px;
|
|
|
+ border: 1px solid rgba(83, 92, 93, 0.5);
|
|
|
+ background-color: #000000;
|
|
|
+ margin-bottom: 20px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .progressNum {
|
|
|
+ /* width: 60%; */
|
|
|
+ height: 40%;
|
|
|
+ background-color: rgba(75, 85, 174, 1);
|
|
|
+ border-radius: 2px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .progressNum-right {
|
|
|
+ /* width: 60%; */
|
|
|
+ height: 40%;
|
|
|
+ background-color: rgba(75, 85, 174, 1);
|
|
|
+ border-radius: 2px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .echarts {
|
|
|
+ width: 400px;
|
|
|
+ height: 360px;
|
|
|
+ margin-top: -24px;
|
|
|
+ /* background-color: #000000; */
|
|
|
+ margin-left: 105px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .wind {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ align-items: center;
|
|
|
+ margin-top: 20px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .windNum {
|
|
|
+ font-size: 14px;
|
|
|
+ color: #ffffff;
|
|
|
+ }
|
|
|
+
|
|
|
+ .windTitle {
|
|
|
+ font-size: 18px;
|
|
|
+ color: #ffffff;
|
|
|
+ }
|
|
|
+
|
|
|
+ .follow {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ align-items: center;
|
|
|
+ margin-top: 20px;
|
|
|
+ margin-right: 20px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .followNum {
|
|
|
+ font-size: 14px;
|
|
|
+ color: #ffffff;
|
|
|
+ }
|
|
|
+
|
|
|
+ .followTitle {
|
|
|
+ font-size: 18px;
|
|
|
+ color: #ffffff;
|
|
|
+ }
|
|
|
+ .numbers{
|
|
|
+ margin-right: 48px;
|
|
|
+ }
|
|
|
+ .numbers-right{
|
|
|
+ margin-left: 18px;
|
|
|
+ }
|
|
|
</style>
|