道路噪声趋势图-存在柱状图部分不兼容问题
This commit is contained in:
@@ -24,13 +24,13 @@
|
|||||||
</a-col>
|
</a-col>
|
||||||
<a-col :lg="4" :md="8" :sm="24" :xs="24">
|
<a-col :lg="4" :md="8" :sm="24" :xs="24">
|
||||||
<a-form-item label="城区:">
|
<a-form-item label="城区:">
|
||||||
<a-select :options="areaOptions" v-model:value="queryParams.area" placeholder="城区">
|
<a-select mode="multiple" :options="areaOptions" @change="handleAreaChange" placeholder="城区">
|
||||||
</a-select>
|
</a-select>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :lg="4" :md="8" :sm="24" :xs="24">
|
<a-col :lg="4" :md="8" :sm="24" :xs="24">
|
||||||
<a-form-item label="测点名称:">
|
<a-form-item label="测点名称:">
|
||||||
<a-select :options="palceOptions" v-model:value="queryParams.place" placeholder="测点名称">
|
<a-select mode="multiple" :options="placeOptions" @change="handlePlaceChange" placeholder="测点名称">
|
||||||
</a-select>
|
</a-select>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
@@ -38,7 +38,7 @@
|
|||||||
<a-row>
|
<a-row>
|
||||||
<a-col :lg="4" :md="8" :sm="24" :xs="24">
|
<a-col :lg="4" :md="8" :sm="24" :xs="24">
|
||||||
<a-space>
|
<a-space>
|
||||||
<a-button type="primary" class="mb-20" @click="startStatistic">开始统计</a-button>
|
<a-button type="primary" class="mb-20" @click="drawTrend">开始统计</a-button>
|
||||||
</a-space>
|
</a-space>
|
||||||
</a-col>
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
@@ -51,6 +51,7 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import * as echarts from 'echarts'
|
import * as echarts from 'echarts'
|
||||||
|
import { markRaw } from 'vue'
|
||||||
import {
|
import {
|
||||||
getColumnOptions,
|
getColumnOptions,
|
||||||
getTrendChart
|
getTrendChart
|
||||||
@@ -62,10 +63,10 @@
|
|||||||
queryParams: {
|
queryParams: {
|
||||||
startYear: 2020,
|
startYear: 2020,
|
||||||
endYear: 2021,
|
endYear: 2021,
|
||||||
area: '',
|
areaList: ['兴宁区','西乡塘区'],
|
||||||
place: ''
|
placeList: []
|
||||||
},
|
},
|
||||||
tableData: [],
|
trendData: [],
|
||||||
chartColumn: null,
|
chartColumn: null,
|
||||||
placeOptions: [],
|
placeOptions: [],
|
||||||
areaOptions: [],
|
areaOptions: [],
|
||||||
@@ -77,7 +78,13 @@
|
|||||||
this.drawTrend()
|
this.drawTrend()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
/**获取下来框数据 */
|
handleAreaChange(value) {
|
||||||
|
this.queryParams.areaList = Object.values(value)
|
||||||
|
},
|
||||||
|
handlePlaceChange(value) {
|
||||||
|
this.queryParams.placeList = Object.values(value)
|
||||||
|
},
|
||||||
|
// 下拉列表
|
||||||
loadOptionData() {
|
loadOptionData() {
|
||||||
getColumnOptions("place").then((res) => {
|
getColumnOptions("place").then((res) => {
|
||||||
this.placeOptions = res.data.data.map((item) => {
|
this.placeOptions = res.data.data.map((item) => {
|
||||||
@@ -104,15 +111,11 @@
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 开始统计
|
|
||||||
startStatistic() {
|
|
||||||
getTrendChart(this.queryParams).then( res =>{
|
|
||||||
console.log(res)
|
|
||||||
})
|
|
||||||
},
|
|
||||||
// 趋势图
|
// 趋势图
|
||||||
drawTrend() {
|
drawTrend() {
|
||||||
this.chartColumn = echarts.init(document.getElementById('chartColumn'))
|
getTrendChart(this.queryParams).then( res => {
|
||||||
|
this.trendData = res.data.data
|
||||||
|
this.chartColumn = markRaw(echarts.init(document.getElementById('chartColumn')))
|
||||||
this.chartColumn.setOption({
|
this.chartColumn.setOption({
|
||||||
tooltip: {
|
tooltip: {
|
||||||
trigger: 'axis',
|
trigger: 'axis',
|
||||||
@@ -125,74 +128,16 @@
|
|||||||
},
|
},
|
||||||
toolbox: {
|
toolbox: {
|
||||||
feature: {
|
feature: {
|
||||||
dataView: {
|
|
||||||
show: true,
|
|
||||||
readOnly: false
|
|
||||||
},
|
|
||||||
magicType: {
|
|
||||||
show: true,
|
|
||||||
type: ['line', 'bar']
|
|
||||||
},
|
|
||||||
restore: {
|
|
||||||
show: true
|
|
||||||
},
|
|
||||||
saveAsImage: {
|
saveAsImage: {
|
||||||
show: true
|
show: true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
legend: {
|
legend: this.trendData.legend,
|
||||||
data: ['Evaporation', 'Precipitation', 'Temperature']
|
xAxis: this.trendData.xAxis,
|
||||||
},
|
yAxis: this.trendData.yAxis,
|
||||||
xAxis: [{
|
series: this.trendData.series
|
||||||
type: 'category',
|
})
|
||||||
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
|
|
||||||
axisPointer: {
|
|
||||||
type: 'shadow'
|
|
||||||
}
|
|
||||||
}],
|
|
||||||
yAxis: [{
|
|
||||||
type: 'value',
|
|
||||||
name: 'Precipitation',
|
|
||||||
min: 0,
|
|
||||||
max: 250,
|
|
||||||
interval: 50,
|
|
||||||
axisLabel: {
|
|
||||||
formatter: '{value} ml'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'value',
|
|
||||||
name: 'Temperature',
|
|
||||||
min: 0,
|
|
||||||
max: 25,
|
|
||||||
interval: 5,
|
|
||||||
axisLabel: {
|
|
||||||
formatter: '{value} °C'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
series: [{
|
|
||||||
name: 'Evaporation',
|
|
||||||
type: 'bar',
|
|
||||||
data: [
|
|
||||||
2.0, 4.9, 7.0, 23.2, 25.6, 76.7, 135.6, 162.2, 32.6, 20.0, 6.4, 3.3
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'Precipitation',
|
|
||||||
type: 'bar',
|
|
||||||
data: [
|
|
||||||
2.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8, 6.0, 2.3
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'Temperature',
|
|
||||||
type: 'line',
|
|
||||||
yAxisIndex: 1,
|
|
||||||
data: [2.0, 2.2, 3.3, 4.5, 6.3, 10.2, 20.3, 23.4, 23.0, 16.5, 12.0, 6.2]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user