|
@@ -83,7 +83,7 @@
|
|
|
<div style="float:left;width: 95%;height: 550px" id="wscharts"></div>
|
|
|
</el-tab-pane>
|
|
|
<el-tab-pane label="风向玫瑰图" name="three">
|
|
|
- <div id="roseChartsId" style="float:left;width: 95%;height: 550px"></div>
|
|
|
+ <div style="float:left;width: 95%;height: 550px" id="wdcharts"></div>
|
|
|
</el-tab-pane>
|
|
|
</el-tabs>
|
|
|
</div>
|
|
@@ -98,12 +98,7 @@ export default {
|
|
|
data() {
|
|
|
return {
|
|
|
wsChart: null,
|
|
|
- chart: null,
|
|
|
- charts: null,
|
|
|
- wsData: {
|
|
|
- wsCharts: {},
|
|
|
- times: {}
|
|
|
- },
|
|
|
+ wdChart: null,
|
|
|
activeName: 'first',
|
|
|
dateTime: [new Date(new Date().toLocaleDateString()).getTime(), new Date(new Date().toLocaleDateString()).getTime() + 60 * 60 * 24 * 1000-5*1000*60],
|
|
|
total: 0,
|
|
@@ -696,6 +691,11 @@ export default {
|
|
|
}
|
|
|
this.wsChart.dispose()
|
|
|
this.wsChart = null
|
|
|
+ if (!this.wdChart) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.wdChart.dispose()
|
|
|
+ this.wdChart = null
|
|
|
},
|
|
|
computed: {},
|
|
|
methods: {
|
|
@@ -705,11 +705,11 @@ export default {
|
|
|
this.wsChart.resize();
|
|
|
})
|
|
|
}
|
|
|
- // if (this.activeName == 'three') {
|
|
|
- // this.$nextTick(function() {
|
|
|
- // this.rosechart.resize();
|
|
|
- // })
|
|
|
- // }
|
|
|
+ if (this.activeName == 'three') {
|
|
|
+ this.$nextTick(function() {
|
|
|
+ this.wdChart.resize();
|
|
|
+ })
|
|
|
+ }
|
|
|
},
|
|
|
nameFormat({cellValue, row, column}) {
|
|
|
const item = this.nameList.find(item => item.value === cellValue)
|
|
@@ -760,16 +760,13 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
wsDraw(wsTime,wsMap) {
|
|
|
this.wsChart = echarts.init(document.getElementById('wscharts'))
|
|
|
- var option = {
|
|
|
+ let option = {
|
|
|
backgroundColor: 'transparent',
|
|
|
title: {
|
|
|
top: 20,
|
|
|
- text: '测风塔信息-风速',
|
|
|
+ text: '测风塔风速',
|
|
|
textStyle: {
|
|
|
fontWeight: 'normal',
|
|
|
fontSize: 16,
|
|
@@ -862,12 +859,9 @@ export default {
|
|
|
var index = 0;
|
|
|
|
|
|
for (var key in wsMap) {
|
|
|
- // var keyName = '';
|
|
|
- // for (let thFormatKey in this.thFormat) {
|
|
|
- // if (key == thFormatKey) {
|
|
|
- // keyName = this.thFormat[thFormatKey];
|
|
|
- // }
|
|
|
- // }
|
|
|
+ for (let i=0;i<wsMap[key].length;i++){
|
|
|
+ wsMap[key][i] = wsMap[key][i]==-99?null:wsMap[key][i]
|
|
|
+ }
|
|
|
option.legend.data.push(key)
|
|
|
if (key=='轮毂风速') {
|
|
|
option.legend.selected[key] = true
|
|
@@ -902,7 +896,147 @@ export default {
|
|
|
_this.wsChart.resize();
|
|
|
});
|
|
|
},
|
|
|
+ wdDraw(wdData) {
|
|
|
+ this.wdChart = echarts.init(document.getElementById('wdcharts'))
|
|
|
+ const option = {
|
|
|
+ backgroundColor: 'transparent',
|
|
|
+ color: ['#4A99FF', '#4BFFFC', '#ff654a', '#edff4a', '#65ff4a', '#4affea', '#894aff', '#d84aff', '#ff4aae'],
|
|
|
+ title: {
|
|
|
+ top: 20,
|
|
|
+ text: '测风塔风向玫瑰图\n\n50米主风向:' + this.wd50 + '\n70米主风向:' + this.wd70,
|
|
|
+ textStyle: {
|
|
|
+ fontWeight: 'normal',
|
|
|
+ fontSize: 16,
|
|
|
+ color: '#000'
|
|
|
+ },
|
|
|
+ left: '1%'
|
|
|
+ },
|
|
|
+ legend: {
|
|
|
+ top: 20,
|
|
|
+ width: 50,
|
|
|
+ icon: 'rect',
|
|
|
+ itemWidth: 14,
|
|
|
+ itemHeight: 5,
|
|
|
+ itemGap: 13,
|
|
|
+ data: [],
|
|
|
+ right: '4%',
|
|
|
+ textStyle: {
|
|
|
+ fontSize: 12,
|
|
|
+ // color: '#F1F1F3'
|
|
|
+ },
|
|
|
+ selected: {}
|
|
|
+ },
|
|
|
+ tooltip: {
|
|
|
+ confine: true,
|
|
|
+ trigger: 'axis',
|
|
|
+ axisPointer: {
|
|
|
+ lineStyle: {
|
|
|
+ color: '#57617B'
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ radar: [
|
|
|
+ {
|
|
|
+ name: {
|
|
|
+ textStyle: {
|
|
|
+ color: '#000',
|
|
|
+ fontSize: 16
|
|
|
+ },
|
|
|
+ },
|
|
|
+ splitArea: { // 坐标轴在 grid 区域中的分隔区域,默认不显示。
|
|
|
+ show: true,
|
|
|
+ areaStyle: { // 分隔区域的样式设置。
|
|
|
+ color: ['rgba(255,255,255,0)', 'rgba(255,255,255,0)'], // 分隔区域颜色。分隔区域会按数组中颜色的顺序依次循环设置颜色。默认是一个深浅的间隔色。
|
|
|
+ }
|
|
|
+ },
|
|
|
+ axisLine: { //指向外圈文本的分隔线样式
|
|
|
+ lineStyle: {
|
|
|
+ color: '#000'
|
|
|
+ }
|
|
|
+ },
|
|
|
+ splitLine: {
|
|
|
+ lineStyle: {
|
|
|
+ color: '#000', // 分隔线颜色
|
|
|
+ width: 1, // 分隔线线宽
|
|
|
+ }
|
|
|
+ },
|
|
|
+ indicator: [
|
|
|
+ {text: 'N', max: 1},
|
|
|
+ {text: 'NNW', max: 1},
|
|
|
+ {text: 'NW', max: 1},
|
|
|
+ {text: 'WNW', max: 1},
|
|
|
+ {text: 'W', max: 1},
|
|
|
+ {text: 'WSW', max: 1},
|
|
|
+ {text: 'SW', max: 1},
|
|
|
+ {text: 'SSW', max: 1},
|
|
|
+ {text: 'S', max: 1},
|
|
|
+ {text: 'SSE', max: 1},
|
|
|
+ {text: 'SE', max: 1},
|
|
|
+ {text: 'ESE', max: 1},
|
|
|
+ {text: 'E', max: 1},
|
|
|
+ {text: 'ENE', max: 1},
|
|
|
+ {text: 'NE', max: 1},
|
|
|
+ {text: 'NNE', max: 1},
|
|
|
+ ],
|
|
|
+ center: ['50%', '50%'],
|
|
|
+ radius: '70%'
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ series: [
|
|
|
+ {
|
|
|
+ type: 'radar',
|
|
|
+ tooltip: {
|
|
|
+ trigger: 'item',
|
|
|
+ },
|
|
|
+ areaStyle: {},
|
|
|
+ data: []
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ props: {
|
|
|
+ wdData: {
|
|
|
+ type: Object
|
|
|
+ },
|
|
|
+ wd70: {
|
|
|
+ type: String
|
|
|
+ },
|
|
|
+ wd50: {
|
|
|
+ type: String
|
|
|
+ },
|
|
|
+ thFormat: {
|
|
|
+ type: Array
|
|
|
+ }
|
|
|
+ },
|
|
|
+ }
|
|
|
+ var index = 0;
|
|
|
+ for (var key in wdData) {
|
|
|
+ var keyName = '';
|
|
|
+ for (let thFormatKey in this.thFormat) {
|
|
|
+ if (key == thFormatKey) {
|
|
|
+ keyName = this.thFormat[thFormatKey];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ option.legend.data.push(keyName)
|
|
|
+ if (index > 3) {
|
|
|
+ option.legend.selected[keyName] = false
|
|
|
+ } else {
|
|
|
+ option.legend.selected[keyName] = true
|
|
|
+ }
|
|
|
+ var wd = new Object
|
|
|
+ wd.name = keyName
|
|
|
+ wd.value = wdData[key]
|
|
|
+ wd.connectNulls = true
|
|
|
+ wd.itemStyle = this.itemStyle[index].itemStyle
|
|
|
+ wd.areaStyle = this.itemStyle[index].areaStyle
|
|
|
+ option.series[0].data.push(wd)
|
|
|
+ index++;
|
|
|
+ }
|
|
|
|
|
|
+ this.chart.setOption(option, true)
|
|
|
+ var _this = this
|
|
|
+ window.addEventListener("resize", function () {
|
|
|
+ _this.chart.resize();
|
|
|
+ });
|
|
|
+ },
|
|
|
},
|
|
|
}
|
|
|
</script>
|