|
@@ -29,8 +29,8 @@
|
|
|
<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 class="numbers-right">{{showDate.windEnergyRate}}%</div>
|
|
|
+ <div class="dataName-right">风能利用率</div>
|
|
|
</div>
|
|
|
<div class="progress-right">
|
|
|
<div class="progressNum-right" :style="windStyle"></div>
|
|
@@ -60,9 +60,9 @@
|
|
|
import * as echarts from "echarts";
|
|
|
export default {
|
|
|
props: {
|
|
|
- current: {
|
|
|
- type: Number,
|
|
|
- },
|
|
|
+ // current: {
|
|
|
+ // type: Number,
|
|
|
+ // },
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
@@ -99,7 +99,7 @@
|
|
|
},
|
|
|
},
|
|
|
mounted() {
|
|
|
- this.current = this.$props.current
|
|
|
+ // this.current = this.$props.current
|
|
|
this.$nextTick(() => {
|
|
|
if (document.getElementById('mainEcharts')) {
|
|
|
this.getEcharts()
|
|
@@ -110,7 +110,7 @@
|
|
|
initData() {
|
|
|
var mb = MessageBridge.getInstance();
|
|
|
var vss = [{ key: "/topic/voice-control", action: this.windturbineMessage }];
|
|
|
- var vs = [{ key: "/topic/title-info", action: this.getEcharts }];
|
|
|
+ var vs = [{ key: "/topic/title-info", action: this.getEchartss }];
|
|
|
mb.register(vs);
|
|
|
mb.register(vss);
|
|
|
},
|
|
@@ -133,17 +133,23 @@
|
|
|
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)
|
|
|
- }
|
|
|
+ getEchartss(msg){
|
|
|
+ let data = JSON.parse(msg)
|
|
|
+ data.healthIndex = Number(data.healthIndex).toFixed(0)
|
|
|
+ data.resourceIndex = Number(data.resourceIndex).toFixed(0)
|
|
|
+ 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)
|
|
|
+ this.healthWidth= (data.healthIndex/4000)*100
|
|
|
+ this.resourceWidth= (data.resourceIndex/4000)*100
|
|
|
+ this.windWidth= data.windEnergyRate
|
|
|
+ this.curveWidth= data.curveFollowingRate
|
|
|
+ this.showDate = data
|
|
|
+ this.getEcharts()
|
|
|
+ },
|
|
|
+ getEcharts() {
|
|
|
var chartDom = document.getElementById('mainEcharts');
|
|
|
var myChart = echarts.init(chartDom, '#000000');
|
|
|
var option;
|
|
@@ -257,14 +263,9 @@
|
|
|
}
|
|
|
}]
|
|
|
};
|
|
|
- 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
|
|
|
+ option.series[0].data[0].value = Number(this.showDate.realTimePower);
|
|
|
+ option.series[0].data[1].value = Number(this.showDate.theoreticalPower);
|
|
|
+ option.series[0].data[2].value = Number(this.showDate.agcPowerSet);
|
|
|
myChart.setOption(option, true);
|
|
|
},
|
|
|
getData() {
|
|
@@ -315,20 +316,33 @@
|
|
|
return;
|
|
|
}
|
|
|
if (this.current !== values) {
|
|
|
- if ((this.current === 0 && values === 1) || (this.current === 1 && values === 0)) {
|
|
|
+ if (values === 2) {
|
|
|
this.current = values
|
|
|
- this.$emit('clicks', values);
|
|
|
- } else if (values === 2 && this.current !== 2) {
|
|
|
this.$router.push(`/ManualPage?current=${values}`)
|
|
|
- // this.current = values
|
|
|
- } else {
|
|
|
- this.$router.push(`/?current=${values}`)
|
|
|
+ } else if (values === 1){
|
|
|
+ this.$store.commit('current', values)
|
|
|
+ if(this.current === 0){
|
|
|
+ this.current = values
|
|
|
+ }else{
|
|
|
+ this.current = values
|
|
|
+ this.$router.push(`/?current=${values}`)
|
|
|
+ }
|
|
|
+ } else if(values === 0){
|
|
|
+ this.$store.commit('current', values)
|
|
|
+ if(this.current === 2){
|
|
|
+ this.current = values
|
|
|
+ this.$router.push(`/?current=${values}`)
|
|
|
+ }else{
|
|
|
+ this.current = values
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
},
|
|
|
- controls(value) {
|
|
|
- this.current = value
|
|
|
- }
|
|
|
+ // controls(value) {
|
|
|
+ // this.current = value
|
|
|
+ // }
|
|
|
},
|
|
|
}
|
|
|
</script>
|