14 changed files with 461 additions and 354 deletions
@ -1,75 +1,98 @@ |
|||||
<template> |
<template> |
||||
<div class='congestion'> |
<div class="congestion"> |
||||
<WgtTitle :title="'气温变化趋势'"></WgtTitle> |
<WgtTitle :title="'气温变化趋势'"></WgtTitle> |
||||
<div class="board"> |
<div class="board"> |
||||
<div class="charts" id="temperatureTrend"></div> |
<div class="charts" id="temperatureTrend"></div> |
||||
</div> |
</div> |
||||
</div> |
</div> |
||||
</template> |
</template> |
||||
|
|
||||
<script> |
<script> |
||||
|
import WgtTitle from "../../../../../widgets/title"; |
||||
import WgtTitle from '../../../../../widgets/title' |
import * as echarts from "echarts"; |
||||
import * as echarts from "echarts"; |
import temperatureCharts from "./assets/charts"; |
||||
import chartsStatistics from "./assets/charts"; |
import { |
||||
export default { |
getListLatest, |
||||
name: 'temperatureTrend', |
getDeviceNameListLatest, |
||||
|
getIdDevices, |
||||
|
} from "@/api/perception/meteorologyCheck"; |
||||
|
export default { |
||||
|
name: "temperatureTrend", |
||||
components: { |
components: { |
||||
WgtTitle |
WgtTitle, |
||||
|
}, |
||||
|
props: { |
||||
|
data: { |
||||
|
type: Array, |
||||
|
}, |
||||
|
}, |
||||
|
watch: { |
||||
|
data: { |
||||
|
handler(data) { |
||||
|
let newData = []; |
||||
|
data.forEach((item) => { |
||||
|
newData.push(item.avgVisibility); |
||||
|
}); |
||||
|
temperatureCharts.series[0].data = newData; |
||||
|
this.myChart.setOption(temperatureCharts); |
||||
|
}, |
||||
|
deep: true, |
||||
|
}, |
||||
}, |
}, |
||||
data() { |
data() { |
||||
return { |
return { |
||||
myChart:null, |
myChart: null, |
||||
} |
}; |
||||
}, |
}, |
||||
|
|
||||
created() { |
created() {}, |
||||
|
|
||||
}, |
|
||||
methods: { |
methods: { |
||||
reiszeChart(){ |
reiszeChart() { |
||||
this.$nextTick(() => { |
this.$nextTick(() => { |
||||
if ( this.myChart ) { |
if (this.myChart) { |
||||
this.myChart.resize(); |
this.myChart.resize(); |
||||
} |
} |
||||
}); |
}); |
||||
} |
|
||||
}, |
}, |
||||
update(){ |
|
||||
|
|
||||
}, |
}, |
||||
|
update() {}, |
||||
mounted() { |
mounted() { |
||||
setTimeout(() => { |
setTimeout(() => { |
||||
this.$nextTick(() => { |
this.$nextTick(() => { |
||||
this.myChart = echarts.init(document.getElementById('temperatureTrend')); |
this.myChart = echarts.init( |
||||
this.myChart.setOption(chartsStatistics); |
document.getElementById("temperatureTrend") |
||||
|
); |
||||
|
this.myChart.setOption(temperatureCharts); |
||||
}); |
}); |
||||
}); |
}); |
||||
}, |
}, |
||||
} |
}; |
||||
</script> |
</script> |
||||
|
|
||||
<style lang='scss' scoped> |
<style lang="scss" scoped> |
||||
.congestion { |
.congestion { |
||||
display: flex; flex-direction: column; |
display: flex; |
||||
.board{ |
flex-direction: column; |
||||
|
.board { |
||||
flex: 1; |
flex: 1; |
||||
padding: 0px 20px; |
padding: 0px 20px; |
||||
background: linear-gradient(180deg, rgba(6,66,88,0.2) 0%, #064258 100%); |
background: linear-gradient(180deg, rgba(6, 66, 88, 0.2) 0%, #064258 100%); |
||||
border-radius: 5px 5px 5px 5px; |
border-radius: 5px 5px 5px 5px; |
||||
opacity: 1; |
opacity: 1; |
||||
border: 1px solid; |
border: 1px solid; |
||||
border-image: linear-gradient(360deg, rgba(55, 231, 255,0.3), rgba(55, 231, 255, 0)) 1 1; |
border-image: linear-gradient( |
||||
|
360deg, |
||||
|
rgba(55, 231, 255, 0.3), |
||||
|
rgba(55, 231, 255, 0) |
||||
|
) |
||||
|
1 1; |
||||
display: flex; |
display: flex; |
||||
justify-content: space-between; |
justify-content: space-between; |
||||
align-items: center; |
align-items: center; |
||||
|
|
||||
} |
} |
||||
} |
} |
||||
.charts { |
.charts { |
||||
height:200px; |
height: 200px; |
||||
width: 100%; |
width: 100%; |
||||
} |
} |
||||
|
</style> |
||||
</style> |
|
||||
|
|
||||
|
@ -1,74 +1,94 @@ |
|||||
<template> |
<template> |
||||
<div class='congestion'> |
<div class="congestion"> |
||||
<WgtTitle :title="'能见度变化趋势'"></WgtTitle> |
<WgtTitle :title="'能见度变化趋势'"></WgtTitle> |
||||
<div class="board"> |
<div class="board"> |
||||
<div class="charts" id="VisibilityTrends"></div> |
<div class="charts" id="VisibilityTrends"></div> |
||||
</div> |
</div> |
||||
</div> |
</div> |
||||
</template> |
</template> |
||||
|
|
||||
<script> |
<script> |
||||
|
import WgtTitle from "../../../../../widgets/title"; |
||||
import WgtTitle from '../../../../../widgets/title' |
import * as echarts from "echarts"; |
||||
import * as echarts from "echarts"; |
import visibilityCharts from "./assets/charts"; |
||||
import chartsStatistics from "./assets/charts"; |
export default { |
||||
export default { |
name: "VisibilityTrends", |
||||
name: 'VisibilityTrends', |
|
||||
components: { |
components: { |
||||
WgtTitle |
WgtTitle, |
||||
|
}, |
||||
|
props: { |
||||
|
data: { |
||||
|
type: Array, |
||||
|
}, |
||||
|
}, |
||||
|
watch: { |
||||
|
data: { |
||||
|
handler(data) { |
||||
|
let newData = []; |
||||
|
data.forEach((item) => { |
||||
|
newData.push(item.avgTemperature); |
||||
|
}); |
||||
|
visibilityCharts.series[0].data = newData; |
||||
|
this.myChart.setOption(visibilityCharts); |
||||
|
}, |
||||
|
deep: true, |
||||
|
}, |
||||
}, |
}, |
||||
data() { |
data() { |
||||
return { |
return { |
||||
myChart:null, |
myChart: null, |
||||
} |
}; |
||||
}, |
}, |
||||
|
|
||||
created() { |
created() {}, |
||||
|
|
||||
}, |
|
||||
methods: { |
methods: { |
||||
reiszeChart(){ |
reiszeChart() { |
||||
|
|
||||
this.$nextTick(() => { |
this.$nextTick(() => { |
||||
if ( this.myChart ) { |
if (this.myChart) { |
||||
this.myChart.resize(); |
this.myChart.resize(); |
||||
} |
} |
||||
}); |
}); |
||||
} |
|
||||
}, |
}, |
||||
update(){ |
|
||||
|
|
||||
}, |
}, |
||||
|
update() {}, |
||||
mounted() { |
mounted() { |
||||
setTimeout(() => { |
setTimeout(() => { |
||||
this.$nextTick(() => { |
this.$nextTick(() => { |
||||
this.myChart = echarts.init(document.getElementById('VisibilityTrends')); |
this.myChart = echarts.init( |
||||
this.myChart.setOption(chartsStatistics); |
document.getElementById("VisibilityTrends") |
||||
|
); |
||||
|
this.myChart.setOption(visibilityCharts); |
||||
}); |
}); |
||||
}); |
}); |
||||
}, |
}, |
||||
} |
}; |
||||
</script> |
</script> |
||||
|
|
||||
<style lang='scss' scoped> |
<style lang="scss" scoped> |
||||
.congestion { |
.congestion { |
||||
display: flex; flex-direction: column; align-items: stretch; |
display: flex; |
||||
.board{ |
flex-direction: column; |
||||
|
align-items: stretch; |
||||
|
.board { |
||||
flex: 1; |
flex: 1; |
||||
padding: 0px 20px; |
padding: 0px 20px; |
||||
background: linear-gradient(180deg, rgba(6,66,88,0.2) 0%, #064258 100%); |
background: linear-gradient(180deg, rgba(6, 66, 88, 0.2) 0%, #064258 100%); |
||||
border-radius: 5px 5px 5px 5px; |
border-radius: 5px 5px 5px 5px; |
||||
opacity: 1; |
opacity: 1; |
||||
border: 1px solid; |
border: 1px solid; |
||||
border-image: linear-gradient(360deg, rgba(55, 231, 255,0.3), rgba(55, 231, 255, 0)) 1 1; |
border-image: linear-gradient( |
||||
display: flex; flex-direction: column; |
360deg, |
||||
|
rgba(55, 231, 255, 0.3), |
||||
|
rgba(55, 231, 255, 0) |
||||
|
) |
||||
|
1 1; |
||||
|
display: flex; |
||||
|
flex-direction: column; |
||||
justify-content: center; |
justify-content: center; |
||||
align-items: stretch; |
align-items: stretch; |
||||
} |
} |
||||
} |
} |
||||
.charts { |
.charts { |
||||
height:200px; |
height: 200px; |
||||
} |
} |
||||
|
</style> |
||||
</style> |
|
||||
|
|
||||
|
Loading…
Reference in new issue