江河水数据采集代码优化
This commit is contained in:
@@ -27,8 +27,8 @@
|
|||||||
<DownOutlined />
|
<DownOutlined />
|
||||||
</a-button>
|
</a-button>
|
||||||
</a-dropdown>
|
</a-dropdown>
|
||||||
<a-button @click="showModalWater" >水站导入</a-button>
|
|
||||||
<a-modal v-model:visible="visibleWater" title="水站导入" :footer="null">
|
<!-- <a-modal v-model:visible="visibleWater" title="水站导入" :footer="null">
|
||||||
<a-select allowClear placeholder="请选择站名" @change="currentSel" style="width:150px">
|
<a-select allowClear placeholder="请选择站名" @change="currentSel" style="width:150px">
|
||||||
<a-select-option
|
<a-select-option
|
||||||
v-for="item in form"
|
v-for="item in form"
|
||||||
@@ -43,7 +43,20 @@
|
|||||||
accept=".xls,.xlsx,.csv">
|
accept=".xls,.xlsx,.csv">
|
||||||
<a-button key="submit" type="primary" :loading="loading">导入</a-button>
|
<a-button key="submit" type="primary" :loading="loading">导入</a-button>
|
||||||
</a-upload>
|
</a-upload>
|
||||||
</a-modal>
|
</a-modal> -->
|
||||||
|
<a-dropdown>
|
||||||
|
<template #overlay>
|
||||||
|
<a-menu @click="handleMenuClick">
|
||||||
|
<a-menu-item v-for="item in form" :key="item.waterStationPointId">
|
||||||
|
{{ item.stationName }}
|
||||||
|
<a-upload :before-upload="importFileStation" @change="currentSel(item)" :showUploadList="false" accept=".xls,.xlsx,.csv">
|
||||||
|
水站数据导入
|
||||||
|
</a-upload>
|
||||||
|
</a-menu-item>
|
||||||
|
</a-menu>
|
||||||
|
</template>
|
||||||
|
<a-button >水站导入 <DownOutlined /></a-button>
|
||||||
|
</a-dropdown>
|
||||||
<a-dropdown>
|
<a-dropdown>
|
||||||
<template #overlay>
|
<template #overlay>
|
||||||
<a-menu style="word-spacing:10px;">
|
<a-menu style="word-spacing:10px;">
|
||||||
@@ -128,6 +141,31 @@
|
|||||||
param: {}
|
param: {}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
created(){
|
||||||
|
this.form=[];
|
||||||
|
listInfo().then((res) => {
|
||||||
|
if (res.data.code == 0) {
|
||||||
|
console.log(res.data.data)
|
||||||
|
this.visibleWater = true;
|
||||||
|
// this.form = res.data.data.map(item => {
|
||||||
|
// return {
|
||||||
|
// riverName: item.riverName,
|
||||||
|
// stationName: item.stationName,
|
||||||
|
// system:item.system,
|
||||||
|
// waterStationPointId:item.waterStationPointId,
|
||||||
|
// waterTarget:item.waterTarget
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
res.data.data.forEach(e => {
|
||||||
|
this.form.push(e);
|
||||||
|
});
|
||||||
|
console.log("this.form"+this.form[0].stationName)
|
||||||
|
} else {
|
||||||
|
this.$message.error(res.data.msg);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
showModalWater(){
|
showModalWater(){
|
||||||
@@ -136,6 +174,7 @@
|
|||||||
console.log(res.data.data)
|
console.log(res.data.data)
|
||||||
this.visibleWater = true;
|
this.visibleWater = true;
|
||||||
this.form = res.data.data
|
this.form = res.data.data
|
||||||
|
console.log("this.form"+this.form.stationName)
|
||||||
} else {
|
} else {
|
||||||
this.$message.error(res.data.msg);
|
this.$message.error(res.data.msg);
|
||||||
}
|
}
|
||||||
@@ -301,6 +340,7 @@
|
|||||||
const tasks = [];
|
const tasks = [];
|
||||||
if (billData.length > 0) {
|
if (billData.length > 0) {
|
||||||
if (this.exportType == "1") {
|
if (this.exportType == "1") {
|
||||||
|
console.log(billName);
|
||||||
tasks.push(
|
tasks.push(
|
||||||
saveWaterFunctionAreaBill({
|
saveWaterFunctionAreaBill({
|
||||||
billName: billName,
|
billName: billName,
|
||||||
@@ -309,6 +349,7 @@
|
|||||||
})
|
})
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
|
console.log(billName);
|
||||||
tasks.push(
|
tasks.push(
|
||||||
saveRiverStationBill({
|
saveRiverStationBill({
|
||||||
billName: billName,
|
billName: billName,
|
||||||
|
|||||||
@@ -306,35 +306,6 @@ export default {
|
|||||||
loading: false,
|
loading: false,
|
||||||
rules: {
|
rules: {
|
||||||
year: [{required: true, message: '请输入年份'}],
|
year: [{required: true, message: '请输入年份'}],
|
||||||
riverSystem:[{required: true, message: '请输入水系'
|
|
||||||
}],
|
|
||||||
riverLakeLibrary:[{required: true, message: '请输入河流、湖库名称'
|
|
||||||
}],
|
|
||||||
cityRegionName:[{required: true, message: '请输入所在地级行政区'
|
|
||||||
}],
|
|
||||||
waterFunctionalIndexCode:[{required: true, message: '请输入国家重要水功能区索引码' },],
|
|
||||||
|
|
||||||
|
|
||||||
waterFunctionalAreaType:[{required: true, message: '请输入水功能区类型'
|
|
||||||
}],
|
|
||||||
waterBodyType:[{required: true, message: '请输入水体类型'
|
|
||||||
}],
|
|
||||||
provinceRegionName:[{required: true, message: '请输入省级行政区名称'
|
|
||||||
}],
|
|
||||||
waterResourcesFirstLevelZoneName:[{required: true, message: '请输入水资源一级区名称'
|
|
||||||
}],
|
|
||||||
firstLevelWaterFunctionZoneName:[{required: true, message: '请输入一级水功能区名称'
|
|
||||||
}],
|
|
||||||
secondLevelWaterFunctionZoneName:[{required: true, message: '请输入二级水功能区名称'
|
|
||||||
}],
|
|
||||||
waterQualityGoal:[{required: true, message: '请输入水质目标'
|
|
||||||
}],
|
|
||||||
sectionName:[{required: true, message: '请输入断面名称'
|
|
||||||
}],
|
|
||||||
dataSources:[{required: true, message: '请输入数据来源'
|
|
||||||
}],
|
|
||||||
remark:[{required: true, message: '请输入备注'
|
|
||||||
}],
|
|
||||||
},
|
},
|
||||||
yearOptions: [],
|
yearOptions: [],
|
||||||
showNYear:false,
|
showNYear:false,
|
||||||
@@ -387,6 +358,7 @@ export default {
|
|||||||
this.showEdit = false;
|
this.showEdit = false;
|
||||||
this.$message.success(res.data.msg);
|
this.$message.success(res.data.msg);
|
||||||
this.reload();
|
this.reload();
|
||||||
|
this.getOptions();
|
||||||
} else {
|
} else {
|
||||||
this.$message.error(res.data.msg);
|
this.$message.error(res.data.msg);
|
||||||
}
|
}
|
||||||
@@ -404,6 +376,7 @@ export default {
|
|||||||
this.showEdit = false;
|
this.showEdit = false;
|
||||||
this.$message.success(res.data.msg);
|
this.$message.success(res.data.msg);
|
||||||
this.reload();
|
this.reload();
|
||||||
|
this.getOptions();
|
||||||
} else {
|
} else {
|
||||||
this.$message.error(res.data.msg);
|
this.$message.error(res.data.msg);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -308,53 +308,6 @@ export default {
|
|||||||
loading: false,
|
loading: false,
|
||||||
rules: {
|
rules: {
|
||||||
year: [{required: true, message: '请输入年份'}],
|
year: [{required: true, message: '请输入年份'}],
|
||||||
assessmentCity:[{ required:true,message: "请输入考核城市"}],
|
|
||||||
waterResourcesFirstLevelZoneName:[{required:true,message: "请输入水资源一级区名称"}],
|
|
||||||
waterResourcesTwoLevelZoneName:[{
|
|
||||||
required:true,message: "请输入水资源二级级区名称",
|
|
||||||
|
|
||||||
}],
|
|
||||||
waterResourcesThreeLevelZoneName:[{
|
|
||||||
required:true,message: "请输入水资源三级区名称",
|
|
||||||
}],
|
|
||||||
riverLakeLibrary:[{
|
|
||||||
required:true,message: "请输入河流、湖库名称",
|
|
||||||
}],
|
|
||||||
secondLevelWaterFunctionZoneName:[{
|
|
||||||
required:true,message: "请输入二级水功能区名称",
|
|
||||||
|
|
||||||
}],
|
|
||||||
waterFunctionalAreaCode:[{
|
|
||||||
required:true,message: "请输入水功能区编码",
|
|
||||||
|
|
||||||
}],
|
|
||||||
waterFunctionalAreaLevel:[{
|
|
||||||
required:true,message: "请输入水功能区等级",
|
|
||||||
}],
|
|
||||||
waterFunctionalAreaType:[{
|
|
||||||
required:true,message: "请输入水功能区类型",
|
|
||||||
|
|
||||||
}],
|
|
||||||
basinType:[{
|
|
||||||
required:true,message: "请输入水域类型",
|
|
||||||
}],
|
|
||||||
sectionName:[{
|
|
||||||
required:true,message: "请输入断面名称",
|
|
||||||
}],
|
|
||||||
waterQualityGoal:[ {
|
|
||||||
required:true,message: "请输入水质目标",
|
|
||||||
|
|
||||||
}],
|
|
||||||
riverLength:[{
|
|
||||||
required:true,message: "请输入河流长度(Km)",
|
|
||||||
}],
|
|
||||||
lakeArea:[{
|
|
||||||
required:true,message: "请输入湖泊面积(km2)",
|
|
||||||
}],
|
|
||||||
|
|
||||||
remark:[{
|
|
||||||
required:true,message: "请输入备注",
|
|
||||||
}]
|
|
||||||
},
|
},
|
||||||
yearOptions: [],
|
yearOptions: [],
|
||||||
showNYear:false,
|
showNYear:false,
|
||||||
@@ -406,6 +359,7 @@ export default {
|
|||||||
this.showEdit = false;
|
this.showEdit = false;
|
||||||
this.$message.success(res.data.msg);
|
this.$message.success(res.data.msg);
|
||||||
this.reload();
|
this.reload();
|
||||||
|
this.getOptions();
|
||||||
} else {
|
} else {
|
||||||
this.$message.error(res.data.msg);
|
this.$message.error(res.data.msg);
|
||||||
}
|
}
|
||||||
@@ -423,6 +377,7 @@ export default {
|
|||||||
this.showEdit = false;
|
this.showEdit = false;
|
||||||
this.$message.success(res.data.msg);
|
this.$message.success(res.data.msg);
|
||||||
this.reload();
|
this.reload();
|
||||||
|
this.getOptions();
|
||||||
} else {
|
} else {
|
||||||
this.$message.error(res.data.msg);
|
this.$message.error(res.data.msg);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -255,17 +255,6 @@ export default {
|
|||||||
year: [{required: true, message: '请输入年份'}],
|
year: [{required: true, message: '请输入年份'}],
|
||||||
sectionCode:[{required: true,message: '请输入断面编码'}],
|
sectionCode:[{required: true,message: '请输入断面编码'}],
|
||||||
sectionName:[{required: true,message: '请输入断面名称'}],
|
sectionName:[{required: true,message: '请输入断面名称'}],
|
||||||
province: [{required: true,message: '请输入所属省份',},],
|
|
||||||
city: [{required: true,message: '请输入所属城市',},],
|
|
||||||
assessmentProvince:[{required: true,message: '请输入考核省份'}],
|
|
||||||
sectionType: [{required: true,message: '请输入断面类型',},],
|
|
||||||
sectionAttribute: [{required: true,message: '请输入断面属性',},],
|
|
||||||
waterTarget: [{required: true,message: '请输入水质目标',},],
|
|
||||||
basin: [{required: true,message: '请输入流域',},],
|
|
||||||
riverSystem:[{required: true,message: '请输入水系'}],
|
|
||||||
waterBody: [{required: true,message: '请输入所在水体',},],
|
|
||||||
importWaterBody: [{required: true,message: '请输入汇入水体',},],
|
|
||||||
riverLevel: [{required: true,message: '请输入河流级别',},],
|
|
||||||
},
|
},
|
||||||
yearOptions: [],
|
yearOptions: [],
|
||||||
showNYear:false,
|
showNYear:false,
|
||||||
@@ -310,6 +299,7 @@ export default {
|
|||||||
this.showEdit = false;
|
this.showEdit = false;
|
||||||
this.$message.success(res.data.msg);
|
this.$message.success(res.data.msg);
|
||||||
this.reload();
|
this.reload();
|
||||||
|
this.getOptions();
|
||||||
} else {
|
} else {
|
||||||
this.$message.error(res.data.msg);
|
this.$message.error(res.data.msg);
|
||||||
}
|
}
|
||||||
@@ -327,6 +317,7 @@ export default {
|
|||||||
this.showEdit = false;
|
this.showEdit = false;
|
||||||
this.$message.success(res.data.msg);
|
this.$message.success(res.data.msg);
|
||||||
this.reload();
|
this.reload();
|
||||||
|
this.getOptions();
|
||||||
} else {
|
} else {
|
||||||
this.$message.error(res.data.msg);
|
this.$message.error(res.data.msg);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -211,10 +211,8 @@ export default {
|
|||||||
loading: false,
|
loading: false,
|
||||||
rules: {
|
rules: {
|
||||||
year: [{required: true, message: '请输入年份'}],
|
year: [{required: true, message: '请输入年份'}],
|
||||||
riverName:[{required: true,message: '请输入所在河流名称'}],
|
|
||||||
stationName:[{required: true,message: '请输入自动站名称'}],
|
stationName:[{required: true,message: '请输入自动站名称'}],
|
||||||
system: [{required: true,message: '请输入所属系统',},],
|
system: [{required: true,message: '请输入所属系统',},],
|
||||||
waterTarget: [{required: true,message: '请输入水质目标',},],
|
|
||||||
},
|
},
|
||||||
yearOptions: [],
|
yearOptions: [],
|
||||||
showNYear:false,
|
showNYear:false,
|
||||||
@@ -259,6 +257,7 @@ export default {
|
|||||||
this.showEdit = false;
|
this.showEdit = false;
|
||||||
this.$message.success(res.data.msg);
|
this.$message.success(res.data.msg);
|
||||||
this.reload();
|
this.reload();
|
||||||
|
this.getOptions();
|
||||||
} else {
|
} else {
|
||||||
this.$message.error(res.data.msg);
|
this.$message.error(res.data.msg);
|
||||||
}
|
}
|
||||||
@@ -276,6 +275,7 @@ export default {
|
|||||||
this.showEdit = false;
|
this.showEdit = false;
|
||||||
this.$message.success(res.data.msg);
|
this.$message.success(res.data.msg);
|
||||||
this.reload();
|
this.reload();
|
||||||
|
this.getOptions();
|
||||||
} else {
|
} else {
|
||||||
this.$message.error(res.data.msg);
|
this.$message.error(res.data.msg);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,249 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="ele-body">
|
|
||||||
<a-card :bordered="false">
|
|
||||||
<!-- 搜索表单 -->
|
|
||||||
<a-form :model="where" layout="inline">
|
|
||||||
<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-form-item label="起始日期:">
|
|
||||||
<a-date-picker valueFormat="YYYY-MM-DD 00:00:00" v-model:value="where.timeStart"></a-date-picker>
|
|
||||||
</a-form-item>
|
|
||||||
<a-form-item label="结束日期:">
|
|
||||||
<a-date-picker valueFormat="YYYY-MM-DD 23:59:59" v-model:value="where.timeEnd"></a-date-picker>
|
|
||||||
</a-form-item>
|
|
||||||
|
|
||||||
<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>
|
|
||||||
<!-- 表格 -->
|
|
||||||
<ele-pro-table
|
|
||||||
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 {statisticAreaBase, getColumnOptions} from "@/api/ecology/atmosphere/air";
|
|
||||||
// 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: "StatisticAirAreaBase",
|
|
||||||
components: {},
|
|
||||||
data() {
|
|
||||||
const year = new Date().getFullYear();
|
|
||||||
return {
|
|
||||||
data: [],
|
|
||||||
locale,
|
|
||||||
bill: {},
|
|
||||||
// 表格数据接口
|
|
||||||
url: statisticAreaBase,
|
|
||||||
selection: [],
|
|
||||||
modelOptions: [
|
|
||||||
{label: "市", value: "city"},
|
|
||||||
{label: "县", value: "county"},
|
|
||||||
{label: "站点", value: "place"},
|
|
||||||
|
|
||||||
],
|
|
||||||
// 表格列配置
|
|
||||||
columns: [
|
|
||||||
{title: "日期", dataIndex: "monitorTime", align: "center",customRender:({text})=>moment(text).format("YYYY-MM-DD"),fixed: "left"},
|
|
||||||
|
|
||||||
{title: "SO2五象", dataIndex: "wuXiangXinQuSo2", align: "center",customRender:({text})=> typeof text == "number"?text.toFixed(0)+"":""},
|
|
||||||
{title: "NO2五象", dataIndex: "wuXiangXinQuNo2", align: "center",customRender:({text})=> typeof text == "number"?text.toFixed(0)+"":""},
|
|
||||||
{title: "PM10五象", dataIndex: "wuXiangXinQuPm10", align: "center",customRender:({text})=> typeof text == "number"?text.toFixed(0)+"":""},
|
|
||||||
{title: "CO五象", dataIndex: "wuXiangXinQuCo", align: "center",customRender:({text})=> typeof text == "number"?text.toFixed(1)+"":""},
|
|
||||||
{title: "O3五象", dataIndex: "wuXiangXinQuO3", align: "center",customRender:({text})=> typeof text == "number"?text.toFixed(0)+"":""},
|
|
||||||
{title: "PM2.5五象", dataIndex: "wuXiangXinQuPm25", align: "center",customRender:({text})=> typeof text == "number"?text.toFixed(0)+"":""},
|
|
||||||
{title: "AQI五象", dataIndex: "wuXiangXinQuAqi", align: "center",customRender:({text})=> typeof text == "number"?text.toFixed(0)+"":""},
|
|
||||||
{title: "类别五象", dataIndex: "wuXiangXinQuAqiCategory", align: "center"},
|
|
||||||
|
|
||||||
{title: "SO2兴宁", dataIndex: "xingNingSo2", align: "center",customRender:({text})=> typeof text == "number"?text.toFixed(0)+"":""},
|
|
||||||
{title: "NO2兴宁", dataIndex: "xingNingNo2", align: "center",customRender:({text})=> typeof text == "number"?text.toFixed(0)+"":""},
|
|
||||||
{title: "PM10兴宁", dataIndex: "xingNingPm10", align: "center",customRender:({text})=> typeof text == "number"?text.toFixed(0)+"":""},
|
|
||||||
{title: "CO兴宁", dataIndex: "xingNingCo", align: "center",customRender:({text})=> typeof text == "number"?text.toFixed(1)+"":""},
|
|
||||||
{title: "O3_8h兴宁", dataIndex: "xingNingO3", align: "center",customRender:({text})=> typeof text == "number"?text.toFixed(0)+"":""},
|
|
||||||
{title: "PM2.5兴宁", dataIndex: "xingNingPm25", align: "center",customRender:({text})=> typeof text == "number"?text.toFixed(0)+"":""},
|
|
||||||
{title: "AQI兴宁", dataIndex: "xingNingAqi", align: "center",customRender:({text})=> typeof text == "number"?text.toFixed(0)+"":""},
|
|
||||||
{title: "类别兴宁", dataIndex: "xingNingAqiCategory", align: "center"},
|
|
||||||
|
|
||||||
{title: "SO2江南", dataIndex: "jiangNanSo2", align: "center",customRender:({text})=> typeof text == "number"?text.toFixed(0)+"":""},
|
|
||||||
{title: "NO2江南", dataIndex: "jiangNanNo2", align: "center",customRender:({text})=> typeof text == "number"?text.toFixed(0)+"":""},
|
|
||||||
{title: "PM10江南", dataIndex: "jiangNanPm10", align: "center",customRender:({text})=> typeof text == "number"?text.toFixed(0)+"":""},
|
|
||||||
{title: "CO江南", dataIndex: "jiangNanCo", align: "center",customRender:({text})=> typeof text == "number"?text.toFixed(1)+"":""},
|
|
||||||
{title: "O3_8h江南", dataIndex: "jiangNanO3", align: "center",customRender:({text})=> typeof text == "number"?text.toFixed(0)+"":""},
|
|
||||||
{title: "PM2.5江南", dataIndex: "jiangNanPm25", align: "center",customRender:({text})=> typeof text == "number"?text.toFixed(0)+"":""},
|
|
||||||
{title: "AQI江南", dataIndex: "jiangNanAqi", align: "center",customRender:({text})=> typeof text == "number"?text.toFixed(0)+"":""},
|
|
||||||
{title: "类别江南", dataIndex: "jiangNanAqiCategory", align: "center"},
|
|
||||||
|
|
||||||
{title: "SO2青秀", dataIndex: "qingXiuSo2", align: "center",customRender:({text})=> typeof text == "number"?text.toFixed(0)+"":""},
|
|
||||||
{title: "NO2青秀", dataIndex: "qingXiuNo2", align: "center",customRender:({text})=> typeof text == "number"?text.toFixed(0)+"":""},
|
|
||||||
{title: "PM10青秀", dataIndex: "qingXiuPm10", align: "center",customRender:({text})=> typeof text == "number"?text.toFixed(0)+"":""},
|
|
||||||
{title: "CO青秀", dataIndex: "qingXiuCo", align: "center",customRender:({text})=> typeof text == "number"?text.toFixed(1)+"":""},
|
|
||||||
{title: "O3_8h青秀", dataIndex: "qingXiuO3", align: "center",customRender:({text})=> typeof text == "number"?text.toFixed(0)+"":""},
|
|
||||||
{title: "PM2.5青秀", dataIndex: "qingXiuPm25", align: "center",customRender:({text})=> typeof text == "number"?text.toFixed(0)+"":""},
|
|
||||||
{title: "AQI青秀", dataIndex: "qingXiuAqi", align: "center",customRender:({text})=> typeof text == "number"?text.toFixed(0)+"":""},
|
|
||||||
{title: "类别青秀", dataIndex: "qingXiuAqiCategory", align: "center"},
|
|
||||||
|
|
||||||
{title: "SO2西乡塘", dataIndex: "xiXiangTangSo2", align: "center",customRender:({text})=> typeof text == "number"?text.toFixed(0)+"":""},
|
|
||||||
{title: "NO2西乡塘", dataIndex: "xiXiangTangNo2", align: "center",customRender:({text})=> typeof text == "number"?text.toFixed(0)+"":""},
|
|
||||||
{title: "PM10西乡塘", dataIndex: "xiXiangTangPm10", align: "center",customRender:({text})=> typeof text == "number"?text.toFixed(0)+"":""},
|
|
||||||
{title: "CO西乡塘", dataIndex: "xiXiangTangCo", align: "center",customRender:({text})=> typeof text == "number"?text.toFixed(1)+"":""},
|
|
||||||
{title: "O3_8h西乡塘", dataIndex: "xiXiangTangO3", align: "center",customRender:({text})=> typeof text == "number"?text.toFixed(0)+"":""},
|
|
||||||
{title: "PM2.5西乡塘", dataIndex: "xiXiangTangPm25", align: "center",customRender:({text})=> typeof text == "number"?text.toFixed(0)+"":""},
|
|
||||||
{title: "AQI西乡塘", dataIndex: "xiXiangTangAqi", align: "center",customRender:({text})=> typeof text == "number"?text.toFixed(0)+"":""},
|
|
||||||
{title: "类别西乡塘", dataIndex: "xiXiangTangAqiCategory", align: "center"},
|
|
||||||
|
|
||||||
{title: "SO2邕宁", dataIndex: "yongNingSo2", align: "center",customRender:({text})=> typeof text == "number"?text.toFixed(0)+"":""},
|
|
||||||
{title: "NO2邕宁", dataIndex: "yongNingNo2", align: "center",customRender:({text})=> typeof text == "number"?text.toFixed(0)+"":""},
|
|
||||||
{title: "PM10邕宁", dataIndex: "yongNingPm10", align: "center",customRender:({text})=> typeof text == "number"?text.toFixed(0)+"":""},
|
|
||||||
{title: "CO邕宁", dataIndex: "yongNingCo", align: "center",customRender:({text})=> typeof text == "number"?text.toFixed(1)+"":""},
|
|
||||||
{title: "O3_8h邕宁", dataIndex: "yongNingO3", align: "center",customRender:({text})=> typeof text == "number"?text.toFixed(0)+"":""},
|
|
||||||
{title: "PM2.5邕宁", dataIndex: "yongNingPm25", align: "center",customRender:({text})=> typeof text == "number"?text.toFixed(0)+"":""},
|
|
||||||
{title: "AQI邕宁", dataIndex: "yongNingAqi", align: "center",customRender:({text})=> typeof text == "number"?text.toFixed(0)+"":""},
|
|
||||||
{title: "类别邕宁", dataIndex: "yongNingAqiCategory", align: "center"},
|
|
||||||
|
|
||||||
{title: "SO2良庆", dataIndex: "liangQingSo2", align: "center",customRender:({text})=> typeof text == "number"?text.toFixed(0)+"":""},
|
|
||||||
{title: "NO2良庆", dataIndex: "liangQingNo2", align: "center",customRender:({text})=> typeof text == "number"?text.toFixed(0)+"":""},
|
|
||||||
{title: "PM10良庆", dataIndex: "liangQingPm10", align: "center",customRender:({text})=> typeof text == "number"?text.toFixed(0)+"":""},
|
|
||||||
{title: "CO良庆", dataIndex: "liangQingCo", align: "center",customRender:({text})=> typeof text == "number"?text.toFixed(1)+"":""},
|
|
||||||
{title: "O3_8h良庆", dataIndex: "liangQingO3", align: "center",customRender:({text})=> typeof text == "number"?text.toFixed(0)+"":""},
|
|
||||||
{title: "PM2.5良庆", dataIndex: "liangQingPm25", align: "center",customRender:({text})=> typeof text == "number"?text.toFixed(0)+"":""},
|
|
||||||
{title: "AQI良庆", dataIndex: "liangQingAqi", align: "center",customRender:({text})=> typeof text == "number"?text.toFixed(0)+"":""},
|
|
||||||
{title: "类别良庆", dataIndex: "liangQingAqiCategory", align: "center"},
|
|
||||||
|
|
||||||
{title: "SO2高新", dataIndex: "gaoXinSo2", align: "center",customRender:({text})=> typeof text == "number"?text.toFixed(0)+"":""},
|
|
||||||
{title: "NO2高新", dataIndex: "gaoXinNo2", align: "center",customRender:({text})=> typeof text == "number"?text.toFixed(0)+"":""},
|
|
||||||
{title: "PM10高新", dataIndex: "gaoXinPm10", align: "center",customRender:({text})=> typeof text == "number"?text.toFixed(0)+"":""},
|
|
||||||
{title: "CO高新", dataIndex: "gaoXinCo", align: "center",customRender:({text})=> typeof text == "number"?text.toFixed(1)+"":""},
|
|
||||||
{title: "O3_8h高新", dataIndex: "gaoXinO3", align: "center",customRender:({text})=> typeof text == "number"?text.toFixed(0)+"":""},
|
|
||||||
{title: "PM2.5高新", dataIndex: "gaoXinPm25", align: "center",customRender:({text})=> typeof text == "number"?text.toFixed(0)+"":""},
|
|
||||||
{title: "AQI高新", dataIndex: "gaoXinAqi", align: "center",customRender:({text})=> typeof text == "number"?text.toFixed(0)+"":""},
|
|
||||||
{title: "类别高新", dataIndex: "gaoXinAqiCategory", align: "center"},
|
|
||||||
|
|
||||||
{title: "SO2经开", dataIndex: "jingKaiSo2", align: "center",customRender:({text})=> typeof text == "number"?text.toFixed(0)+"":""},
|
|
||||||
{title: "NO2经开", dataIndex: "jingKaiNo2", align: "center",customRender:({text})=> typeof text == "number"?text.toFixed(0)+"":""},
|
|
||||||
{title: "PM10经开", dataIndex: "jingKaiPm10", align: "center",customRender:({text})=> typeof text == "number"?text.toFixed(0)+"":""},
|
|
||||||
{title: "Co经开", dataIndex: "jingKaiCo", align: "center",customRender:({text})=> typeof text == "number"?text.toFixed(1)+"":""},
|
|
||||||
{title: "O3_8h经开", dataIndex: "jingKaiO3", align: "center",customRender:({text})=> typeof text == "number"?text.toFixed(0)+"":""},
|
|
||||||
{title: "PM2.5经开", dataIndex: "jingKaiPm25", align: "center",customRender:({text})=> typeof text == "number"?text.toFixed(0)+"":""},
|
|
||||||
{title: "AQI经开", dataIndex: "jingKaiAqi", align: "center",customRender:({text})=> typeof text == "number"?text.toFixed(0)+"":""},
|
|
||||||
{title: "类别经开", dataIndex: "jingKaiAqiCategory", align: "center"},
|
|
||||||
],
|
|
||||||
regionLevelOptions: [],
|
|
||||||
time: [],
|
|
||||||
// 表格搜索条件
|
|
||||||
where: {
|
|
||||||
regionLevel: "place",
|
|
||||||
timeStart: moment(`${year}-01-01 00:00:00`).format("YYYY-MM-DD 00:00:00"),
|
|
||||||
timeEnd: moment().format("YYYY-MM-DD 23:59:59")
|
|
||||||
},
|
|
||||||
// 表格选中数据
|
|
||||||
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);
|
|
||||||
this.$refs.table.reload({
|
|
||||||
where
|
|
||||||
});
|
|
||||||
},
|
|
||||||
/* 重置搜索 */
|
|
||||||
reset() {
|
|
||||||
this.where = {
|
|
||||||
regionLevel: "place",
|
|
||||||
};
|
|
||||||
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) => {
|
|
||||||
if(item.customRender){
|
|
||||||
return item.customRender({text:d[item.dataIndex]});
|
|
||||||
}
|
|
||||||
return d[item.dataIndex];
|
|
||||||
});
|
|
||||||
arr.push(td);
|
|
||||||
});
|
|
||||||
let sheet = XLSX.utils.aoa_to_sheet(arr);
|
|
||||||
sheet['!merges'] = merges;
|
|
||||||
|
|
||||||
this.$util.exportSheet(XLSX, sheet, moment(this.where.timeStart).format("YYYY年MM月DD日") + "至" + moment(this.where.timeEnd).format("YYYY年MM月DD日") + "城区浓度统计");
|
|
||||||
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped lang="less">
|
|
||||||
</style>
|
|
||||||
@@ -1,309 +0,0 @@
|
|||||||
<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 {statisticArea, getColumnOptions} from "@/api/ecology/atmosphere/air";
|
|
||||||
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: "StatisticAirArea",
|
|
||||||
components: {},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
data: [],
|
|
||||||
locale,
|
|
||||||
bill: {},
|
|
||||||
// 表格数据接口
|
|
||||||
url: statisticArea,
|
|
||||||
selection: [],
|
|
||||||
modelOptions: [
|
|
||||||
{label: "市", value: "city"},
|
|
||||||
{label: "县", value: "county"},
|
|
||||||
{label: "站点", value: "place"},
|
|
||||||
|
|
||||||
],
|
|
||||||
// 表格列配置
|
|
||||||
columns: [
|
|
||||||
{title: "站点/县", dataIndex: "place",align:"center"},
|
|
||||||
{
|
|
||||||
title: "二氧化硫", children: [
|
|
||||||
{title: "本次", dataIndex: "so2Current",align:"center"},
|
|
||||||
{title: "上年同期", dataIndex: "so2SameTimeLastYear",align:"center"},
|
|
||||||
{title: "增减(%)", dataIndex: "so2ChangePercentage",align:"center",customRender:({text})=> typeof text == "number"?text.toFixed(1)+"":""},
|
|
||||||
{title: "排名(按浓度值)", dataIndex: "so2Rank",align:"center"},
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "二氧化氮", children: [
|
|
||||||
{title: "本次", dataIndex: "no2Current",align:"center"},
|
|
||||||
{title: "上年同期", dataIndex: "no2SameTimeLastYear",align:"center"},
|
|
||||||
{title: "增减(%)", dataIndex: "no2ChangePercentage",align:"center",customRender:({text})=> typeof text == "number"?text.toFixed(1)+"":""},
|
|
||||||
{title: "排名(按浓度值)", dataIndex: "no2Rank",align:"center"},
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "可吸入颗粒物", children: [
|
|
||||||
{title: "本次", dataIndex: "pm10Current",align:"center"},
|
|
||||||
{title: "上年同期", dataIndex: "pm10SameTimeLastYear",align:"center"},
|
|
||||||
{title: "增减(%)", dataIndex: "pm10ChangePercentage",align:"center",customRender:({text})=> typeof text == "number"?text.toFixed(1)+"":""},
|
|
||||||
{title: "排名(按浓度值)", dataIndex: "pm10Rank",align:"center"},
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "一氧化碳", children: [
|
|
||||||
{title: "本次", dataIndex: "coCurrent",align:"center",customRender:({text})=> typeof text == "number"?text.toFixed(1)+"":""},
|
|
||||||
{title: "上年同期", dataIndex: "coSameTimeLastYear",align:"center",customRender:({text})=> typeof text == "number"?text.toFixed(1)+"":""},
|
|
||||||
{title: "增减(%)", dataIndex: "coChangePercentage",align:"center",customRender:({text})=> typeof text == "number"?text.toFixed(1)+"":""},
|
|
||||||
{title: "排名(按浓度值)", dataIndex: "coRank",align:"center"},
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "臭氧", children: [
|
|
||||||
{title: "本次", dataIndex: "o3Current",align:"center"},
|
|
||||||
{title: "上年同期", dataIndex: "o3SameTimeLastYear",align:"center"},
|
|
||||||
{title: "增减(%)", dataIndex: "o3ChangePercentage",align:"center",customRender:({text})=> typeof text == "number"?text.toFixed(1)+"":""},
|
|
||||||
{title: "排名(按浓度值)", dataIndex: "o3Rank",align:"center"},
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "细颗粒物", children: [
|
|
||||||
{title: "本次", dataIndex: "pm25Current",align:"center"},
|
|
||||||
{title: "上年同期", dataIndex: "pm25SameTimeLastYear",align:"center"},
|
|
||||||
{title: "增减(%)", dataIndex: "pm25ChangePercentage",align:"center",customRender:({text})=> typeof text == "number"?text.toFixed(1)+"":""},
|
|
||||||
{title: "排名(按浓度值)", dataIndex: "pm25Rank",align:"center"},
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "空气质量综合指数", children: [
|
|
||||||
{title: "本次", dataIndex: "comprehensiveAirQualityIndexCurrent",align:"center"},
|
|
||||||
{title: "上年同期", dataIndex: "comprehensiveAirQualityIndexSameTimeLastYear",align:"center"},
|
|
||||||
{title: "增减(%)", dataIndex: "comprehensiveAirQualityIndexChangePercentage",align:"center",customRender:({text})=> typeof text == "number"?text.toFixed(1)+"":""},
|
|
||||||
{title: "排名(按浓度值)", dataIndex: "comprehensiveAirQualityIndexRank",align:"center"},
|
|
||||||
]
|
|
||||||
},/*
|
|
||||||
|
|
||||||
BigDecimal pm25Change = BigDecimal.ZERO;
|
|
||||||
BigDecimal current = ambientAirStatisticalAnalysisExcel.getPm25Current();
|
|
||||||
BigDecimal sameTimeLastYear = ambientAirStatisticalAnalysisExcel.getPm25SameTimeLastYear();
|
|
||||||
BigDecimal subtract = current.subtract(sameTimeLastYear);
|
|
||||||
if(subtract.compareTo(BigDecimal.ZERO) != 0){
|
|
||||||
pm25Change = subtract.multiply(new BigDecimal(100)).divide(sameTimeLastYear,CHANGE_PERCENT_SCALE,ROUNDING_MODE);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
{
|
|
||||||
title: "优天数", children: [
|
|
||||||
{title: "本次", dataIndex: "excellentDaysCurrent",align:"center"},
|
|
||||||
{title: "上年同期", dataIndex: "excellentDaysSameTimeLastYear",align:"center"},
|
|
||||||
{title: "增减(%)", dataIndex: "excellentDaysChangePercentage",align:"center"},
|
|
||||||
// {title: "排名(按浓度值)", dataIndex: "excellentDaysRank",align:"center"},
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "良天数", children: [
|
|
||||||
{title: "本次", dataIndex: "goodDaysCurrent",align:"center"},
|
|
||||||
{title: "上年同期", dataIndex: "goodDaysSameTimeLastYear",align:"center"},
|
|
||||||
{title: "增减(%)", dataIndex: "goodDaysChangePercentage",align:"center"},
|
|
||||||
// {title: "排名(按浓度值)", dataIndex: "goodDaysRank",align:"center"},
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "轻度污染天数", children: [
|
|
||||||
{title: "本次", dataIndex: "lightPollutionDaysCurrent",align:"center"},
|
|
||||||
{title: "上年同期", dataIndex: "lightPollutionDaysSameTimeLastYear",align:"center"},
|
|
||||||
{title: "增减(%)", dataIndex: "lightPollutionDaysChangePercentage",align:"center"},
|
|
||||||
// {title: "排名(按浓度值)", dataIndex: "lightPollutionDaysRank",align:"center"},
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "中度污染天数", children: [
|
|
||||||
{title: "本次", dataIndex: "moderatelyPollutedDaysCurrent",align:"center"},
|
|
||||||
{title: "上年同期", dataIndex: "moderatelyPollutedDaysSameTimeLastYear",align:"center"},
|
|
||||||
{title: "增减(%)", dataIndex: "moderatelyPollutedDaysChangePercentage",align:"center"},
|
|
||||||
// {title: "排名(按浓度值)", dataIndex: "moderatelyPollutedDaysRank",align:"center"},
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "良天数", children: [
|
|
||||||
{title: "本次", dataIndex: "goodDaysCurrent",align:"center"},
|
|
||||||
{title: "上年同期", dataIndex: "goodDaysSameTimeLastYear",align:"center"},
|
|
||||||
{title: "增减(%)", dataIndex: "goodDaysChangePercentage",align:"center"},
|
|
||||||
// {title: "排名(按浓度值)", dataIndex: "goodDaysRank",align:"center"},
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "重度污染天数", children: [
|
|
||||||
{title: "本次", dataIndex: "heavyPollutionDaysCurrent",align:"center"},
|
|
||||||
{title: "上年同期", dataIndex: "heavyPollutionDaysSameTimeLastYear",align:"center"},
|
|
||||||
{title: "增减(%)", dataIndex: "heavyPollutionDaysChangePercentage",align:"center"},
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "优良率", children: [
|
|
||||||
{title: "本次", dataIndex: "excellentRateCurrent",align:"center"},
|
|
||||||
{title: "上年同期", dataIndex: "excellentRateSameTimeLastYear",align:"center"},
|
|
||||||
{title: "增减(%)", dataIndex: "excellentRateChangePercentage",align:"center"},
|
|
||||||
]
|
|
||||||
},
|
|
||||||
|
|
||||||
],
|
|
||||||
regionLevelOptions: [],
|
|
||||||
time: undefined,
|
|
||||||
// 表格搜索条件
|
|
||||||
where: {
|
|
||||||
regionLevel: "place",
|
|
||||||
},
|
|
||||||
// 表格选中数据
|
|
||||||
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 = {
|
|
||||||
regionLevel: "place",
|
|
||||||
};
|
|
||||||
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) => {
|
|
||||||
if(item.customRender){
|
|
||||||
return item.customRender({text:d[item.dataIndex]});
|
|
||||||
}
|
|
||||||
return 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,228 +0,0 @@
|
|||||||
<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.model" >
|
|
||||||
<a-select-option
|
|
||||||
v-for="(item) in modelOptions"
|
|
||||||
:key="item.value"
|
|
||||||
>{{ item.label }}
|
|
||||||
</a-select-option>
|
|
||||||
</a-select>
|
|
||||||
</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"
|
|
||||||
:datasource="url"
|
|
||||||
:columns="columns"
|
|
||||||
:where="where"
|
|
||||||
: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 {statisticAvg, getColumnOptions, listAllAir} from "@/api/ecology/atmosphere/air";
|
|
||||||
import locale from "ant-design-vue/es/date-picker/locale/zh_CN";
|
|
||||||
import moment from "moment";
|
|
||||||
// import utils from "./utils";
|
|
||||||
export default {
|
|
||||||
name: "StatisticAirAvg",
|
|
||||||
components: {},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
data: [],
|
|
||||||
locale,
|
|
||||||
bill: {},
|
|
||||||
// 表格数据接口
|
|
||||||
url: statisticAvg,
|
|
||||||
selection: [],
|
|
||||||
modelOptions: [
|
|
||||||
{label: "市", value: "city"},
|
|
||||||
{label: "县", value: "county"},
|
|
||||||
{label: "站点", value: "place"},
|
|
||||||
|
|
||||||
],
|
|
||||||
// 表格列配置
|
|
||||||
columns: [
|
|
||||||
{title:"SO2",dataIndex:"avgSo2"},
|
|
||||||
{title:"NO2",dataIndex:"avgNo2"},
|
|
||||||
{title:"PM10",dataIndex:"avgPm10"},
|
|
||||||
{title:"PM25",dataIndex:"avgPm25"},
|
|
||||||
{title:"CO",dataIndex:"avgCo"},
|
|
||||||
{title:"O3",dataIndex:"avgO3"},
|
|
||||||
{title:"AQI",dataIndex:"avgAqi"},
|
|
||||||
{title:"首要污染物",dataIndex:"primaryPollutant"},
|
|
||||||
{title:"空气质量指数级别",dataIndex:"aqiLevel"},
|
|
||||||
{title:"空气质量状况",dataIndex:"airQualityStatus"},
|
|
||||||
{title:"一氧化碳百分位数评价",dataIndex:"evaluationCo"},
|
|
||||||
{title:"臭氧百分位数评价",dataIndex:"evaluationO3"},
|
|
||||||
],
|
|
||||||
regionLevelOptions: [],
|
|
||||||
// 表格搜索条件
|
|
||||||
where: {
|
|
||||||
model: "city",
|
|
||||||
},
|
|
||||||
// 表格选中数据
|
|
||||||
selectionList: [],
|
|
||||||
};
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
this.loadOptionData();
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
/**获取下来框数据 */
|
|
||||||
loadOptionData() {
|
|
||||||
getColumnOptions("region_level").then((res) => {
|
|
||||||
this.regionLevelOptions = res.data.data.map((item) => {
|
|
||||||
return {
|
|
||||||
label: item,
|
|
||||||
value: item,
|
|
||||||
};
|
|
||||||
});
|
|
||||||
});
|
|
||||||
},
|
|
||||||
/* 刷新表格 */
|
|
||||||
reload() {
|
|
||||||
this.$refs.table.reload({
|
|
||||||
where: this.where,
|
|
||||||
});
|
|
||||||
},
|
|
||||||
/* 重置搜索 */
|
|
||||||
reset() {
|
|
||||||
this.where = {
|
|
||||||
model: "city",
|
|
||||||
};
|
|
||||||
this.reload();
|
|
||||||
},
|
|
||||||
exportFile() {
|
|
||||||
|
|
||||||
const columns = [
|
|
||||||
{
|
|
||||||
title: "监测日期",
|
|
||||||
dataIndex: "monitorTime",
|
|
||||||
sorter: true,
|
|
||||||
customRender: ({text}) => moment(text).format("YYYY-MM-DD HH:mm")
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "城市",
|
|
||||||
dataIndex: "city",
|
|
||||||
sorter: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "测点名称",
|
|
||||||
dataIndex: "place",
|
|
||||||
sorter: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "SO2/(μg/m3)",
|
|
||||||
dataIndex: "so2",
|
|
||||||
sorter: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "NO2/(μg/m3)",
|
|
||||||
dataIndex: "no2",
|
|
||||||
sorter: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "PM10/(μg/m3)",
|
|
||||||
dataIndex: "pm10",
|
|
||||||
sorter: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "CO/(mg/m3)",
|
|
||||||
dataIndex: "co",
|
|
||||||
sorter: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "臭氧(O3)最大8小时滑动平均浓度/(μg/m3)",
|
|
||||||
dataIndex: "o3",
|
|
||||||
sorter: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "PM2.5",
|
|
||||||
dataIndex: "pm25",
|
|
||||||
sorter: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "空气质量指数AQI",
|
|
||||||
dataIndex: "aqi",
|
|
||||||
sorter: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "首要污染物",
|
|
||||||
dataIndex: "primaryPollutant",
|
|
||||||
sorter: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "空气质量指数级别",
|
|
||||||
dataIndex: "aqiLevel",
|
|
||||||
sorter: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "空气质量状况",
|
|
||||||
dataIndex: "airQualityStatus",
|
|
||||||
sorter: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "备注",
|
|
||||||
dataIndex: "remark",
|
|
||||||
sorter: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "创建人",
|
|
||||||
dataIndex: "username",
|
|
||||||
sorter: true,
|
|
||||||
},
|
|
||||||
];
|
|
||||||
const arr = [];
|
|
||||||
const th = columns.map((item) => item.title);
|
|
||||||
arr.push(th);
|
|
||||||
listAllAir(this.where).then(res => {
|
|
||||||
if (res.data.code == 0) {
|
|
||||||
res.data.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,286 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="ele-body">
|
|
||||||
<a-card :bordered="false">
|
|
||||||
<!-- 搜索表单 -->
|
|
||||||
<a-form
|
|
||||||
:model="where"
|
|
||||||
layout="inline"
|
|
||||||
>
|
|
||||||
<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-form-item label="起始日期:">
|
|
||||||
<a-date-picker valueFormat="YYYY-MM-DD 00:00:00" v-model:value="where.timeStart"></a-date-picker>
|
|
||||||
</a-form-item>
|
|
||||||
<a-form-item label="结束日期:">
|
|
||||||
<a-date-picker valueFormat="YYYY-MM-DD 23:59:59" v-model:value="where.timeEnd"></a-date-picker>
|
|
||||||
</a-form-item>
|
|
||||||
<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>
|
|
||||||
<!-- 表格 -->
|
|
||||||
<ele-pro-table
|
|
||||||
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 {statisticUrl, getColumnOptions,statisticArea} from "@/api/ecology/atmosphere/air";
|
|
||||||
import locale from "ant-design-vue/es/date-picker/locale/zh_CN";
|
|
||||||
import moment from "moment";
|
|
||||||
|
|
||||||
// import utils from "./utils";
|
|
||||||
export default {
|
|
||||||
name: "StatisticAirAvg",
|
|
||||||
components: {},
|
|
||||||
data() {
|
|
||||||
const year = new Date().getFullYear();
|
|
||||||
return {
|
|
||||||
data: [],
|
|
||||||
locale,
|
|
||||||
bill: {},
|
|
||||||
// 表格数据接口
|
|
||||||
// url: statisticUrl,
|
|
||||||
selection: [],
|
|
||||||
modelOptions: [
|
|
||||||
{label: "市", value: "city"},
|
|
||||||
{label: "县", value: "county"},
|
|
||||||
{label: "站点", value: "place"},
|
|
||||||
{label: "城区", value: "area"},
|
|
||||||
|
|
||||||
],
|
|
||||||
// 表格列配置
|
|
||||||
columns: [
|
|
||||||
{title: "站点/县", dataIndex: "place",align:"center",fixed: "left",},
|
|
||||||
{
|
|
||||||
title: "二氧化硫", children: [
|
|
||||||
{title: "本次", dataIndex: "so2Current",align:"center",customRender:({text})=>text + ""},
|
|
||||||
{title: "上年同期", dataIndex: "so2SameTimeLastYear",align:"center",customRender:({text})=>text + ""},
|
|
||||||
{title: "增减(%)", dataIndex: "so2ChangePercentage",align:"center",customRender:({text})=> typeof text == "number"?text.toFixed(1)+"":""},
|
|
||||||
{title: "排名(按浓度值)", dataIndex: "so2Rank",align:"center"},
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "二氧化氮", children: [
|
|
||||||
{title: "本次", dataIndex: "no2Current",align:"center",customRender:({text})=>text + ""},
|
|
||||||
{title: "上年同期", dataIndex: "no2SameTimeLastYear",align:"center",customRender:({text})=>text + ""},
|
|
||||||
{title: "增减(%)", dataIndex: "no2ChangePercentage",customRender:({text})=> typeof text == "number"?text.toFixed(1)+"":""},
|
|
||||||
{title: "排名(按浓度值)", dataIndex: "no2Rank",align:"center"},
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "可吸入颗粒物", children: [
|
|
||||||
{title: "本次", dataIndex: "pm10Current",align:"center",customRender:({text})=>text + ""},
|
|
||||||
{title: "上年同期", dataIndex: "pm10SameTimeLastYear",align:"center",customRender:({text})=>text + ""},
|
|
||||||
{title: "增减(%)", dataIndex: "pm10ChangePercentage",customRender:({text})=> typeof text == "number"?text.toFixed(1)+"":""},
|
|
||||||
{title: "排名(按浓度值)", dataIndex: "pm10Rank",align:"center"},
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "一氧化碳", children: [
|
|
||||||
{title: "本次", dataIndex: "coCurrent",align:"center",customRender:({text})=> typeof text == "number"?text.toFixed(1)+"":""},
|
|
||||||
{title: "上年同期", dataIndex: "coSameTimeLastYear",align:"center",customRender:({text})=> typeof text == "number"?text.toFixed(1)+"":""},
|
|
||||||
{title: "增减(%)", dataIndex: "coChangePercentage",align:"center",customRender:({text})=> typeof text == "number"?text.toFixed(1)+"":""},
|
|
||||||
{title: "排名(按浓度值)", dataIndex: "coRank",align:"center"},
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "臭氧", children: [
|
|
||||||
{title: "本次", dataIndex: "o3Current",align:"center",customRender:({text})=>text + ""},
|
|
||||||
{title: "上年同期", dataIndex: "o3SameTimeLastYear",align:"center",customRender:({text})=>text + ""},
|
|
||||||
{title: "增减(%)", dataIndex: "o3ChangePercentage",align:"center",customRender:({text})=> typeof text == "number"?text.toFixed(1)+"":""},
|
|
||||||
{title: "排名(按浓度值)", dataIndex: "o3Rank",align:"center"},
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "细颗粒物", children: [
|
|
||||||
{title: "本次", dataIndex: "pm25Current",align:"center",customRender:({text})=>text + ""},
|
|
||||||
{title: "上年同期", dataIndex: "pm25SameTimeLastYear",align:"center",customRender:({text})=>text + ""},
|
|
||||||
{title: "增减(%)", dataIndex: "pm25ChangePercentage",align:"center",customRender:({text})=> typeof text == "number"?text.toFixed(1)+"":""},
|
|
||||||
{title: "排名(按浓度值)", dataIndex: "pm25Rank",align:"center"},
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "综合指数", children: [
|
|
||||||
{title: "本次", dataIndex: "comprehensiveAirQualityIndexCurrent",align:"center",customRender:({text})=> typeof text == "number"?text.toFixed(2)+"":""},
|
|
||||||
{title: "上年同期", dataIndex: "comprehensiveAirQualityIndexSameTimeLastYear",align:"center",customRender:({text})=> typeof text == "number"?text.toFixed(2)+"":""},
|
|
||||||
{title: "增减(%)", dataIndex: "comprehensiveAirQualityIndexChangePercentage",customRender:({text})=> typeof text == "number"?text.toFixed(1)+"":""},
|
|
||||||
{title: "排名(按浓度值)", dataIndex: "comprehensiveAirQualityIndexRank",align:"center"},
|
|
||||||
]
|
|
||||||
},
|
|
||||||
// {
|
|
||||||
// title: "优天数", children: [
|
|
||||||
// {title: "本次", dataIndex: "excellentDaysCurrent",align:"center"},
|
|
||||||
// {title: "上年同期", dataIndex: "excellentDaysSameTimeLastYear",align:"center"},
|
|
||||||
// {title: "增减(%)", dataIndex: "excellentDaysChangePercentage",align:"center",customRender:({text})=> typeof text == "number"?text.toFixed(1)+"":""},
|
|
||||||
// // {title: "排名(按浓度值)", dataIndex: "excellentDaysRank",align:"center"},
|
|
||||||
// ]
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// title: "良天数", children: [
|
|
||||||
// {title: "本次", dataIndex: "goodDaysCurrent",align:"center"},
|
|
||||||
// {title: "上年同期", dataIndex: "goodDaysSameTimeLastYear",align:"center"},
|
|
||||||
// {title: "增减(%)", dataIndex: "goodDaysChangePercentage",align:"center",customRender:({text})=> typeof text == "number"?text.toFixed(1)+"":""},
|
|
||||||
// // {title: "排名(按浓度值)", dataIndex: "goodDaysRank",align:"center"},
|
|
||||||
// ]
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// title: "轻度污染天数", children: [
|
|
||||||
// {title: "本次", dataIndex: "lightPollutionDaysCurrent",align:"center"},
|
|
||||||
// {title: "上年同期", dataIndex: "lightPollutionDaysSameTimeLastYear",align:"center"},
|
|
||||||
// {title: "增减(%)", dataIndex: "lightPollutionDaysChangePercentage",align:"center",customRender:({text})=> typeof text == "number"?text.toFixed(1)+"":""},
|
|
||||||
// // {title: "排名(按浓度值)", dataIndex: "lightPollutionDaysRank",align:"center"},
|
|
||||||
// ]
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// title: "中度污染天数", children: [
|
|
||||||
// {title: "本次", dataIndex: "moderatelyPollutedDaysCurrent",align:"center"},
|
|
||||||
// {title: "上年同期", dataIndex: "moderatelyPollutedDaysSameTimeLastYear",align:"center"},
|
|
||||||
// {title: "增减(%)", dataIndex: "moderatelyPollutedDaysChangePercentage",align:"center",customRender:({text})=> typeof text == "number"?text.toFixed(1)+"":""},
|
|
||||||
// // {title: "排名(按浓度值)", dataIndex: "moderatelyPollutedDaysRank",align:"center"},
|
|
||||||
// ]
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// title: "良天数", children: [
|
|
||||||
// {title: "本次", dataIndex: "goodDaysCurrent",align:"center"},
|
|
||||||
// {title: "上年同期", dataIndex: "goodDaysSameTimeLastYear",align:"center"},
|
|
||||||
// {title: "增减(%)", dataIndex: "goodDaysChangePercentage",align:"center",customRender:({text})=> typeof text == "number"?text.toFixed(1)+"":""},
|
|
||||||
// // {title: "排名(按浓度值)", dataIndex: "goodDaysRank",align:"center"},
|
|
||||||
// ]
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// title: "重度污染天数", children: [
|
|
||||||
// {title: "本次", dataIndex: "heavyPollutionDaysCurrent",align:"center"},
|
|
||||||
// {title: "上年同期", dataIndex: "heavyPollutionDaysSameTimeLastYear",align:"center"},
|
|
||||||
// {title: "增减(%)", dataIndex: "heavyPollutionDaysChangePercentage",align:"center",customRender:({text})=> typeof text == "number"?text.toFixed(1)+"":""},
|
|
||||||
// ]
|
|
||||||
// },
|
|
||||||
{
|
|
||||||
title: "优良率", children: [
|
|
||||||
{title: "本次", dataIndex: "excellentRateCurrent",align:"center"},
|
|
||||||
{title: "上年同期", dataIndex: "excellentRateSameTimeLastYear",align:"center"},
|
|
||||||
{title: "增减(%)", dataIndex: "excellentRateChangePercentage",align:"center",customRender:({text})=> typeof text == "number"?text.toFixed(1)+"":""},
|
|
||||||
]
|
|
||||||
},
|
|
||||||
|
|
||||||
],
|
|
||||||
regionLevelOptions: [],
|
|
||||||
time: [],
|
|
||||||
// 表格搜索条件
|
|
||||||
where: {
|
|
||||||
regionLevel: "place",
|
|
||||||
timeStart:moment(`${year}-01-01 00:00:00`).format("YYYY-MM-DD 00:00:00"),
|
|
||||||
timeEnd:moment().format("YYYY-MM-DD 00:00:00")
|
|
||||||
},
|
|
||||||
// 表格选中数据
|
|
||||||
selectionList: [],
|
|
||||||
};
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
|
|
||||||
this.loadOptionData();
|
|
||||||
this.reload();
|
|
||||||
},
|
|
||||||
computed:{
|
|
||||||
url(){
|
|
||||||
if(this.where.regionLevel == "area"){
|
|
||||||
return statisticArea
|
|
||||||
}else{
|
|
||||||
return statisticUrl
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
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);
|
|
||||||
|
|
||||||
if(this.where.regionLevel == "area"){
|
|
||||||
delete where["regionLevel"]
|
|
||||||
}
|
|
||||||
this.$refs.table.reload({
|
|
||||||
where
|
|
||||||
});
|
|
||||||
},
|
|
||||||
/* 重置搜索 */
|
|
||||||
reset() {
|
|
||||||
this.where = {
|
|
||||||
regionLevel: "place",
|
|
||||||
};
|
|
||||||
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, moment(this.where.timeStart).format("YYYY年MM月DD日") + "至" + moment(this.where.timeEnd).format("YYYY年MM月DD日")+ "统计数据");
|
|
||||||
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped lang="less">
|
|
||||||
</style>
|
|
||||||
@@ -55,7 +55,11 @@
|
|||||||
export default {
|
export default {
|
||||||
name: 'StatisticAirIndex',
|
name: 'StatisticAirIndex',
|
||||||
components: {
|
components: {
|
||||||
BaseStatistic
|
BaseStatistic,
|
||||||
|
AutoStatis,
|
||||||
|
NationalStatis,
|
||||||
|
SiteStatis,
|
||||||
|
SiteDayStatis
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -157,7 +157,7 @@ import locale from "ant-design-vue/es/date-picker/locale/zh_CN";
|
|||||||
import { tableCityColumns } from "./colums";
|
import { tableCityColumns } from "./colums";
|
||||||
// import utils from "./utils";
|
// import utils from "./utils";
|
||||||
export default {
|
export default {
|
||||||
name: "RiverStationCollectWater",
|
name: "AutoStatis",
|
||||||
components: {},
|
components: {},
|
||||||
data() {
|
data() {
|
||||||
const { billId } = this.$route.params;
|
const { billId } = this.$route.params;
|
||||||
|
|||||||
Reference in New Issue
Block a user