噪声新增、修复

This commit is contained in:
weicw
2021-10-02 08:41:32 +08:00
parent 1c6338d61a
commit dffbbb2763
12 changed files with 1144 additions and 341 deletions

View File

@@ -8,25 +8,26 @@
:wrapper-col="{ md: { span: 18 }, sm: { span: 24 } }"
>
<a-row>
<a-col :lg="6" :md="12" :sm="24" :xs="24">
<a-form-item label="年份">
<a-select v-model:value="where.year" allowClear showSearch>
<a-select-option
v-for="item in yearOptions"
:key="item.value"
>{{ item.label }}
</a-select-option
>
</a-select>
</a-form-item>
</a-col>
<a-space>
<!-- <a-button type="primary" @click="reload">查询</a-button>-->
<!-- <a-button @click="reset">重置</a-button> -->
<a-button @click="exportFile">导出Excel</a-button>
</a-space>
<!-- <a-col :lg="6" :md="12" :sm="24" :xs="24">-->
<!-- <a-form-item label="年份">-->
<!-- <a-select v-model:value="where.year" allowClear showSearch>-->
<!-- <a-select-option-->
<!-- v-for="item in yearOptions"-->
<!-- :key="item.value"-->
<!-- >{{ item.label }}-->
<!-- </a-select-option-->
<!-- >-->
<!-- </a-select>-->
<!-- </a-form-item>-->
<!-- </a-col>-->
<a-col :lg="6" :md="12" :sm="24" :xs="24">
<a-form-item class="ele-text-right" :wrapper-col="{ span: 24 }">
<a-space>
<a-button type="primary" @click="reload">查询</a-button>
<!-- <a-button @click="reset">重置</a-button> -->
<a-button @click="exportFile">导出Excel</a-button>
</a-space>
</a-form-item>
</a-col>
</a-row>
@@ -146,9 +147,14 @@ export default {
columns.push({
title: item.value + "年噪声值",
dataIndex: item.value + "Leq",
customRender: ({text})=>{return Number(text).toFixed(1)}
customRender: ({text})=>{return Number(text)?Number(text).toFixed(1):undefined}
})
columns.push({
title: item.value + "年噪声等级",
dataIndex: item.value + "Level",
})
}
})
@@ -163,41 +169,7 @@ export default {
this.reload();
},
exportFile() {
const columns = [
{
title: "噪声源分类",
dataIndex: "source",
},
{
title: "测点数(个)",
dataIndex: "count",
},
{
title: "声源占比(%",
dataIndex: "rate",
},
{
title: "时段",
dataIndex: "timeSlot",
},
{
title: "Leq",
dataIndex: "leq",
},
{
title: "L10",
dataIndex: "l10",
},
{
title: "L50",
dataIndex: "l50",
},
{
title: "L90",
dataIndex: "l90",
},
];
const columns = this.columns.filter(item=>item.dataIndex)
const arr = [];
const th = columns.map((item) => item.title);
arr.push(th);

View File

@@ -1,58 +1,61 @@
<template>
<div class="ele-body">
<a-card :bordered="false">
<a-tabs v-model:activeKey="activeKey">
<a-tab-pane key="base" tab="数据总览">
<base-statistic></base-statistic>
</a-tab-pane>
<a-tab-pane key="source-statistic" tab="声源">
<source-statistic></source-statistic>
</a-tab-pane>
<a-tab-pane key="average" tab="城区">
<average-statistic></average-statistic>
</a-tab-pane>
<!-- <a-tab-pane key="quarter" tab="季度报告">
<quarter-statistic></quarter-statistic>
</a-tab-pane> -->
<a-tab-pane key="year-compare" tab="市">
<year-statistic></year-statistic>
</a-tab-pane>
</a-tabs>
</a-card>
</div>
<div class="ele-body">
<a-card :bordered="false">
<a-tabs v-model:activeKey="activeKey">
<a-tab-pane key="base" tab="数据总览">
<base-statistic></base-statistic>
</a-tab-pane>
<a-tab-pane key="source-statistic" tab="声源">
<source-statistic></source-statistic>
</a-tab-pane>
<a-tab-pane key="average" tab="城区">
<average-statistic></average-statistic>
</a-tab-pane>
<!-- <a-tab-pane key="quarter" tab="季度报告">
<quarter-statistic></quarter-statistic>
</a-tab-pane> -->
<a-tab-pane key="year-compare" tab="市">
<year-statistic></year-statistic>
</a-tab-pane>
<a-tab-pane key="level-distribution" tab="等级分布">
<level-distribution></level-distribution>
</a-tab-pane>
</a-tabs>
</a-card>
</div>
</template>
<script>
/**
*
*
*
*/
import BaseStatistic from "./base.vue";
import AverageStatistic from "./average.vue";
import SourceStatistic from "./source.vue";
import YearStatistic from "./year.vue";
/**
*
*
*
*/
import BaseStatistic from "./base.vue";
import AverageStatistic from "./average.vue";
import SourceStatistic from "./source.vue";
import YearStatistic from "./year.vue";
import LevelDistribution from "./level-distribution";
export default {
export default {
name: 'StatisticSoundZone',
components: {
BaseStatistic,
SourceStatistic,
// Compare,
AverageStatistic,
YearStatistic
BaseStatistic,
SourceStatistic,
// Compare,
AverageStatistic,
YearStatistic,
LevelDistribution
},
data() {
return {
activeKey: 'base'
};
},
methods: {
}
return {
activeKey: 'base'
};
}
},
methods: {}
}
</script>
<style scoped>

View File

@@ -0,0 +1,163 @@
<template>
<div class="ele-body">
<a-card :bordered="false">
<!-- 搜索表单 -->
<a-form
:model="where"
:label-col="{ md: { span: 6 }, sm: { span: 24 } }"
:wrapper-col="{ md: { span: 18 }, sm: { span: 24 } }"
>
<a-row>
<a-col :lg="6" :md="12" :sm="24" :xs="24">
<a-form-item label="年份">
<a-select v-model:value="where.year" allowClear showSearch>
<a-select-option
v-for="item in yearOptions"
:key="item.value"
>{{ item.label }}
</a-select-option
>
</a-select>
</a-form-item>
</a-col>
<a-col :lg="6" :md="12" :sm="24" :xs="24">
<a-form-item label="区域等级">
<a-select v-model:value="where.regionLevel" >
<a-select-option
v-for="item in regionLevelOptions"
:key="item.value"
>{{ item.label }}
</a-select-option
>
</a-select>
</a-form-item>
</a-col>
<a-col :lg="6" :md="12" :sm="24" :xs="24">
<a-form-item label="时段">
<a-select v-model:value="where.timeSlot" >
<a-select-option
v-for="item in timeSlotOptions"
:key="item.value"
>{{ item.label }}
</a-select-option
>
</a-select>
</a-form-item>
</a-col>
<a-col :lg="6" :md="12" :sm="24" :xs="24">
<a-form-item class="ele-text-right" :wrapper-col="{ span: 24 }">
<a-space>
<a-button type="primary" @click="reload">查询</a-button>
<!-- <a-button @click="reset">重置</a-button> -->
<a-button @click="exportFile">导出Excel</a-button>
</a-space>
</a-form-item>
</a-col>
</a-row>
</a-form>
<!-- 表格 -->
<ele-pro-table
v-model:selection="selectionList"
ref="table"
row-key="level"
:datasource="url"
:columns="columns"
:where="where"
:needPage="false"
:initLoad="false"
:scroll="{ x: 'max-content' }"
@done="(d) => (data = d.data)"
>
</ele-pro-table>
</a-card>
</div>
<!-- 编辑弹窗 -->
</template>
<script>
// import _ from "lodash";
import XLSX from "xlsx";
import {statisticLevelDistributionUrl, getColumnOptions} from "@/api/ecology/noise/zone-sound";
import locale from "ant-design-vue/es/date-picker/locale/zh_CN";
// import utils from "./utils";
export default {
name: "StatisticSoundZoneSource",
components: {},
data() {
return {
data: [],
locale,
bill: {},
// 表格数据接口
url: statisticLevelDistributionUrl,
selection: [],
// 表格列配置
columns: [
{ title: "噪声等级",dataIndex: "level",},
{ title: "范围(分贝)",dataIndex: "levelDesc",},
{ title: "覆盖点(个)",dataIndex: "size",},
{ title: "覆盖面积(平方公里)",dataIndex: "area",},
{ title: "所占比例(%",dataIndex: "ratio",},
],
// 表格搜索条件
where: {regionLevel :"市级",timeSlot:"昼"},
regionLevelOptions:[
{label: "市级",value: "市级"},
{label: "县级",value: "县级"}
],
timeSlotOptions:[
{label:"昼",value:"昼"},
{label:"夜",value:"夜"},
],
yearOptions: [],
// 表格选中数据
selectionList: [],
};
},
mounted() {
this.loadOptionData();
},
methods: {
/**获取下来框数据 */
loadOptionData() {
getColumnOptions("monitor_year").then((res) => {
this.yearOptions = res.data.data.map((item) => {
return {
label: item,
value: item,
};
});
this.where.year = this.yearOptions[0].value;
this.reload();
});
},
/* 刷新表格 */
reload() {
this.$refs.table.reload({
where: this.where,
});
},
/* 重置搜索 */
reset() {
this.reload();
},
exportFile() {
const arr = [];
const th = this.columns.map((item) => item.title);
arr.push(th);
this.data.forEach((d) => {
const td = this.columns.map((item) => d[item.dataIndex]);
arr.push(td);
});
let sheet = XLSX.utils.aoa_to_sheet(arr);
this.$util.exportSheet(XLSX, sheet, new Date().getTime().toString());
},
},
};
</script>
<style scoped lang="less">
</style>