Commit 902656b3 authored by caicaicai's avatar caicaicai

修改

parent 23e89ebd
......@@ -333,6 +333,8 @@ import overcastPic from '../../../../assets/images/cutGraph/overcast.png'
export default {
data() {
return {
//定时器
dataScreeningTimer:null,
whetherShow:false,
//天气图片
weatherPic:{
......@@ -378,8 +380,8 @@ export default {
//中间模块选择
centerViewData:{
moduleText:'centerModule1',
detailedDataDay:{},
detailedDataMonth:{},
xAxisData:['7:00', '8:00', '9:00', '10:00', '11:00', '12:00', '13:00', '14:00', '15:00', '16:00', '17:00', '18:00', '19:00'],
seriesData:[10, 52, 200, 334, 390, 330, 220,10, 52, 200, 334, 390, 330],
},
//天气数据
weatherData:{
......@@ -432,7 +434,6 @@ export default {
}
}
},
mounted() { },
methods: {
loadData(text){
if(text == true){
......@@ -588,8 +589,16 @@ export default {
}
})
//定时刷新数据
this.dataScreeningTimer = setInterval(() => {
}, 10000)
})
}else{
if(this.dataScreeningTimer) {
clearInterval(this.dataScreeningTimer);
}
this.whetherShow = false;
}
......@@ -658,6 +667,7 @@ export default {
},
//中间模块Echarts
centerEcharts(){
echarts.init(document.getElementById('centerEchartsView')).dispose();
var myChart = echarts.init(document.getElementById('centerEchartsView'));
var option = {
tooltip: {
......@@ -667,15 +677,16 @@ export default {
}
},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
top: '35%',
left: '1%',
right: '1%',
bottom: '2%',
containLabel: true
},
xAxis: [
{
type: 'category',
data: ['7:00', '8:00', '9:00', '10:00', '11:00', '12:00', '13:00', '14:00', '15:00', '16:00', '17:00', '18:00', '19:00'],
data: this.centerViewData.xAxisData,
axisTick: {
alignWithLabel: true
},
......@@ -715,10 +726,10 @@ export default {
],
series: [
{
name: '数据(吨)',
name: '重量(吨)',
type: 'bar',
barWidth: 20,
data: [10, 52, 200, 334, 390, 330, 220,10, 52, 200, 334, 390, 330],
data: this.centerViewData.seriesData,
itemStyle: {
color: '#01CBF6'
},
......@@ -789,6 +800,11 @@ export default {
this.currentTime.year = currentFormatDate;
},
},
beforeDestroy() {
if(this.dataScreeningTimer) {
clearInterval(this.dataScreeningTimer);
}
},
}
</script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment