酸雨统计
This commit is contained in:
@@ -1,213 +0,0 @@
|
||||
<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 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="area"
|
||||
: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 { pageZoneNoiseStatisticUrl, 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: "StatisticSoundZoneAverage",
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
data: [],
|
||||
locale,
|
||||
bill: {},
|
||||
// 表格数据接口
|
||||
url: pageZoneNoiseStatisticUrl,
|
||||
selection: [],
|
||||
// 表格列配置
|
||||
columns: [
|
||||
{
|
||||
title: "噪声源分类",
|
||||
dataIndex: "source",
|
||||
},
|
||||
{
|
||||
title: "测点数(个)",
|
||||
dataIndex: "count",
|
||||
},
|
||||
{
|
||||
title: "声源占比(%)",
|
||||
dataIndex: "rate",
|
||||
},
|
||||
{
|
||||
title: "时段",
|
||||
dataIndex: "timeSlot",
|
||||
},
|
||||
{
|
||||
title: "监测结果",
|
||||
children: [
|
||||
{
|
||||
title: "Leq",
|
||||
dataIndex: "leq",
|
||||
},
|
||||
{
|
||||
title: "L10",
|
||||
dataIndex: "l10",
|
||||
},
|
||||
{
|
||||
title: "L50",
|
||||
dataIndex: "l50",
|
||||
},
|
||||
{
|
||||
title: "L90",
|
||||
dataIndex: "l90",
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
// 表格搜索条件
|
||||
where: {},
|
||||
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.reload();
|
||||
});
|
||||
},
|
||||
/* 刷新表格 */
|
||||
reload() {
|
||||
const columns = [
|
||||
{
|
||||
title: "城区",
|
||||
dataIndex: "area"
|
||||
}
|
||||
]
|
||||
this.yearOptions.forEach(item=>{
|
||||
const {startYear,endYear} = this.where;
|
||||
if((startYear&& Number(startYear)>Number(item.value))|| (endYear&&Number(endYear)<Number(item.value))){
|
||||
console.log("");
|
||||
}else{
|
||||
columns.push({
|
||||
title: item.value + "年噪声值",
|
||||
dataIndex: item.value + "Leq"
|
||||
})
|
||||
}
|
||||
|
||||
})
|
||||
this.columns = columns;
|
||||
|
||||
this.$refs.table.reload({
|
||||
where: this.where,
|
||||
});
|
||||
},
|
||||
/* 重置搜索 */
|
||||
reset() {
|
||||
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 arr = [];
|
||||
const th = columns.map((item) => item.title);
|
||||
arr.push(th);
|
||||
this.data.forEach((d) => {
|
||||
const td = 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>
|
||||
181
src/views/atmosphere/acid-rain/statistic/city.vue
Normal file
181
src/views/atmosphere/acid-rain/statistic/city.vue
Normal file
@@ -0,0 +1,181 @@
|
||||
<template>
|
||||
<div class="ele-body">
|
||||
<a-card :bordered="false">
|
||||
<!-- 搜索表单 -->
|
||||
<a-form
|
||||
:model="where"
|
||||
layout="vertical"
|
||||
: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.regionLevel">-->
|
||||
<!-- <a-select-option-->
|
||||
<!-- v-for="(item) in modelOptions"-->
|
||||
<!-- :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-range-picker v-model:value="time"/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-row>
|
||||
<a-col :lg="24" :md="24" :sm="24" :xs="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-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
<!-- 表格 -->
|
||||
<ele-pro-table
|
||||
v-model:selection="selectionList"
|
||||
ref="table"
|
||||
row-key="ambientAirId"
|
||||
:need-page="false"
|
||||
:datasource="url"
|
||||
:columns="columns"
|
||||
:where="where"
|
||||
:scroll="{ x: 'max-content' }"
|
||||
:init-load="false"
|
||||
@done="(d) => (data = d.data)"
|
||||
method="POST"
|
||||
>
|
||||
|
||||
</ele-pro-table>
|
||||
</a-card>
|
||||
</div>
|
||||
<!-- 编辑弹窗 -->
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import _ from "lodash";
|
||||
import XLSX from "xlsx";
|
||||
import {statisticCity, getColumnOptions} from "@/api/ecology/acid";
|
||||
import { Modal } from "ant-design-vue";
|
||||
import locale from "ant-design-vue/es/date-picker/locale/zh_CN";
|
||||
import moment from "moment";
|
||||
|
||||
// import utils from "./utils";
|
||||
export default {
|
||||
name: "StatisticAcidCity",
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
data: [],
|
||||
locale,
|
||||
bill: {},
|
||||
// 表格数据接口
|
||||
url: statisticCity,
|
||||
selection: [],
|
||||
modelOptions: [
|
||||
{label: "市", value: "city"},
|
||||
{label: "县", value: "county"},
|
||||
{label: "站点", value: "place"},
|
||||
|
||||
],
|
||||
// 表格列配置
|
||||
columns: [
|
||||
{title: "xx", dataIndex: "place",align:"center"},
|
||||
],
|
||||
regionLevelOptions: [],
|
||||
time: undefined,
|
||||
// 表格搜索条件
|
||||
where: {
|
||||
},
|
||||
// 表格选中数据
|
||||
selectionList: [],
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.loadOptionData();
|
||||
this.reload();
|
||||
},
|
||||
methods: {
|
||||
/**获取下来框数据 */
|
||||
loadOptionData() {
|
||||
getColumnOptions("region_level").then((res) => {
|
||||
this.regionLevelOptions = res.data.data.map((item) => {
|
||||
return {
|
||||
label: item,
|
||||
value: item,
|
||||
};
|
||||
});
|
||||
});
|
||||
},
|
||||
/* 刷新表格 */
|
||||
reload() {
|
||||
const where = _.cloneDeep(this.where);
|
||||
const year = new Date().getFullYear();
|
||||
if (!this.time) {
|
||||
where.timeStart = `${year}-01-01 00:00:00`;
|
||||
where.timeEnd = moment(Date.now()).format("YYYY-MM-DD 00:00:00")
|
||||
} else {
|
||||
if(this.time[0].year() != this.time[1].year()){
|
||||
Modal.error({
|
||||
title: "查询失败",
|
||||
content: "开始时间与结束时间年份不一致",
|
||||
})
|
||||
return;
|
||||
}
|
||||
where.timeStart = this.time[0].format("YYYY-MM-DD 00:00:00");
|
||||
where.timeEnd = this.time[1].format("YYYY-MM-DD 00:00:00");
|
||||
}
|
||||
this.$refs.table.reload({
|
||||
where
|
||||
});
|
||||
},
|
||||
/* 重置搜索 */
|
||||
reset() {
|
||||
this.where = {
|
||||
};
|
||||
this.time = undefined;
|
||||
this.reload();
|
||||
},
|
||||
exportFile() {
|
||||
const arr = [];
|
||||
const th1 = [];
|
||||
const th2 = [];
|
||||
const merges = []; // 合并
|
||||
const columnsTemp = []; // 树形结构整理成list
|
||||
this.columns.forEach((item,index)=>{
|
||||
if(item.children){
|
||||
item.children.forEach((citem)=>{
|
||||
th1.push(item.title)
|
||||
th2.push(citem.title)
|
||||
columnsTemp.push(citem)
|
||||
})
|
||||
merges.push({s: {r: 0, c: th1.length-item.children.length}, e: {r: 0, c: th1.length-1}})
|
||||
}else{
|
||||
th1.push(item.title)
|
||||
th2.push("")
|
||||
columnsTemp.push(item)
|
||||
merges.push({s: {r: 0, c: index}, e: {r: 1, c: index}})
|
||||
}
|
||||
})
|
||||
arr.push(th1,th2);
|
||||
this.data.forEach((d) => {
|
||||
const td = columnsTemp.map((item) => d[item.dataIndex]);
|
||||
arr.push(td);
|
||||
});
|
||||
let sheet = XLSX.utils.aoa_to_sheet(arr);
|
||||
sheet['!merges'] = merges;
|
||||
this.$util.exportSheet(XLSX, sheet, new Date().getTime().toString());
|
||||
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
</style>
|
||||
181
src/views/atmosphere/acid-rain/statistic/county.vue
Normal file
181
src/views/atmosphere/acid-rain/statistic/county.vue
Normal file
@@ -0,0 +1,181 @@
|
||||
<template>
|
||||
<div class="ele-body">
|
||||
<a-card :bordered="false">
|
||||
<!-- 搜索表单 -->
|
||||
<a-form
|
||||
:model="where"
|
||||
layout="vertical"
|
||||
: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.regionLevel">-->
|
||||
<!-- <a-select-option-->
|
||||
<!-- v-for="(item) in modelOptions"-->
|
||||
<!-- :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-range-picker v-model:value="time"/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-row>
|
||||
<a-col :lg="24" :md="24" :sm="24" :xs="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-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
<!-- 表格 -->
|
||||
<ele-pro-table
|
||||
v-model:selection="selectionList"
|
||||
ref="table"
|
||||
row-key="ambientAirId"
|
||||
:need-page="false"
|
||||
:datasource="url"
|
||||
:columns="columns"
|
||||
:where="where"
|
||||
:scroll="{ x: 'max-content' }"
|
||||
:init-load="false"
|
||||
@done="(d) => (data = d.data)"
|
||||
method="POST"
|
||||
>
|
||||
|
||||
</ele-pro-table>
|
||||
</a-card>
|
||||
</div>
|
||||
<!-- 编辑弹窗 -->
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import _ from "lodash";
|
||||
import XLSX from "xlsx";
|
||||
import {statisticCounty, getColumnOptions} from "@/api/ecology/acid";
|
||||
import { Modal } from "ant-design-vue";
|
||||
import locale from "ant-design-vue/es/date-picker/locale/zh_CN";
|
||||
import moment from "moment";
|
||||
|
||||
// import utils from "./utils";
|
||||
export default {
|
||||
name: "StatisticAcidCounty",
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
data: [],
|
||||
locale,
|
||||
bill: {},
|
||||
// 表格数据接口
|
||||
url: statisticCounty,
|
||||
selection: [],
|
||||
modelOptions: [
|
||||
{label: "市", value: "city"},
|
||||
{label: "县", value: "county"},
|
||||
{label: "站点", value: "place"},
|
||||
|
||||
],
|
||||
// 表格列配置
|
||||
columns: [
|
||||
{title: "xx", dataIndex: "place",align:"center"},
|
||||
],
|
||||
regionLevelOptions: [],
|
||||
time: undefined,
|
||||
// 表格搜索条件
|
||||
where: {
|
||||
},
|
||||
// 表格选中数据
|
||||
selectionList: [],
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.loadOptionData();
|
||||
this.reload();
|
||||
},
|
||||
methods: {
|
||||
/**获取下来框数据 */
|
||||
loadOptionData() {
|
||||
getColumnOptions("region_level").then((res) => {
|
||||
this.regionLevelOptions = res.data.data.map((item) => {
|
||||
return {
|
||||
label: item,
|
||||
value: item,
|
||||
};
|
||||
});
|
||||
});
|
||||
},
|
||||
/* 刷新表格 */
|
||||
reload() {
|
||||
const where = _.cloneDeep(this.where);
|
||||
const year = new Date().getFullYear();
|
||||
if (!this.time) {
|
||||
where.timeStart = `${year}-01-01 00:00:00`;
|
||||
where.timeEnd = moment(Date.now()).format("YYYY-MM-DD 00:00:00")
|
||||
} else {
|
||||
if(this.time[0].year() != this.time[1].year()){
|
||||
Modal.error({
|
||||
title: "查询失败",
|
||||
content: "开始时间与结束时间年份不一致",
|
||||
})
|
||||
return;
|
||||
}
|
||||
where.timeStart = this.time[0].format("YYYY-MM-DD 00:00:00");
|
||||
where.timeEnd = this.time[1].format("YYYY-MM-DD 00:00:00");
|
||||
}
|
||||
this.$refs.table.reload({
|
||||
where
|
||||
});
|
||||
},
|
||||
/* 重置搜索 */
|
||||
reset() {
|
||||
this.where = {
|
||||
};
|
||||
this.time = undefined;
|
||||
this.reload();
|
||||
},
|
||||
exportFile() {
|
||||
const arr = [];
|
||||
const th1 = [];
|
||||
const th2 = [];
|
||||
const merges = []; // 合并
|
||||
const columnsTemp = []; // 树形结构整理成list
|
||||
this.columns.forEach((item,index)=>{
|
||||
if(item.children){
|
||||
item.children.forEach((citem)=>{
|
||||
th1.push(item.title)
|
||||
th2.push(citem.title)
|
||||
columnsTemp.push(citem)
|
||||
})
|
||||
merges.push({s: {r: 0, c: th1.length-item.children.length}, e: {r: 0, c: th1.length-1}})
|
||||
}else{
|
||||
th1.push(item.title)
|
||||
th2.push("")
|
||||
columnsTemp.push(item)
|
||||
merges.push({s: {r: 0, c: index}, e: {r: 1, c: index}})
|
||||
}
|
||||
})
|
||||
arr.push(th1,th2);
|
||||
this.data.forEach((d) => {
|
||||
const td = columnsTemp.map((item) => d[item.dataIndex]);
|
||||
arr.push(td);
|
||||
});
|
||||
let sheet = XLSX.utils.aoa_to_sheet(arr);
|
||||
sheet['!merges'] = merges;
|
||||
this.$util.exportSheet(XLSX, sheet, new Date().getTime().toString());
|
||||
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
</style>
|
||||
@@ -1,42 +1,51 @@
|
||||
<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-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="city" tab="市统计">
|
||||
<city-statistic></city-statistic>
|
||||
</a-tab-pane>
|
||||
<a-tab-pane key="county" tab="县统计">
|
||||
<county-statistic></county-statistic>
|
||||
</a-tab-pane>
|
||||
<a-tab-pane key="ion" tab="酸雨离子统计">
|
||||
<ion-statistic></ion-statistic>
|
||||
</a-tab-pane>
|
||||
</a-tabs>
|
||||
</a-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
/**
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
import BaseStatistic from "./base.vue";
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
import BaseStatistic from "./base.vue";
|
||||
import CityStatistic from "./city.vue";
|
||||
import CountyStatistic from "./county.vue";
|
||||
import IonStatistic from "./ion.vue";
|
||||
|
||||
export default {
|
||||
|
||||
export default {
|
||||
name: 'StatisticAcidRain',
|
||||
components: {
|
||||
BaseStatistic,
|
||||
|
||||
BaseStatistic, CityStatistic,CountyStatistic,IonStatistic
|
||||
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
activeKey: 'base'
|
||||
};
|
||||
|
||||
},
|
||||
methods: {
|
||||
|
||||
}
|
||||
return {
|
||||
activeKey: 'city'
|
||||
};
|
||||
|
||||
}
|
||||
},
|
||||
methods: {}
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
193
src/views/atmosphere/acid-rain/statistic/ion.vue
Normal file
193
src/views/atmosphere/acid-rain/statistic/ion.vue
Normal file
@@ -0,0 +1,193 @@
|
||||
<template>
|
||||
<div class="ele-body">
|
||||
<a-card :bordered="false">
|
||||
<!-- 搜索表单 -->
|
||||
<a-form
|
||||
:model="where"
|
||||
layout="vertical"
|
||||
: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.regionLevel">-->
|
||||
<!-- <a-select-option-->
|
||||
<!-- v-for="(item) in modelOptions"-->
|
||||
<!-- :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-range-picker v-model:value="time"/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-row>
|
||||
<a-col :lg="24" :md="24" :sm="24" :xs="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-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
<!-- 表格 -->
|
||||
<ele-pro-table
|
||||
v-model:selection="selectionList"
|
||||
ref="table"
|
||||
row-key="ambientAirId"
|
||||
:need-page="false"
|
||||
:datasource="url"
|
||||
:columns="columns"
|
||||
:where="where"
|
||||
:scroll="{ x: 'max-content' }"
|
||||
:init-load="false"
|
||||
@done="(d) => (data = d.data)"
|
||||
method="POST"
|
||||
>
|
||||
|
||||
</ele-pro-table>
|
||||
</a-card>
|
||||
</div>
|
||||
<!-- 编辑弹窗 -->
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import _ from "lodash";
|
||||
import XLSX from "xlsx";
|
||||
import {statisticIon, getColumnOptions} from "@/api/ecology/acid";
|
||||
import { Modal } from "ant-design-vue";
|
||||
import locale from "ant-design-vue/es/date-picker/locale/zh_CN";
|
||||
import moment from "moment";
|
||||
|
||||
// import utils from "./utils";
|
||||
export default {
|
||||
name: "StatisticAcidion",
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
data: [],
|
||||
locale,
|
||||
bill: {},
|
||||
// 表格数据接口
|
||||
url: statisticIon,
|
||||
selection: [],
|
||||
modelOptions: [
|
||||
{label: "市", value: "city"},
|
||||
{label: "县", value: "county"},
|
||||
{label: "站点", value: "place"},
|
||||
|
||||
],
|
||||
// 表格列配置
|
||||
columns: [
|
||||
{title: "点位", dataIndex: "place",align:"center"},
|
||||
{title: "SO42", dataIndex: "so42",align:"center"},
|
||||
{title: "NO3", dataIndex: "no3",align:"center"},
|
||||
{title: "F", dataIndex: "f",align:"center"},
|
||||
{title: "CL", dataIndex: "cl",align:"center"},
|
||||
{title: "NH4", dataIndex: "nh4",align:"center"},
|
||||
{title: "钙离子", dataIndex: "ca",align:"center"},
|
||||
{title: "镁离子", dataIndex: "mg",align:"center"},
|
||||
{title: "Na", dataIndex: "na",align:"center"},
|
||||
{title: "k", dataIndex: "k",align:"center"},
|
||||
{title: "总阴离子", dataIndex: "totalAnion",align:"center"},
|
||||
{title: "总阳离子", dataIndex: "totalCations",align:"center"},
|
||||
{title: "阴阳离子比例", dataIndex: "anionCationRatio",align:"center"},
|
||||
],
|
||||
regionLevelOptions: [],
|
||||
time: undefined,
|
||||
// 表格搜索条件
|
||||
where: {
|
||||
},
|
||||
// 表格选中数据
|
||||
selectionList: [],
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.loadOptionData();
|
||||
this.reload();
|
||||
},
|
||||
methods: {
|
||||
/**获取下来框数据 */
|
||||
loadOptionData() {
|
||||
getColumnOptions("region_level").then((res) => {
|
||||
this.regionLevelOptions = res.data.data.map((item) => {
|
||||
return {
|
||||
label: item,
|
||||
value: item,
|
||||
};
|
||||
});
|
||||
});
|
||||
},
|
||||
/* 刷新表格 */
|
||||
reload() {
|
||||
const where = _.cloneDeep(this.where);
|
||||
const year = new Date().getFullYear();
|
||||
if (!this.time) {
|
||||
where.timeStart = `${year}-01-01 00:00:00`;
|
||||
where.timeEnd = moment(Date.now()).format("YYYY-MM-DD 00:00:00")
|
||||
} else {
|
||||
if(this.time[0].year() != this.time[1].year()){
|
||||
Modal.error({
|
||||
title: "查询失败",
|
||||
content: "开始时间与结束时间年份不一致",
|
||||
})
|
||||
return;
|
||||
}
|
||||
where.timeStart = this.time[0].format("YYYY-MM-DD 00:00:00");
|
||||
where.timeEnd = this.time[1].format("YYYY-MM-DD 00:00:00");
|
||||
}
|
||||
this.$refs.table.reload({
|
||||
where
|
||||
});
|
||||
},
|
||||
/* 重置搜索 */
|
||||
reset() {
|
||||
this.where = {
|
||||
};
|
||||
this.time = undefined;
|
||||
this.reload();
|
||||
},
|
||||
exportFile() {
|
||||
const arr = [];
|
||||
const th1 = [];
|
||||
const th2 = [];
|
||||
const merges = []; // 合并
|
||||
const columnsTemp = []; // 树形结构整理成list
|
||||
this.columns.forEach((item,index)=>{
|
||||
if(item.children){
|
||||
item.children.forEach((citem)=>{
|
||||
th1.push(item.title)
|
||||
th2.push(citem.title)
|
||||
columnsTemp.push(citem)
|
||||
})
|
||||
merges.push({s: {r: 0, c: th1.length-item.children.length}, e: {r: 0, c: th1.length-1}})
|
||||
}else{
|
||||
th1.push(item.title)
|
||||
th2.push("")
|
||||
columnsTemp.push(item)
|
||||
merges.push({s: {r: 0, c: index}, e: {r: 1, c: index}})
|
||||
}
|
||||
})
|
||||
arr.push(th1,th2);
|
||||
this.data.forEach((d) => {
|
||||
const td = columnsTemp.map((item) => d[item.dataIndex]);
|
||||
arr.push(td);
|
||||
});
|
||||
let sheet = XLSX.utils.aoa_to_sheet(arr);
|
||||
sheet['!merges'] = merges;
|
||||
this.$util.exportSheet(XLSX, sheet, new Date().getTime().toString());
|
||||
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
</style>
|
||||
@@ -1,195 +0,0 @@
|
||||
<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 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="(record) => record.source + record.timeSlot"
|
||||
: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 { statisticSourceUrl, 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: statisticSourceUrl,
|
||||
selection: [],
|
||||
// 表格列配置
|
||||
columns: [
|
||||
{
|
||||
title: "噪声源分类",
|
||||
dataIndex: "source",
|
||||
},
|
||||
{
|
||||
title: "测点数(个)",
|
||||
dataIndex: "count",
|
||||
},
|
||||
{
|
||||
title: "声源占比(%)",
|
||||
dataIndex: "rate",
|
||||
},
|
||||
{
|
||||
title: "时段",
|
||||
dataIndex: "timeSlot",
|
||||
},
|
||||
{
|
||||
title: "监测结果",
|
||||
children: [
|
||||
{
|
||||
title: "Leq",
|
||||
dataIndex: "leq",
|
||||
},
|
||||
{
|
||||
title: "L10",
|
||||
dataIndex: "l10",
|
||||
},
|
||||
{
|
||||
title: "L50",
|
||||
dataIndex: "l50",
|
||||
},
|
||||
{
|
||||
title: "L90",
|
||||
dataIndex: "l90",
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
// 表格搜索条件
|
||||
where: {},
|
||||
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 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 arr = [];
|
||||
const th = columns.map((item) => item.title);
|
||||
arr.push(th);
|
||||
this.data.forEach((d) => {
|
||||
const td = 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>
|
||||
@@ -1,224 +0,0 @@
|
||||
<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.startYear" allowClear showSearch>
|
||||
<a-select-option
|
||||
v-for="item in yearOptions"
|
||||
:disabled="item.value > where.endYear"
|
||||
: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.endYear" allowClear showSearch>
|
||||
<a-select-option
|
||||
v-for="item in yearOptions"
|
||||
:disabled="item.value < where.startYear"
|
||||
: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="(record) => record.source + record.timeSlot"
|
||||
: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 { statisticYearUrl, 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: statisticYearUrl,
|
||||
selection: [],
|
||||
// 表格列配置
|
||||
columns: [
|
||||
{
|
||||
title: "年份",
|
||||
dataIndex: "year",
|
||||
},
|
||||
{
|
||||
title: "网格长(米)",
|
||||
dataIndex: "gridLength",
|
||||
},
|
||||
{
|
||||
title: "网格宽(米)",
|
||||
dataIndex: "gridWidth",
|
||||
},
|
||||
{
|
||||
title: "网格总数",
|
||||
dataIndex: "gridCount",
|
||||
},
|
||||
{
|
||||
title: "时段",
|
||||
dataIndex: "timeSlot",
|
||||
},
|
||||
{
|
||||
title: "监测结果",
|
||||
children: [
|
||||
{
|
||||
title: "Leq",
|
||||
dataIndex: "leq",
|
||||
},
|
||||
{
|
||||
title: "L10",
|
||||
dataIndex: "l10",
|
||||
},
|
||||
{
|
||||
title: "L50",
|
||||
dataIndex: "l50",
|
||||
},
|
||||
{
|
||||
title: "L90",
|
||||
dataIndex: "l90",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: "质量等级",
|
||||
dataIndex: "level",
|
||||
},
|
||||
],
|
||||
// 表格搜索条件
|
||||
where: {},
|
||||
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.reload();
|
||||
});
|
||||
},
|
||||
/* 刷新表格 */
|
||||
reload() {
|
||||
this.$refs.table.reload({
|
||||
where: this.where,
|
||||
});
|
||||
},
|
||||
/* 重置搜索 */
|
||||
reset() {
|
||||
this.reload();
|
||||
},
|
||||
exportFile() {
|
||||
const columns = [
|
||||
{
|
||||
title: "年份",
|
||||
dataIndex: "year",
|
||||
},
|
||||
{
|
||||
title: "网格长(米)",
|
||||
dataIndex: "gridLength",
|
||||
},
|
||||
{
|
||||
title: "网格宽(米)",
|
||||
dataIndex: "gridWidth",
|
||||
},
|
||||
{
|
||||
title: "网格总数",
|
||||
dataIndex: "gridCount",
|
||||
},
|
||||
{
|
||||
title: "时段",
|
||||
dataIndex: "timeSlot",
|
||||
},
|
||||
|
||||
{
|
||||
title: "Leq",
|
||||
dataIndex: "leq",
|
||||
},
|
||||
{
|
||||
title: "L10",
|
||||
dataIndex: "l10",
|
||||
},
|
||||
{
|
||||
title: "L50",
|
||||
dataIndex: "l50",
|
||||
},
|
||||
{
|
||||
title: "L90",
|
||||
dataIndex: "l90",
|
||||
},
|
||||
|
||||
{
|
||||
title: "质量等级",
|
||||
dataIndex: "level",
|
||||
},
|
||||
];
|
||||
|
||||
const arr = [];
|
||||
const th = columns.map((item) => item.title);
|
||||
arr.push(th);
|
||||
this.data.forEach((d) => {
|
||||
const td = 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>
|
||||
Reference in New Issue
Block a user