导入跳转
This commit is contained in:
@@ -21,12 +21,20 @@ const updateAqiRelate = function (data) {
|
||||
return axios.put("/ambientAir/airAqiRelateInfoDict",data)
|
||||
}
|
||||
|
||||
const copyBatchPlace = function (data){
|
||||
return axios.post("/ambientAir/airAqiRelateInfoDict/copyBatch",data)
|
||||
}
|
||||
const getColumnOptions = function(column){
|
||||
return axios.get("/ambientAir/airAqiRelateInfoDict/options",{params:{column}})
|
||||
}
|
||||
|
||||
export {
|
||||
listAllUrl,
|
||||
saveAqiRelate,
|
||||
updateAqiRelate,
|
||||
removeBatchAqiRelate,
|
||||
removeAqiRelate
|
||||
removeAqiRelate,
|
||||
copyBatchPlace,
|
||||
getColumnOptions
|
||||
|
||||
}
|
||||
|
||||
@@ -20,13 +20,20 @@ const removeBatchStandard = function (ids) {
|
||||
const updateStandard = function (data) {
|
||||
return axios.put("/ambientAir/airEvaluationStandard",data)
|
||||
}
|
||||
|
||||
const copyBatchPlace = function (data){
|
||||
return axios.post("/ambientAir/airEvaluationStandard/copyBatch",data)
|
||||
}
|
||||
const getColumnOptions = function(column){
|
||||
return axios.get("/ambientAir/airEvaluationStandard/options",{params:{column}})
|
||||
}
|
||||
|
||||
export {
|
||||
listAllUrl,
|
||||
saveStandard,
|
||||
updateStandard,
|
||||
removeBatchStandard,
|
||||
removeStandard
|
||||
removeStandard,
|
||||
copyBatchPlace,
|
||||
getColumnOptions
|
||||
|
||||
}
|
||||
|
||||
@@ -21,12 +21,19 @@ const updateIndicatorIaqi = function (data) {
|
||||
return axios.put("/ambientAir/airIndicatorIaqiDict",data)
|
||||
}
|
||||
|
||||
|
||||
const copyBatchPlace = function (data){
|
||||
return axios.post("/ambientAir/airIndicatorIaqiDict/copyBatch",data)
|
||||
}
|
||||
const getColumnOptions = function(column){
|
||||
return axios.get("/ambientAir/airIndicatorIaqiDict/options",{params:{column}})
|
||||
}
|
||||
export {
|
||||
listAllUrl,
|
||||
saveIndicatorIaqi,
|
||||
updateIndicatorIaqi,
|
||||
removeBatchIndicatorIaqi,
|
||||
removeIndicatorIaqi
|
||||
removeIndicatorIaqi,
|
||||
copyBatchPlace,
|
||||
getColumnOptions
|
||||
|
||||
}
|
||||
|
||||
@@ -21,12 +21,19 @@ const updatePlace = function (data) {
|
||||
return axios.put("/ambientAir/airPlaceBasicInfoDict",data)
|
||||
}
|
||||
|
||||
|
||||
const copyBatchPlace = function (data){
|
||||
return axios.post("/ambientAir/airPlaceBasicInfoDict/copyBatch",data)
|
||||
}
|
||||
const getColumnOptions = function(column){
|
||||
return axios.get("/ambientAir/airPlaceBasicInfoDict/options",{params:{column}})
|
||||
}
|
||||
export {
|
||||
listAllUrl,
|
||||
savePlace,
|
||||
updatePlace,
|
||||
removeBatchPlace,
|
||||
removePlace
|
||||
removePlace,
|
||||
copyBatchPlace,
|
||||
getColumnOptions
|
||||
|
||||
}
|
||||
|
||||
@@ -6,7 +6,10 @@ const listAllUrl = baseUri + "";
|
||||
const savePlace = function (data) {
|
||||
return axios.post("/sound/function/place",data)
|
||||
}
|
||||
|
||||
// 批量添加
|
||||
const savePlaceBatch = function (data) {
|
||||
return axios.post("/sound/function/place/batch",data)
|
||||
}
|
||||
// 删除
|
||||
const removePlace = function (id) {
|
||||
return axios.delete(`/sound/function/place/${id}`,)
|
||||
@@ -36,5 +39,6 @@ export {
|
||||
removeBatchPlace,
|
||||
removePlace,
|
||||
getColumnOptions,
|
||||
copyBatchPlace
|
||||
copyBatchPlace,
|
||||
savePlaceBatch
|
||||
}
|
||||
|
||||
@@ -6,7 +6,10 @@ const listAllUrl = baseUri + "";
|
||||
const savePlace = function (data) {
|
||||
return axios.post("/sound/road/place",data)
|
||||
}
|
||||
|
||||
// 批量添加
|
||||
const savePlaceBatch = function (data) {
|
||||
return axios.post("/sound/road/place/batch",data)
|
||||
}
|
||||
// 删除
|
||||
const removePlace = function (id) {
|
||||
return axios.delete(`/sound/road/place/${id}`,)
|
||||
@@ -33,6 +36,7 @@ export {
|
||||
removeBatchPlace,
|
||||
removePlace,
|
||||
getColumnOptions,
|
||||
copyBatchPlace
|
||||
copyBatchPlace,
|
||||
savePlaceBatch
|
||||
|
||||
}
|
||||
|
||||
@@ -6,6 +6,10 @@ const listAllUrl = baseUri + "";
|
||||
const savePlace = function (data) {
|
||||
return axios.post("/sound/zone/place",data)
|
||||
}
|
||||
// 批量添加
|
||||
const savePlaceBatch = function (data) {
|
||||
return axios.post("/sound/zone/place/batch",data)
|
||||
}
|
||||
|
||||
// 删除
|
||||
const removePlace = function (id) {
|
||||
@@ -36,6 +40,7 @@ export {
|
||||
removeBatchPlace,
|
||||
removePlace,
|
||||
copyBatchPlace,
|
||||
getColumnOptions
|
||||
getColumnOptions,
|
||||
savePlaceBatch
|
||||
|
||||
}
|
||||
|
||||
@@ -48,9 +48,7 @@ const updateLake = function (data) {
|
||||
}
|
||||
|
||||
// -------------------------统计---------------------
|
||||
const pageLakeStatisticUrl = '/lakeLibrary/lakeLibrarySpecial/statistic';
|
||||
const statisticSourceUrl = '/lakeLibrary/lakeLibrarySpecial/statistic/source';
|
||||
const statisticYearUrl = '/lakeLibrary/lakeLibrarySpecial/statistic/year';
|
||||
const avgUrl = '/lakeLibrary/lakeLibrarySpecial/specialExcel';
|
||||
const getHistoryyears = function () {
|
||||
return axios.get("/lakeLibrary/lakeLibrarySpecial/history-year")
|
||||
}
|
||||
@@ -71,10 +69,9 @@ export {
|
||||
removeLake,
|
||||
updateLake,
|
||||
removeBatchLake,
|
||||
pageLakeStatisticUrl,
|
||||
avgUrl,
|
||||
getHistoryyears,
|
||||
getColumnOptions,
|
||||
statisticSourceUrl,
|
||||
statisticYearUrl
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -615,6 +615,7 @@ export default {
|
||||
}).then(res => {
|
||||
this.isLoading = false;
|
||||
const result = this.getResponseResult(res.data);
|
||||
console.log(result)
|
||||
if (result.code === 0) {
|
||||
// 自动修正页码
|
||||
if (this.autoAmendPage && this.needPage && result.data && !result.data.length && result.count) {
|
||||
|
||||
@@ -11,7 +11,7 @@ const tableColumns = [
|
||||
{title: "钠离子",dataIndex: "na",sorter: true,},
|
||||
{title: "铵根离子",dataIndex: "ammoniumRadical",sorter: true,},
|
||||
{title: "钾离子",dataIndex: "k",sorter: true,},
|
||||
{title: "镁离子",dataIndex: "ng",sorter: true,},
|
||||
{title: "镁离子",dataIndex: "mg",sorter: true,},
|
||||
{title: "钙离子",dataIndex: "ca",sorter: true,},
|
||||
{title: "备注",dataIndex: "remark",sorter: true,},
|
||||
];
|
||||
|
||||
@@ -16,6 +16,7 @@ export default {
|
||||
const row = {
|
||||
city: "南宁市",
|
||||
place: dict.find(p=>p.placeCode = item[0].split("~")[0]).place,
|
||||
placeType:dict.find(p=>p.placeCode = item[0].split("~")[0]).attribute,
|
||||
code: item[0],
|
||||
precipitationType:item[10],
|
||||
precipitation:item[11],
|
||||
|
||||
@@ -14,7 +14,8 @@
|
||||
<a-select-option
|
||||
v-for="(item) in regionLevelOptions"
|
||||
:key="item.value"
|
||||
>{{ item.label }}</a-select-option
|
||||
>{{ item.label }}
|
||||
</a-select-option
|
||||
>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
@@ -25,7 +26,8 @@
|
||||
<a-select-option
|
||||
v-for="(item) in palceOptions"
|
||||
:key="item.value"
|
||||
>{{ item.label }}</a-select-option
|
||||
>{{ item.label }}
|
||||
</a-select-option
|
||||
>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
@@ -37,7 +39,8 @@
|
||||
<a-select-option
|
||||
v-for="(item) in areaOptions"
|
||||
:key="item.value"
|
||||
>{{ item.label }}</a-select-option
|
||||
>{{ item.label }}
|
||||
</a-select-option
|
||||
>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
@@ -109,6 +112,7 @@ export default {
|
||||
title: "行政代码",
|
||||
dataIndex: "regionCode",
|
||||
sorter: true,
|
||||
customRender: () => "450100"
|
||||
},
|
||||
{
|
||||
title: "市(县,区)",
|
||||
@@ -146,37 +150,37 @@ export default {
|
||||
},
|
||||
{
|
||||
title: "SO42",
|
||||
dataIndex: "so42",
|
||||
dataIndex: "sulfateRadical",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "NO3",
|
||||
dataIndex: "no3",
|
||||
dataIndex: "nitrate",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "F",
|
||||
dataIndex: "f",
|
||||
dataIndex: "fluorine",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "CL",
|
||||
dataIndex: "cl",
|
||||
dataIndex: "chlorine",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "NH4",
|
||||
dataIndex: "nh4",
|
||||
dataIndex: "ammoniumRadical",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "Ca2",
|
||||
dataIndex: "ca2",
|
||||
dataIndex: "ca",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "Mg2",
|
||||
dataIndex: "mg2",
|
||||
dataIndex: "mg",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
@@ -264,18 +268,7 @@ export default {
|
||||
},
|
||||
exportFile() {
|
||||
const columns = [
|
||||
{
|
||||
title: "采样开始时间",
|
||||
dataIndex: "monitorStartTime",
|
||||
sorter: true,
|
||||
customRender: ({text})=> moment(text,"YYYY/MM/DD HH:mm:ss").format("YYYY-MM-DD HH:mm")
|
||||
},
|
||||
{
|
||||
title: "采样结束时间",
|
||||
dataIndex: "monitorEndTime",
|
||||
sorter: true,
|
||||
customRender: ({text})=> moment(text,"YYYY/MM/DD HH:mm:ss").format("YYYY-MM-DD HH:mm")
|
||||
},
|
||||
|
||||
{
|
||||
title: "行政代码",
|
||||
dataIndex: "regionCode",
|
||||
@@ -296,6 +289,16 @@ export default {
|
||||
dataIndex: "placeType",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "采样开始时间",
|
||||
dataIndex: "monitorStartTime",
|
||||
customRender: ({text}) => moment(text, "YYYY/MM/DD HH:mm:ss").format("YYYY-MM-DD HH:mm")
|
||||
},
|
||||
{
|
||||
title: "采样结束时间",
|
||||
dataIndex: "monitorEndTime",
|
||||
customRender: ({text}) => moment(text, "YYYY/MM/DD HH:mm:ss").format("YYYY-MM-DD HH:mm")
|
||||
},
|
||||
{
|
||||
title: "降水类型",
|
||||
dataIndex: "precipitationType",
|
||||
@@ -318,37 +321,37 @@ export default {
|
||||
},
|
||||
{
|
||||
title: "SO42",
|
||||
dataIndex: "so42",
|
||||
dataIndex: "sulfateRadical",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "NO3",
|
||||
dataIndex: "no3",
|
||||
dataIndex: "nitrate",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "F",
|
||||
dataIndex: "f",
|
||||
dataIndex: "fluorine",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "CL",
|
||||
dataIndex: "cl",
|
||||
dataIndex: "chlorine",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "NH4",
|
||||
dataIndex: "nh4",
|
||||
dataIndex: "ammoniumRadical",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "Ca2",
|
||||
dataIndex: "ca2",
|
||||
dataIndex: "ca",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "Mg2",
|
||||
dataIndex: "mg2",
|
||||
dataIndex: "mg",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
|
||||
@@ -2,40 +2,18 @@
|
||||
<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 format="YYYY-MM" :mode="mode" @panelChange="handlePanelChange" @change="handleChange" v-model:value="time"/>
|
||||
<a-form :model="where" layout="inline">
|
||||
<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 00:00:00" v-model:value="where.timeEnd"></a-date-picker>
|
||||
</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
|
||||
@@ -63,7 +41,6 @@
|
||||
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";
|
||||
|
||||
@@ -72,6 +49,7 @@ export default {
|
||||
name: "StatisticAcidCity",
|
||||
components: {},
|
||||
data() {
|
||||
const year = new Date().getFullYear();
|
||||
return {
|
||||
data: [],
|
||||
mode: ['month', 'month'],
|
||||
@@ -97,14 +75,20 @@ export default {
|
||||
{title: "降水pH值(无量纲)", dataIndex: "precipitationPh", align: "center"},
|
||||
],
|
||||
regionLevelOptions: [],
|
||||
time: undefined,
|
||||
time: [],
|
||||
// 表格搜索条件
|
||||
where: {},
|
||||
where: {
|
||||
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() {
|
||||
const year = new Date().getFullYear();
|
||||
this.time[0] = moment(`${year}-01-01 00:00:00`);
|
||||
this.time[1] = moment(Date.now())
|
||||
this.loadOptionData();
|
||||
this.reload();
|
||||
},
|
||||
@@ -146,21 +130,9 @@ export default {
|
||||
/* 刷新表格 */
|
||||
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: "开始时间与结束时间年份不一致",
|
||||
})
|
||||
if(!where.timeStart || !where.timeEnd){
|
||||
return;
|
||||
}
|
||||
where.timeStart = this.time[0].format("YYYY-MM-01 00:00:00");
|
||||
where.timeEnd = this.time[1].format("YYYY-MM-01 00:00:00");
|
||||
}
|
||||
this.$refs.table.reload({
|
||||
where
|
||||
});
|
||||
@@ -199,7 +171,7 @@ export default {
|
||||
});
|
||||
let sheet = XLSX.utils.aoa_to_sheet(arr);
|
||||
sheet['!merges'] = merges;
|
||||
this.$util.exportSheet(XLSX, sheet, new Date().getTime().toString());
|
||||
this.$util.exportSheet(XLSX, sheet, moment(this.where.timeStart).format("YYYY年MM月DD日") + "至" + moment(this.where.timeEnd).format("YYYY年MM月DD日"));
|
||||
|
||||
},
|
||||
},
|
||||
|
||||
18
src/views/atmosphere/acid-rain/statistic/colums.js
Normal file
18
src/views/atmosphere/acid-rain/statistic/colums.js
Normal file
@@ -0,0 +1,18 @@
|
||||
const tableColumns = [
|
||||
{title: "编号",dataIndex: "code",sorter: true,},
|
||||
{title: "降水类型",dataIndex: "precipitationType",sorter: true,},
|
||||
{title: "降雨量(mm)",dataIndex: "precipitation",sorter: true,},
|
||||
{title: "pH值(无量纲)",dataIndex: "ph",sorter: true,},
|
||||
{title: "电导率(mS/m)",dataIndex: "conductivity",sorter: true,},
|
||||
{title: "氟离子",dataIndex: "fluorine",sorter: true,},
|
||||
{title: "氯离子",dataIndex: "chlorine",sorter: true,},
|
||||
{title: "硫酸根离子",dataIndex: "sulfateRadical",sorter: true,},
|
||||
{title: "硝酸根离子",dataIndex: "nitrate",sorter: true,},
|
||||
{title: "钠离子",dataIndex: "na",sorter: true,},
|
||||
{title: "铵根离子",dataIndex: "ammoniumRadical",sorter: true,},
|
||||
{title: "钾离子",dataIndex: "k",sorter: true,},
|
||||
{title: "镁离子",dataIndex: "mg",sorter: true,},
|
||||
{title: "钙离子",dataIndex: "ca",sorter: true,},
|
||||
{title: "备注",dataIndex: "remark",sorter: true,},
|
||||
];
|
||||
export {tableColumns}
|
||||
@@ -2,40 +2,18 @@
|
||||
<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 format="YYYY-MM" :mode="mode" @panelChange="handlePanelChange" @change="handleChange" v-model:value="time"/>
|
||||
<a-form :model="where" layout="inline">
|
||||
<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 00:00:00" v-model:value="where.timeEnd"></a-date-picker>
|
||||
</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
|
||||
@@ -63,7 +41,6 @@
|
||||
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";
|
||||
|
||||
@@ -72,6 +49,7 @@ export default {
|
||||
name: "StatisticAcidCounty",
|
||||
components: {},
|
||||
data() {
|
||||
const year = new Date().getFullYear();
|
||||
return {
|
||||
data: [],
|
||||
locale,
|
||||
@@ -97,15 +75,20 @@ export default {
|
||||
{title: "降水pH值(无量纲)", dataIndex: "precipitationPh", align: "center"},
|
||||
],
|
||||
regionLevelOptions: [],
|
||||
time: undefined,
|
||||
time: [],
|
||||
// 表格搜索条件
|
||||
where: {
|
||||
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() {
|
||||
const year = new Date().getFullYear();
|
||||
this.time[0] = moment(`${year}-01-01 00:00:00`);
|
||||
this.time[1] = moment(Date.now())
|
||||
this.loadOptionData();
|
||||
this.reload();
|
||||
},
|
||||
@@ -147,21 +130,7 @@ export default {
|
||||
/* 刷新表格 */
|
||||
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-01 00:00:00");
|
||||
where.timeEnd = this.time[1].format("YYYY-MM-01 00:00:00");
|
||||
}
|
||||
|
||||
this.$refs.table.reload({
|
||||
where
|
||||
});
|
||||
@@ -201,7 +170,7 @@ export default {
|
||||
});
|
||||
let sheet = XLSX.utils.aoa_to_sheet(arr);
|
||||
sheet['!merges'] = merges;
|
||||
this.$util.exportSheet(XLSX, sheet, new Date().getTime().toString());
|
||||
this.$util.exportSheet(XLSX, sheet, moment(this.where.timeStart).format("YYYY年MM月DD日") + "至" + moment(this.where.timeEnd).format("YYYY年MM月DD日"));
|
||||
|
||||
},
|
||||
},
|
||||
|
||||
@@ -2,40 +2,18 @@
|
||||
<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 :model="where" layout="inline">
|
||||
<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 00:00:00" v-model:value="where.timeEnd"></a-date-picker>
|
||||
</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
|
||||
@@ -62,7 +40,6 @@
|
||||
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";
|
||||
|
||||
@@ -71,6 +48,7 @@ export default {
|
||||
name: "StatisticAcidion",
|
||||
components: {},
|
||||
data() {
|
||||
const year = new Date().getFullYear();
|
||||
return {
|
||||
data: [],
|
||||
locale,
|
||||
@@ -101,15 +79,20 @@ export default {
|
||||
{title: "阴阳离子比例", dataIndex: "anionCationRatio",align:"center"},
|
||||
],
|
||||
regionLevelOptions: [],
|
||||
time: undefined,
|
||||
time: [],
|
||||
// 表格搜索条件
|
||||
where: {
|
||||
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() {
|
||||
const year = new Date().getFullYear();
|
||||
this.time[0] = moment(`${year}-01-01 00:00:00`);
|
||||
this.time[1] = moment(Date.now())
|
||||
this.loadOptionData();
|
||||
this.reload();
|
||||
},
|
||||
@@ -128,21 +111,7 @@ export default {
|
||||
/* 刷新表格 */
|
||||
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
|
||||
});
|
||||
@@ -182,7 +151,7 @@ export default {
|
||||
});
|
||||
let sheet = XLSX.utils.aoa_to_sheet(arr);
|
||||
sheet['!merges'] = merges;
|
||||
this.$util.exportSheet(XLSX, sheet, new Date().getTime().toString());
|
||||
this.$util.exportSheet(XLSX, sheet, moment(this.where.timeStart).format("YYYY年MM月DD日") + "至" + moment(this.where.timeEnd).format("YYYY年MM月DD日"));
|
||||
|
||||
},
|
||||
},
|
||||
|
||||
@@ -7,6 +7,9 @@
|
||||
|
||||
<!-- 搜索表单 -->
|
||||
<a-form layout="inline" :model="where" :labelCol="{ offset: 1}">
|
||||
<!-- <a-form-item label="年份:">-->
|
||||
<!-- <a-input-number v-model:value="where.year" :min="1970" :max="2050"/>-->
|
||||
<!-- </a-form-item>-->
|
||||
<a-form-item label="区域等级:">
|
||||
<a-select v-model:value="where.regionLevel" allowClear placeholder="未选择">
|
||||
<a-select-option :value="'city'">市</a-select-option>
|
||||
@@ -25,9 +28,6 @@
|
||||
<a-input v-model:value.trim="where.billName" placeholder="请输入" allow-clear/>
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item label="上报时间:">
|
||||
<a-range-picker separator="-" v-model:value="reportTimeScope"/>
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item class="ele-text-right" :wrapper-col="{span: 24}">
|
||||
<a-space>
|
||||
@@ -57,18 +57,9 @@
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<template #reportTime="{ text, record }">
|
||||
<template #reportTime="{ text }">
|
||||
<div class="editable-cell">
|
||||
<div v-if="editableData[record.ambientAirBillId]" class="editable-cell-input-wrapper">
|
||||
<a-month-picker
|
||||
v-model:value="editableData[record.ambientAirBillId].reportTime"></a-month-picker>
|
||||
<!-- <a-input v-model:value="editableData[record.ambientAirBillId].reportTime" @pressEnter="save(record)" /> -->
|
||||
<check-outlined class="editable-cell-icon-check" @click="save(record)"/>
|
||||
</div>
|
||||
<div v-else class="editable-cell-text-wrapper">
|
||||
{{ $util.toDateString(text, 'yyyy-MM') || ' ' }}
|
||||
<edit-outlined class="editable-cell-icon" @click="edit(record)"/>
|
||||
</div>
|
||||
{{ $util.toDateString(text, 'yyyy') || ' ' }}
|
||||
</div>
|
||||
</template>
|
||||
<template #checked="{text}">
|
||||
@@ -176,7 +167,7 @@ export default {
|
||||
// sorter: true
|
||||
// },
|
||||
{
|
||||
title: '上报时间',
|
||||
title: '年份',
|
||||
dataIndex: 'reportTime',
|
||||
sorter: true,
|
||||
slots: {
|
||||
@@ -228,7 +219,10 @@ export default {
|
||||
}
|
||||
],
|
||||
// 表格搜索条件
|
||||
where: {},
|
||||
where: {
|
||||
sort: "createTime",
|
||||
order: "desc"
|
||||
},
|
||||
reportTimeScope: [],
|
||||
// 表格选中数据
|
||||
selectionList: [],
|
||||
|
||||
@@ -356,11 +356,11 @@ export default {
|
||||
},
|
||||
],
|
||||
// 表格搜索条件
|
||||
airBillId: billId,
|
||||
ambientAirBillId: billId,
|
||||
palceOptions: [],
|
||||
areaOptions: [],
|
||||
where: {
|
||||
airBillId: billId,
|
||||
ambientAirBillId: billId,
|
||||
},
|
||||
// 表格选中数据
|
||||
selectionList: [],
|
||||
@@ -412,7 +412,7 @@ export default {
|
||||
/* 重置搜索 */
|
||||
reset() {
|
||||
this.where = {
|
||||
airBillId: this.airBillId,
|
||||
ambientAirBillId: this.ambientAirBillId,
|
||||
};
|
||||
this.reload();
|
||||
},
|
||||
@@ -467,7 +467,7 @@ export default {
|
||||
hide();
|
||||
});
|
||||
} else {
|
||||
form.airBillId = this.airBillId;
|
||||
form.ambientAirBillId = this.ambientAirBillId;
|
||||
saveAir(form)
|
||||
.then((res) => {
|
||||
if (res.data.code == 0) {
|
||||
|
||||
@@ -3,14 +3,24 @@
|
||||
<a-card style="width: 100%" :bordered="false">
|
||||
<template #title>
|
||||
<a-space>
|
||||
<a-month-picker v-model:value="time"/>
|
||||
<a-input-number v-model:value="year" :min="1970" :max="2050"/>
|
||||
<a-select
|
||||
ref="select"
|
||||
v-model:value="regionLevel"
|
||||
style="width: 120px"
|
||||
>
|
||||
<a-select-option value="city">市</a-select-option>
|
||||
<a-select-option value="county">县</a-select-option>
|
||||
<a-select-option value="place">站点</a-select-option>
|
||||
</a-select>
|
||||
<a-upload
|
||||
:before-upload="importFileCity"
|
||||
:showUploadList="false"
|
||||
accept=".xls,.xlsx,.csv"
|
||||
>
|
||||
<a-button>数据导入</a-button>
|
||||
<a-button type="primary">数据导入</a-button>
|
||||
</a-upload>
|
||||
<a-button>模板下载</a-button>
|
||||
|
||||
</a-space>
|
||||
</template>
|
||||
@@ -30,6 +40,7 @@ import {Modal} from "ant-design-vue";
|
||||
import AirBill from "./air-bill.vue";
|
||||
import {saveAirBill} from "@/api/ecology/air";
|
||||
import moment from "moment";
|
||||
|
||||
export default {
|
||||
name: "AirCollectIndex",
|
||||
components: {
|
||||
@@ -38,7 +49,9 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
activeKey: "",
|
||||
time: moment()
|
||||
regionLevel: "city",
|
||||
time: moment(),
|
||||
year: new Date().getFullYear()
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
@@ -54,44 +67,36 @@ export default {
|
||||
type: "array",
|
||||
cellDates: true
|
||||
});
|
||||
//0.昼间数据 1.夜间数据 2.其他信息
|
||||
let sheetNames = workbook.SheetNames;
|
||||
// 解析成二维数组
|
||||
let aoa = XLSX.utils.sheet_to_json(workbook.Sheets[sheetNames[0]], {
|
||||
header: 1,
|
||||
defval: ""
|
||||
});
|
||||
let aoa2 = XLSX.utils.sheet_to_json(workbook.Sheets[sheetNames[1]], {
|
||||
header: 1,
|
||||
});
|
||||
let aoa3 = XLSX.utils.sheet_to_json(workbook.Sheets[sheetNames[2]], {
|
||||
header: 1,
|
||||
});
|
||||
|
||||
const airList1 = aoa.filter(
|
||||
(item) => {
|
||||
return item.length >= 10 && item[0] != "城市"
|
||||
console.log(aoa.length)
|
||||
const airList = aoa.filter((item) => {
|
||||
if (this.regionLevel == "city") {
|
||||
return item.length >= 10&& item[0]&& item[0] != "城市";
|
||||
} else if (this.regionLevel == "county") {
|
||||
return item.length >= 10&& item[0] && item[0] != "测点名称";
|
||||
} else {
|
||||
return item.length >= 10&& item[0] && item[0] != "城市"
|
||||
}
|
||||
}
|
||||
);
|
||||
const airList2 = aoa2.filter(
|
||||
(item) => item.length >= 10 && item[0] != "城市"
|
||||
);
|
||||
const airList3 = aoa3.filter(
|
||||
(item) => item.length >= 10 && item[0] != "测点名称"
|
||||
);
|
||||
|
||||
|
||||
console.log(airList.length)
|
||||
const billName = file.name;
|
||||
let billData = undefined;
|
||||
if (this.regionLevel == "city") {
|
||||
billData = utils.toCityObjData(airList)
|
||||
} else if (this.regionLevel == "county") {
|
||||
billData = utils.toCountyObjData(airList)
|
||||
} else {
|
||||
billData = utils.toPlaceObjData(airList)
|
||||
}
|
||||
console.log(billData.length)
|
||||
// 解析成对象数组
|
||||
const billName1 = file.name + sheetNames[0];
|
||||
const billData1 = utils.toStationObjData(airList1);
|
||||
const billName2 = file.name + sheetNames[1];
|
||||
const billData2 = utils.toCityObjData(airList2);
|
||||
const billName3 = file.name + sheetNames[2];
|
||||
const billData3 = utils.toAreaObjData(airList3);
|
||||
if (
|
||||
(!billData1 || billData1.length == 0) &&
|
||||
(!billData2 || billData2.length == 0) &&
|
||||
(!billData3 || billData3.length == 0)
|
||||
) {
|
||||
if (!billData || billData.length == 0) {
|
||||
hide()
|
||||
Modal.error({
|
||||
title: "导入失败",
|
||||
@@ -99,52 +104,28 @@ export default {
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
const tasks = [];
|
||||
if (billData1.length > 0) {
|
||||
tasks.push(
|
||||
saveAirBill({
|
||||
billName: billName1,
|
||||
regionLevel: "place",
|
||||
ambientAirList: billData1,
|
||||
importYearMonth: this.time.format("YYYY-MM"),
|
||||
reportTime:this.time.valueOf()
|
||||
})
|
||||
);
|
||||
}
|
||||
if (billData2.length > 0) {
|
||||
tasks.push(
|
||||
saveAirBill({
|
||||
billName: billName2,
|
||||
regionLevel: "city",
|
||||
ambientAirList: billData2,
|
||||
importYearMonth: this.time.format("YYYY-MM"),
|
||||
reportTime:this.time.valueOf()
|
||||
})
|
||||
);
|
||||
}
|
||||
if (billData3.length > 0) {
|
||||
tasks.push(
|
||||
saveAirBill({
|
||||
billName: billName3,
|
||||
regionLevel: "county",
|
||||
ambientAirList: billData3,
|
||||
importYearMonth: this.time.format("YYYY-MM"),
|
||||
reportTime:this.time.valueOf()
|
||||
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
// 上传到服务器
|
||||
|
||||
Promise.all(tasks)
|
||||
.then(() => {
|
||||
billName: billName,
|
||||
regionLevel: this.regionLevel,
|
||||
ambientAirList: billData,
|
||||
reportTime: new Date(`${this.year}-01-01 00:00:00`).getTime()
|
||||
}).then((res) => {
|
||||
if (res.data.code == 0) {
|
||||
Modal.success({
|
||||
title: "导入成功",
|
||||
content: `成功导入${billData1.length + billData2.length + billData3.length}条数据`,
|
||||
content: `成功导入${billData.length}条数据`,
|
||||
});
|
||||
this.$refs.air && this.$refs.air.reload();
|
||||
this.$router.replace({
|
||||
path: "/atmosphere/air/collect/air/" + res.data.data.ambientAirBillId
|
||||
})
|
||||
} else {
|
||||
Modal.error({
|
||||
title: "导入失败",
|
||||
content: "数据上传出错",
|
||||
});
|
||||
}
|
||||
|
||||
})
|
||||
.catch(() => {
|
||||
Modal.error({
|
||||
@@ -154,7 +135,9 @@ export default {
|
||||
})
|
||||
.finally(() => {
|
||||
hide();
|
||||
});
|
||||
})
|
||||
|
||||
// 上传到服务器
|
||||
} catch (error) {
|
||||
hide();
|
||||
Modal.error({
|
||||
|
||||
@@ -2,10 +2,9 @@ import moment from "moment";
|
||||
export default {
|
||||
toCityObjData(excelData) {
|
||||
const result = excelData.map(item => {
|
||||
console.log(item[1]);
|
||||
const row = {
|
||||
city: item[0],
|
||||
monitorTime: moment(item[1]).format("YYYY/MM/DD HH:mm:ss"),
|
||||
monitorTime: moment(item[1]).valueOf(),
|
||||
so2: Number(item[2]) || null,
|
||||
no2: Number(item[3]) || null,
|
||||
pm10: Number(item[4]) || null,
|
||||
@@ -23,14 +22,16 @@ export default {
|
||||
})
|
||||
return result;
|
||||
},
|
||||
toAreaObjData(excelData) {
|
||||
toCountyObjData(excelData) {
|
||||
const result = excelData.map(item => {
|
||||
const place = item[0];
|
||||
const county = place.substr(0,place.indexOf("县") + 1);
|
||||
const area = place.substr(0,place.indexOf("区") + 1);
|
||||
const row = {
|
||||
place,
|
||||
county,
|
||||
monitorTime: moment(item[1]).format("YYYY/MM/DD HH:mm:ss"),
|
||||
area,
|
||||
monitorTime: moment(item[1]).valueOf(),
|
||||
airQualityStatus: item[2],
|
||||
aqiLevel: item[3],
|
||||
aqi: Number(item[4]) || null,
|
||||
@@ -38,7 +39,7 @@ export default {
|
||||
so2: Number(item[6]) || null,
|
||||
no2: Number(item[7]) || null,
|
||||
pm10: Number(item[8]) || null,
|
||||
c0: Number(item[9]) || null,
|
||||
co: Number(item[9]) || null,
|
||||
o3: Number(item[10]) || null,
|
||||
pm25: Number(item[11]) || null,
|
||||
remark: item[12]
|
||||
@@ -47,7 +48,7 @@ export default {
|
||||
})
|
||||
return result;
|
||||
},
|
||||
toStationObjData(excelData) {
|
||||
toPlaceObjData(excelData) {
|
||||
const result = excelData.map(item => {
|
||||
const place = item[1];
|
||||
// const county = place.substr(0,place.indexOf("县"))
|
||||
@@ -55,7 +56,7 @@ export default {
|
||||
city: item[0],
|
||||
// county,
|
||||
place,
|
||||
monitorTime: moment(item[2]).format("YYYY/MM/DD HH:mm:ss"),
|
||||
monitorTime: moment(item[2]).valueOf(),
|
||||
so2: Number(item[3]) || null,
|
||||
no2: Number(item[5]) || null,
|
||||
pm10: Number(item[7]) || null,
|
||||
|
||||
@@ -1,6 +1,52 @@
|
||||
<template>
|
||||
<div class="ele-body">
|
||||
<a-card :bordered="false">
|
||||
<a-form
|
||||
:model="where"
|
||||
: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" allow-clear show-search>
|
||||
<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-space>
|
||||
<a-button type="primary" @click="reload">查询</a-button>
|
||||
<a-button @click="reset">重置</a-button>
|
||||
</a-space>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-row>
|
||||
|
||||
</a-row>
|
||||
</a-form>
|
||||
<a-modal
|
||||
v-model:visible="showNYear"
|
||||
:title="'批量复制'"
|
||||
:confirm-loading="loading"
|
||||
:body-style="{ paddingBottom: '8px' }"
|
||||
@ok="copyBatch"
|
||||
>
|
||||
<a-form
|
||||
ref="form"
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
:label-col="{ md: { span: 6 }, sm: { span: 24 } }"
|
||||
:wrapper-col="{ md: { span: 18 }, sm: { span: 24 } }"
|
||||
>
|
||||
<a-form-item label="新年份" name="nYear">
|
||||
<a-input-number id="inputNumber" v-model:value="nYear" :min="1970" :max="2050" />
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</a-modal>
|
||||
<a-modal
|
||||
v-model:visible="showEdit"
|
||||
:title="form.airAqiRelateInfoDictId !== undefined ? '修改' : '添加'"
|
||||
@@ -16,6 +62,9 @@
|
||||
:label-col="{ md: { span: 6 }, sm: { span: 24 } }"
|
||||
:wrapper-col="{ md: { span: 18 }, sm: { span: 24 } }"
|
||||
>
|
||||
<a-form-item label="年份" name="year">
|
||||
<a-input-number v-model:value="form.year" :min="1970" :max="2050" />
|
||||
</a-form-item>
|
||||
<a-form-item label="空气质量指数类别" name="iaqiCategory">
|
||||
<a-input v-model:value="form.iaqiCategory" placeholder="请输入指标名称" allow-clear />
|
||||
</a-form-item>
|
||||
@@ -50,10 +99,24 @@
|
||||
:columns="columns"
|
||||
:where="where"
|
||||
:scroll="{ x: 'max-content' }"
|
||||
@done="(d) => (data = d.data)"
|
||||
>
|
||||
<template #toolbar>
|
||||
<a-space>
|
||||
<a-button @click="openEdit" type="primary">新增</a-button>
|
||||
<a-dropdown>
|
||||
<template #overlay>
|
||||
<a-menu @click="setCYear">
|
||||
<a-menu-item v-for="item in yearOptions" :key="item.value">
|
||||
{{ item.label }}
|
||||
</a-menu-item>
|
||||
</a-menu>
|
||||
</template>
|
||||
<a-button>
|
||||
批量复制
|
||||
<DownOutlined/>
|
||||
</a-button>
|
||||
</a-dropdown>
|
||||
<a-popconfirm
|
||||
:disabled="selectionList.length == 0"
|
||||
:title="`确认删除${selectionList.length}条数据吗?`"
|
||||
@@ -69,6 +132,7 @@
|
||||
>删除
|
||||
</a-button>
|
||||
</a-popconfirm>
|
||||
<a-button @click="exportData" type="primary">导出</a-button>
|
||||
</a-space>
|
||||
</template>
|
||||
<template #action="{ record }">
|
||||
@@ -105,12 +169,16 @@ import {
|
||||
saveAqiRelate,
|
||||
updateAqiRelate,
|
||||
removeAqiRelate,
|
||||
removeBatchAqiRelate
|
||||
removeBatchAqiRelate,
|
||||
copyBatchPlace,
|
||||
getColumnOptions
|
||||
} from "@/api/ecology/atmosphere/air-api-relate";
|
||||
import {DownOutlined} from '@ant-design/icons-vue';
|
||||
import XLSX from "xlsx";
|
||||
// import moment from "moment";
|
||||
export default {
|
||||
name: "AirAqiRelate",
|
||||
components: {},
|
||||
components: {DownOutlined},
|
||||
data() {
|
||||
return {
|
||||
data: [],
|
||||
@@ -119,10 +187,10 @@ export default {
|
||||
selection: [],
|
||||
// 表格列配置
|
||||
columns: [
|
||||
// {
|
||||
// title: "年份",
|
||||
// dataIndex: "year",
|
||||
// },
|
||||
{
|
||||
title: "年份",
|
||||
dataIndex: "year",
|
||||
},
|
||||
{
|
||||
title: "空气质量指数类别",
|
||||
dataIndex: "iaqiCategory",
|
||||
@@ -184,9 +252,14 @@ export default {
|
||||
// evaluate: [{required: true,message: '请输入评价',},],
|
||||
sortNumber: [{required: true,message: '请输入排序',},],
|
||||
},
|
||||
yearOptions: [],
|
||||
showNYear:false,
|
||||
cYear: undefined,
|
||||
nYear:undefined,
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.getOptions();
|
||||
},
|
||||
methods: {
|
||||
minLeqChange(e){
|
||||
@@ -290,7 +363,55 @@ export default {
|
||||
}).finally(() => {
|
||||
hide();
|
||||
})
|
||||
},
|
||||
getOptions(){
|
||||
getColumnOptions("year").then(res => {
|
||||
console.log(res)
|
||||
if (res.data.code == 0) {
|
||||
this.yearOptions = res.data.data.map(item => {
|
||||
return {
|
||||
label: item,
|
||||
value: item
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
setCYear(e){
|
||||
this.cYear = e.key;
|
||||
this.showNYear = true;
|
||||
},
|
||||
copyBatch(){
|
||||
const hide = this.$message.loading('请求中..', 0);
|
||||
copyBatchPlace({cyear:Number(this.cYear),nyear:this.nYear}).then(res=>{
|
||||
if (res.data.code === 0) {
|
||||
this.$message.success(res.data.msg);
|
||||
this.reload();
|
||||
this.getOptions();
|
||||
} else {
|
||||
this.$message.error(res.data.msg);
|
||||
}
|
||||
this.showNYear = false;
|
||||
}).catch(e => {
|
||||
this.$message.error(e.message);
|
||||
}).finally(() => {
|
||||
hide();
|
||||
})
|
||||
},
|
||||
exportData(){
|
||||
const columns = this.columns.filter(item=>item.dataIndex);
|
||||
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());
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
};
|
||||
|
||||
@@ -1,6 +1,52 @@
|
||||
<template>
|
||||
<div class="ele-body">
|
||||
<a-card :bordered="false">
|
||||
<a-form
|
||||
:model="where"
|
||||
: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" allow-clear show-search>
|
||||
<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-space>
|
||||
<a-button type="primary" @click="reload">查询</a-button>
|
||||
<a-button @click="reset">重置</a-button>
|
||||
</a-space>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-row>
|
||||
|
||||
</a-row>
|
||||
</a-form>
|
||||
<a-modal
|
||||
v-model:visible="showNYear"
|
||||
:title="'批量复制'"
|
||||
:confirm-loading="loading"
|
||||
:body-style="{ paddingBottom: '8px' }"
|
||||
@ok="copyBatch"
|
||||
>
|
||||
<a-form
|
||||
ref="form"
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
:label-col="{ md: { span: 6 }, sm: { span: 24 } }"
|
||||
:wrapper-col="{ md: { span: 18 }, sm: { span: 24 } }"
|
||||
>
|
||||
<a-form-item label="新年份" name="nYear">
|
||||
<a-input-number id="inputNumber" v-model:value="nYear" :min="1970" :max="2050" />
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</a-modal>
|
||||
<a-modal
|
||||
v-model:visible="showEdit"
|
||||
:title="form.id !== undefined ? '修改' : '添加'"
|
||||
@@ -16,6 +62,9 @@
|
||||
:label-col="{ md: { span: 6 }, sm: { span: 24 } }"
|
||||
:wrapper-col="{ md: { span: 18 }, sm: { span: 24 } }"
|
||||
>
|
||||
<a-form-item label="年份" name="year">
|
||||
<a-input-number v-model:value="form.year" :min="1970" :max="2050" />
|
||||
</a-form-item>
|
||||
<a-form-item label="指标名称" name="indicatorName">
|
||||
<a-input v-model:value="form.indicatorName" placeholder="请输入指标名称" allow-clear />
|
||||
</a-form-item>
|
||||
@@ -54,10 +103,24 @@
|
||||
:columns="columns"
|
||||
:where="where"
|
||||
:scroll="{ x: 'max-content' }"
|
||||
@done="(d) => (data = d.data)"
|
||||
>
|
||||
<template #toolbar>
|
||||
<a-space>
|
||||
<a-button @click="openEdit" type="primary">新增</a-button>
|
||||
<a-dropdown>
|
||||
<template #overlay>
|
||||
<a-menu @click="setCYear">
|
||||
<a-menu-item v-for="item in yearOptions" :key="item.value">
|
||||
{{ item.label }}
|
||||
</a-menu-item>
|
||||
</a-menu>
|
||||
</template>
|
||||
<a-button>
|
||||
批量复制
|
||||
<DownOutlined/>
|
||||
</a-button>
|
||||
</a-dropdown>
|
||||
<a-popconfirm
|
||||
:disabled="selectionList.length == 0"
|
||||
:title="`确认删除${selectionList.length}条数据吗?`"
|
||||
@@ -73,6 +136,7 @@
|
||||
>删除
|
||||
</a-button>
|
||||
</a-popconfirm>
|
||||
<a-button @click="exportData" type="primary">导出</a-button>
|
||||
</a-space>
|
||||
</template>
|
||||
<template #action="{ record }">
|
||||
@@ -109,12 +173,16 @@ import {
|
||||
saveStandard,
|
||||
updateStandard,
|
||||
removeStandard,
|
||||
removeBatchStandard
|
||||
removeBatchStandard,
|
||||
copyBatchPlace,
|
||||
getColumnOptions
|
||||
} from "@/api/ecology/atmosphere/air-evaluation-standard";
|
||||
import {DownOutlined} from '@ant-design/icons-vue';
|
||||
import XLSX from "xlsx";
|
||||
// import moment from "moment";
|
||||
export default {
|
||||
name: "ZoneNoiseStandard",
|
||||
components: {},
|
||||
name: "AirEvaluationStandard",
|
||||
components: {DownOutlined},
|
||||
data() {
|
||||
return {
|
||||
data: [],
|
||||
@@ -123,6 +191,7 @@ export default {
|
||||
selection: [],
|
||||
// 表格列配置
|
||||
columns: [
|
||||
{title: "年份", dataIndex: "year",sorter: true,},
|
||||
{
|
||||
title: "年份",
|
||||
dataIndex: "year",
|
||||
@@ -177,15 +246,21 @@ export default {
|
||||
loading: false,
|
||||
rules: {
|
||||
timeSlot:[{required: true,message: '请选择时段'}],
|
||||
year: [{required: true, message: '请输入年份'}],
|
||||
// minLeq: [{required: true,message: '请输入最小值',},],
|
||||
// maxLeq: [{required: true,message: '请输入最大值',},],
|
||||
level: [{required: true,message: '请输入等级',},],
|
||||
// evaluate: [{required: true,message: '请输入评价',},],
|
||||
sortNumber: [{required: true,message: '请输入排序',},],
|
||||
},
|
||||
yearOptions: [],
|
||||
showNYear:false,
|
||||
cYear: undefined,
|
||||
nYear:undefined,
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.getOptions();
|
||||
},
|
||||
methods: {
|
||||
minLeqChange(e){
|
||||
@@ -289,7 +364,55 @@ export default {
|
||||
}).finally(() => {
|
||||
hide();
|
||||
})
|
||||
},
|
||||
getOptions(){
|
||||
getColumnOptions("year").then(res => {
|
||||
console.log(res)
|
||||
if (res.data.code == 0) {
|
||||
this.yearOptions = res.data.data.map(item => {
|
||||
return {
|
||||
label: item,
|
||||
value: item
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
setCYear(e){
|
||||
this.cYear = e.key;
|
||||
this.showNYear = true;
|
||||
},
|
||||
copyBatch(){
|
||||
const hide = this.$message.loading('请求中..', 0);
|
||||
copyBatchPlace({cyear:Number(this.cYear),nyear:this.nYear}).then(res=>{
|
||||
if (res.data.code === 0) {
|
||||
this.$message.success(res.data.msg);
|
||||
this.reload();
|
||||
this.getOptions();
|
||||
} else {
|
||||
this.$message.error(res.data.msg);
|
||||
}
|
||||
this.showNYear = false;
|
||||
}).catch(e => {
|
||||
this.$message.error(e.message);
|
||||
}).finally(() => {
|
||||
hide();
|
||||
})
|
||||
},
|
||||
exportData(){
|
||||
const columns = this.columns.filter(item=>item.dataIndex);
|
||||
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());
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
};
|
||||
|
||||
@@ -1,6 +1,52 @@
|
||||
<template>
|
||||
<div class="ele-body">
|
||||
<a-card :bordered="false">
|
||||
<a-form
|
||||
:model="where"
|
||||
: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" allow-clear show-search>
|
||||
<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-space>
|
||||
<a-button type="primary" @click="reload">查询</a-button>
|
||||
<a-button @click="reset">重置</a-button>
|
||||
</a-space>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-row>
|
||||
|
||||
</a-row>
|
||||
</a-form>
|
||||
<a-modal
|
||||
v-model:visible="showNYear"
|
||||
:title="'批量复制'"
|
||||
:confirm-loading="loading"
|
||||
:body-style="{ paddingBottom: '8px' }"
|
||||
@ok="copyBatch"
|
||||
>
|
||||
<a-form
|
||||
ref="form"
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
:label-col="{ md: { span: 6 }, sm: { span: 24 } }"
|
||||
:wrapper-col="{ md: { span: 18 }, sm: { span: 24 } }"
|
||||
>
|
||||
<a-form-item label="新年份" name="nYear">
|
||||
<a-input-number id="inputNumber" v-model:value="nYear" :min="1970" :max="2050" />
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</a-modal>
|
||||
<a-modal
|
||||
v-model:visible="showEdit"
|
||||
:title="form.id !== undefined ? '修改' : '添加'"
|
||||
@@ -16,6 +62,7 @@
|
||||
:label-col="{ md: { span: 6 }, sm: { span: 24 } }"
|
||||
:wrapper-col="{ md: { span: 18 }, sm: { span: 24 } }"
|
||||
>
|
||||
|
||||
<template v-for="item in columns" :key="item.dataIndex">
|
||||
<a-form-item v-if="item.dataIndex" :label="item.title" :name="item.dataIndex">
|
||||
<a-input v-model:value="form[item.dataIndex]" :placeholder="`请输入${item.title}`" allow-clear/>
|
||||
@@ -35,10 +82,24 @@
|
||||
:columns="columns"
|
||||
:where="where"
|
||||
:scroll="{ x: 'max-content' }"
|
||||
@done="(d) => (data = d.data)"
|
||||
>
|
||||
<template #toolbar>
|
||||
<a-space>
|
||||
<a-button @click="openEdit" type="primary">新增</a-button>
|
||||
<a-dropdown>
|
||||
<template #overlay>
|
||||
<a-menu @click="setCYear">
|
||||
<a-menu-item v-for="item in yearOptions" :key="item.value">
|
||||
{{ item.label }}
|
||||
</a-menu-item>
|
||||
</a-menu>
|
||||
</template>
|
||||
<a-button>
|
||||
批量复制
|
||||
<DownOutlined/>
|
||||
</a-button>
|
||||
</a-dropdown>
|
||||
<a-popconfirm
|
||||
:disabled="selectionList.length == 0"
|
||||
:title="`确认删除${selectionList.length}条数据吗?`"
|
||||
@@ -54,6 +115,7 @@
|
||||
>删除
|
||||
</a-button>
|
||||
</a-popconfirm>
|
||||
<a-button @click="exportData" type="primary">导出</a-button>
|
||||
</a-space>
|
||||
</template>
|
||||
<template #action="{ record }">
|
||||
@@ -92,12 +154,16 @@ import {
|
||||
saveIndicatorIaqi,
|
||||
updateIndicatorIaqi,
|
||||
removeIndicatorIaqi,
|
||||
removeBatchIndicatorIaqi
|
||||
removeBatchIndicatorIaqi,
|
||||
copyBatchPlace,
|
||||
getColumnOptions
|
||||
} from "@/api/ecology/atmosphere/air-indicator-iaqi";
|
||||
import {DownOutlined} from '@ant-design/icons-vue';
|
||||
import XLSX from "xlsx";
|
||||
// import moment from "moment";
|
||||
export default {
|
||||
name: "AirIndicatorIaqi",
|
||||
components: {},
|
||||
components: {DownOutlined},
|
||||
data() {
|
||||
return {
|
||||
data: [],
|
||||
@@ -110,6 +176,7 @@ export default {
|
||||
// title: "年份",
|
||||
// dataIndex: "year",
|
||||
// },
|
||||
{title: "年份", dataIndex: "year",sorter: true,},
|
||||
{title: "空气质量分指数",dataIndex: "iaqi",},
|
||||
{title: "so2 24小时平均", dataIndex: "so2TwentyFourHour",},
|
||||
{title: "so2 1小时平均",dataIndex: "so2OneHour",},
|
||||
@@ -145,6 +212,7 @@ export default {
|
||||
form: {},
|
||||
loading: false,
|
||||
rules: {
|
||||
year: [{required: true, message: '请输入年份'}],
|
||||
timeSlot: [{required: true, message: '请选择时段'}],
|
||||
// minLeq: [{required: true,message: '请输入最小值',},],
|
||||
// maxLeq: [{required: true,message: '请输入最大值',},],
|
||||
@@ -152,9 +220,14 @@ export default {
|
||||
// evaluate: [{required: true,message: '请输入评价',},],
|
||||
sortNumber: [{required: true, message: '请输入排序',},],
|
||||
},
|
||||
yearOptions: [],
|
||||
showNYear:false,
|
||||
cYear: undefined,
|
||||
nYear:undefined,
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.getOptions();
|
||||
},
|
||||
methods: {
|
||||
minLeqChange(e) {
|
||||
@@ -258,7 +331,55 @@ export default {
|
||||
}).finally(() => {
|
||||
hide();
|
||||
})
|
||||
},
|
||||
getOptions(){
|
||||
getColumnOptions("year").then(res => {
|
||||
console.log(res)
|
||||
if (res.data.code == 0) {
|
||||
this.yearOptions = res.data.data.map(item => {
|
||||
return {
|
||||
label: item,
|
||||
value: item
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
setCYear(e){
|
||||
this.cYear = e.key;
|
||||
this.showNYear = true;
|
||||
},
|
||||
copyBatch(){
|
||||
const hide = this.$message.loading('请求中..', 0);
|
||||
copyBatchPlace({cyear:Number(this.cYear),nyear:this.nYear}).then(res=>{
|
||||
if (res.data.code === 0) {
|
||||
this.$message.success(res.data.msg);
|
||||
this.reload();
|
||||
this.getOptions();
|
||||
} else {
|
||||
this.$message.error(res.data.msg);
|
||||
}
|
||||
this.showNYear = false;
|
||||
}).catch(e => {
|
||||
this.$message.error(e.message);
|
||||
}).finally(() => {
|
||||
hide();
|
||||
})
|
||||
},
|
||||
exportData(){
|
||||
const columns = this.columns.filter(item=>item.dataIndex);
|
||||
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());
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
};
|
||||
|
||||
@@ -1,234 +0,0 @@
|
||||
<template>
|
||||
<div class="ele-body">
|
||||
<a-card :bordered="false">
|
||||
<a-modal
|
||||
v-model:visible="showEdit"
|
||||
:title="form.airBasicInfoDictId !== undefined ? '修改' : '添加'"
|
||||
:confirm-loading="loading"
|
||||
:width="800"
|
||||
:body-style="{ paddingBottom: '8px' }"
|
||||
@ok="save"
|
||||
>
|
||||
<a-form
|
||||
ref="form"
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
:label-col="{ md: { span: 6 }, sm: { span: 24 } }"
|
||||
:wrapper-col="{ md: { span: 18 }, sm: { span: 24 } }"
|
||||
>
|
||||
<a-form-item label="年份" name="place">
|
||||
<a-input v-model:value="form.place" placeholder="请输入点位名称" allow-clear />
|
||||
</a-form-item>
|
||||
|
||||
</a-form>
|
||||
</a-modal>
|
||||
<!-- 表格 -->
|
||||
<ele-pro-table
|
||||
v-model:selection="selectionList"
|
||||
ref="table"
|
||||
row-key="airBasicInfoDictId"
|
||||
:datasource="url"
|
||||
:columns="columns"
|
||||
:where="where"
|
||||
:scroll="{ x: 'max-content' }"
|
||||
>
|
||||
<template #toolbar>
|
||||
<a-space>
|
||||
<a-button @click="openEdit" type="primary">新增</a-button>
|
||||
<a-popconfirm
|
||||
:disabled="selectionList.length == 0"
|
||||
:title="`确认删除${selectionList.length}条数据吗?`"
|
||||
ok-text="Yes"
|
||||
cancel-text="No"
|
||||
@confirm="removeBatch"
|
||||
>
|
||||
<a-button
|
||||
:disabled="selectionList.length == 0"
|
||||
type="primary"
|
||||
ghost
|
||||
danger
|
||||
>删除
|
||||
</a-button>
|
||||
</a-popconfirm>
|
||||
</a-space>
|
||||
</template>
|
||||
<template #action="{ record }">
|
||||
<a-space>
|
||||
<a-button
|
||||
@click="openEdit(record)"
|
||||
type="primary"
|
||||
shape="round"
|
||||
size="small"
|
||||
>修改</a-button
|
||||
>
|
||||
<a-popconfirm
|
||||
:title="`确认删除这条数据吗?`"
|
||||
ok-text="Yes"
|
||||
cancel-text="No"
|
||||
@confirm="remove(record)"
|
||||
>
|
||||
<a-button type="primary" danger shape="round" size="small"
|
||||
>删除</a-button
|
||||
>
|
||||
</a-popconfirm>
|
||||
</a-space>
|
||||
</template>
|
||||
</ele-pro-table>
|
||||
</a-card>
|
||||
</div>
|
||||
<!-- 编辑弹窗 -->
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// import _ from "lodash";
|
||||
import {
|
||||
listAllUrl,
|
||||
savePlace,
|
||||
updatePlace,
|
||||
removePlace,
|
||||
removeBatchPlace
|
||||
} from "@/api/ecology/atmosphere/air-plcae";
|
||||
// import moment from "moment";
|
||||
export default {
|
||||
name: "AirPlace",
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
data: [],
|
||||
// 表格数据接口
|
||||
url: listAllUrl,
|
||||
selection: [],
|
||||
// 表格列配置
|
||||
columns: [
|
||||
{
|
||||
title: "年份",
|
||||
dataIndex: "year",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
key: "action",
|
||||
width: 150,
|
||||
align: "center",
|
||||
fixed: "right",
|
||||
slots: {
|
||||
customRender: "action",
|
||||
},
|
||||
},
|
||||
],
|
||||
|
||||
// 表格搜索条件
|
||||
where: {},
|
||||
// 表格选中数据
|
||||
selectionList: [],
|
||||
// 是否显示编辑弹窗
|
||||
showEdit: false,
|
||||
// 表单数据
|
||||
form: {},
|
||||
loading: false,
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
/* 刷新表格 */
|
||||
reload() {
|
||||
|
||||
this.$refs.table.reload({
|
||||
where: this.where,
|
||||
});
|
||||
},
|
||||
/* 重置搜索 */
|
||||
reset() {
|
||||
this.where = {};
|
||||
this.reload();
|
||||
},
|
||||
/* 打开编辑弹窗 */
|
||||
openEdit(row) {
|
||||
// cloneRecord.mi
|
||||
this.form = Object.assign({}, row);
|
||||
this.showEdit = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.form.clearValidate(); // 清除表单验证信息
|
||||
});
|
||||
},
|
||||
async save() {
|
||||
await this.$refs.form.validate();
|
||||
const hide = this.$message.loading('请求中..', 0);
|
||||
const form = this.form;
|
||||
if (form.airBasicInfoDictId) {
|
||||
updatePlace(form)
|
||||
.then((res) => {
|
||||
if (res.data.code == 0) {
|
||||
this.showEdit = false;
|
||||
this.$message.success(res.data.msg);
|
||||
this.reload();
|
||||
} else {
|
||||
this.$message.error(res.data.msg);
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
this.$message.error(error.message);
|
||||
})
|
||||
.finally(() => {
|
||||
hide();
|
||||
});
|
||||
} else {
|
||||
savePlace(form)
|
||||
.then((res) => {
|
||||
if (res.data.code == 0) {
|
||||
this.showEdit = false;
|
||||
this.$message.success(res.data.msg);
|
||||
this.reload();
|
||||
} else {
|
||||
this.$message.error(res.data.msg);
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
this.$message.error(error.message);
|
||||
})
|
||||
.finally(() => {
|
||||
hide();
|
||||
});
|
||||
}
|
||||
},
|
||||
/* 删除单个 */
|
||||
remove(row) {
|
||||
const hide = this.$message.loading('请求中..', 0);
|
||||
removePlace(row.airBasicInfoDictId).then((res) => {
|
||||
hide();
|
||||
if (res.data.code === 0) {
|
||||
this.$message.success(res.data.msg);
|
||||
this.reload();
|
||||
} else {
|
||||
this.$message.error(res.data.msg);
|
||||
}
|
||||
}).catch(e => {
|
||||
hide();
|
||||
this.$message.error(e.message);
|
||||
})
|
||||
},
|
||||
/* 批量删除 */
|
||||
removeBatch() {
|
||||
const hide = this.$message.loading('请求中..', 0);
|
||||
const ids = this.selectionList.map((item) => item.airBasicInfoDictId);
|
||||
removeBatchPlace(ids).then((res) => {
|
||||
if (res.data.code === 0) {
|
||||
this.$message.success(res.data.msg);
|
||||
this.reload();
|
||||
} else {
|
||||
this.$message.error(res.data.msg);
|
||||
}
|
||||
}).catch(e => {
|
||||
this.$message.error(e.message);
|
||||
}).finally(() => {
|
||||
hide();
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
</style>
|
||||
@@ -1,6 +1,52 @@
|
||||
<template>
|
||||
<div class="ele-body">
|
||||
<a-card :bordered="false">
|
||||
<a-form
|
||||
:model="where"
|
||||
: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" allow-clear show-search>
|
||||
<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-space>
|
||||
<a-button type="primary" @click="reload">查询</a-button>
|
||||
<a-button @click="reset">重置</a-button>
|
||||
</a-space>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-row>
|
||||
|
||||
</a-row>
|
||||
</a-form>
|
||||
<a-modal
|
||||
v-model:visible="showNYear"
|
||||
:title="'批量复制'"
|
||||
:confirm-loading="loading"
|
||||
:body-style="{ paddingBottom: '8px' }"
|
||||
@ok="copyBatch"
|
||||
>
|
||||
<a-form
|
||||
ref="form"
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
:label-col="{ md: { span: 6 }, sm: { span: 24 } }"
|
||||
:wrapper-col="{ md: { span: 18 }, sm: { span: 24 } }"
|
||||
>
|
||||
<a-form-item label="新年份" name="nYear">
|
||||
<a-input-number id="inputNumber" v-model:value="nYear" :min="1970" :max="2050" />
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</a-modal>
|
||||
<a-modal
|
||||
v-model:visible="showEdit"
|
||||
:title="form.airBasicInfoDictId !== undefined ? '修改' : '添加'"
|
||||
@@ -16,6 +62,9 @@
|
||||
:label-col="{ md: { span: 6 }, sm: { span: 24 } }"
|
||||
:wrapper-col="{ md: { span: 18 }, sm: { span: 24 } }"
|
||||
>
|
||||
<a-form-item label="年份" name="year">
|
||||
<a-input-number v-model:value="form.year" :min="1970" :max="2050" />
|
||||
</a-form-item>
|
||||
<a-form-item label="点位名称" name="place">
|
||||
<a-input v-model:value="form.place" placeholder="请输入点位名称" allow-clear />
|
||||
</a-form-item>
|
||||
@@ -49,10 +98,24 @@
|
||||
:columns="columns"
|
||||
:where="where"
|
||||
:scroll="{ x: 'max-content' }"
|
||||
@done="(d) => (data = d.data)"
|
||||
>
|
||||
<template #toolbar>
|
||||
<a-space>
|
||||
<a-button @click="openEdit" type="primary">新增</a-button>
|
||||
<a-dropdown>
|
||||
<template #overlay>
|
||||
<a-menu @click="setCYear">
|
||||
<a-menu-item v-for="item in yearOptions" :key="item.value">
|
||||
{{ item.label }}
|
||||
</a-menu-item>
|
||||
</a-menu>
|
||||
</template>
|
||||
<a-button>
|
||||
批量复制
|
||||
<DownOutlined/>
|
||||
</a-button>
|
||||
</a-dropdown>
|
||||
<a-popconfirm
|
||||
:disabled="selectionList.length == 0"
|
||||
:title="`确认删除${selectionList.length}条数据吗?`"
|
||||
@@ -68,6 +131,7 @@
|
||||
>删除
|
||||
</a-button>
|
||||
</a-popconfirm>
|
||||
<a-button @click="exportData" type="primary">导出</a-button>
|
||||
</a-space>
|
||||
</template>
|
||||
<template #action="{ record }">
|
||||
@@ -104,12 +168,16 @@ import {
|
||||
savePlace,
|
||||
updatePlace,
|
||||
removePlace,
|
||||
removeBatchPlace
|
||||
removeBatchPlace,
|
||||
copyBatchPlace,
|
||||
getColumnOptions
|
||||
} from "@/api/ecology/atmosphere/air-plcae";
|
||||
import XLSX from "xlsx";
|
||||
import {DownOutlined} from '@ant-design/icons-vue';
|
||||
// import moment from "moment";
|
||||
export default {
|
||||
name: "AirPlace",
|
||||
components: {},
|
||||
components: {DownOutlined},
|
||||
data() {
|
||||
return {
|
||||
data: [],
|
||||
@@ -118,6 +186,7 @@ export default {
|
||||
selection: [],
|
||||
// 表格列配置
|
||||
columns: [
|
||||
{title: "年份", dataIndex: "year",sorter: true,},
|
||||
{title: "点位名称",dataIndex: "place",sorter: true,},
|
||||
{title: "片区名称",dataIndex: "districtName",sorter: true,},
|
||||
{title: "属性",dataIndex: "attributes",sorter: true,},
|
||||
@@ -157,14 +226,20 @@ export default {
|
||||
form: {},
|
||||
loading: false,
|
||||
rules: {
|
||||
year: [{required: true, message: '请输入年份'}],
|
||||
place:[{required: true,message: '请输入点位名称'}],
|
||||
placeCode:[{required: true,message: '请输入点位编码'}],
|
||||
placeLng: [{required: true,message: '请输入测点经度',},],
|
||||
placeLat: [{required: true,message: '请输入测点纬度',},],
|
||||
},
|
||||
yearOptions: [],
|
||||
showNYear:false,
|
||||
cYear: undefined,
|
||||
nYear:undefined,
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.getOptions();
|
||||
},
|
||||
methods: {
|
||||
/* 刷新表格 */
|
||||
@@ -260,6 +335,53 @@ export default {
|
||||
}).finally(() => {
|
||||
hide();
|
||||
})
|
||||
},
|
||||
getOptions(){
|
||||
getColumnOptions("year").then(res => {
|
||||
console.log(res)
|
||||
if (res.data.code == 0) {
|
||||
this.yearOptions = res.data.data.map(item => {
|
||||
return {
|
||||
label: item,
|
||||
value: item
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
setCYear(e){
|
||||
this.cYear = e.key;
|
||||
this.showNYear = true;
|
||||
},
|
||||
copyBatch(){
|
||||
const hide = this.$message.loading('请求中..', 0);
|
||||
copyBatchPlace({cyear:Number(this.cYear),nyear:this.nYear}).then(res=>{
|
||||
if (res.data.code === 0) {
|
||||
this.$message.success(res.data.msg);
|
||||
this.reload();
|
||||
this.getOptions();
|
||||
} else {
|
||||
this.$message.error(res.data.msg);
|
||||
}
|
||||
this.showNYear = false;
|
||||
}).catch(e => {
|
||||
this.$message.error(e.message);
|
||||
}).finally(() => {
|
||||
hide();
|
||||
})
|
||||
},
|
||||
exportData(){
|
||||
const columns = this.columns.filter(item=>item.dataIndex);
|
||||
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());
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
@@ -2,14 +2,7 @@
|
||||
<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 :model="where" layout="inline">
|
||||
<a-form-item label="区域等级:">
|
||||
<a-select v-model:value="where.regionLevel">
|
||||
<a-select-option
|
||||
@@ -19,27 +12,23 @@
|
||||
</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 label="起始日期:">
|
||||
<a-date-picker valueFormat="YYYY-MM-DD 00:00:00" v-model:value="where.timeStart"></a-date-picker>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-row>
|
||||
<a-col :lg="24" :md="24" :sm="24" :xs="24">
|
||||
<a-form-item label="结束日期:">
|
||||
<a-date-picker valueFormat="YYYY-MM-DD 00:00:00" 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-col>
|
||||
</a-row>
|
||||
|
||||
</a-form>
|
||||
<!-- 表格 -->
|
||||
<ele-pro-table
|
||||
v-model:selection="selectionList"
|
||||
ref="table"
|
||||
row-key="ambientAirId"
|
||||
:need-page="false"
|
||||
@@ -71,6 +60,7 @@ export default {
|
||||
name: "StatisticAirAreaBase",
|
||||
components: {},
|
||||
data() {
|
||||
const year = new Date().getFullYear();
|
||||
return {
|
||||
data: [],
|
||||
locale,
|
||||
@@ -88,98 +78,101 @@ export default {
|
||||
columns: [
|
||||
{title: "日期", dataIndex: "monitorTime", align: "center"},
|
||||
|
||||
{title: "SO2五象", dataIndex: "wuXiangXinQuSo2",align:"center"},
|
||||
{title: "NO2五象", dataIndex: "wuXiangXinQuNo2",align:"center"},
|
||||
{title: "PM10五象", dataIndex: "wuXiangXinQuPm10",align:"center"},
|
||||
{title: "CO五象", dataIndex: "wuXiangXinQuCo",align:"center"},
|
||||
{title: "O3五象", dataIndex: "wuXiangXinQuO3",align:"center"},
|
||||
{title: "PM2.5五象", dataIndex: "wuXiangXinQuPm25",align:"center"},
|
||||
{title: "AQI五象", dataIndex: "wuXiangXinQuAqi",align:"center"},
|
||||
{title: "类别五象", dataIndex: "wuXiangXinQuAqiCategory",align:"center"},
|
||||
{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",customRender:({text})=> typeof text == "number"?text.toFixed(0)+"":""},
|
||||
|
||||
{title: "SO2兴宁", dataIndex: "xingNingSo2",align:"center"},
|
||||
{title: "NO2兴宁", dataIndex: "xingNingNo2",align:"center"},
|
||||
{title: "PM10兴宁", dataIndex: "xingNingPm10",align:"center"},
|
||||
{title: "CO兴宁", dataIndex: "xingNingCo",align:"center"},
|
||||
{title: "O3_8h兴宁", dataIndex: "xingNingO3",align:"center"},
|
||||
{title: "PM2.5兴宁", dataIndex: "xingNingPm25",align:"center"},
|
||||
{title: "AQI兴宁", dataIndex: "xingNingAqi",align:"center"},
|
||||
{title: "类别兴宁", dataIndex: "xingNingAqiCategory",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",customRender:({text})=> typeof text == "number"?text.toFixed(0)+"":""},
|
||||
|
||||
{title: "SO2江南", dataIndex: "jiangNanSo2",align:"center"},
|
||||
{title: "NO2江南", dataIndex: "jiangNanNo2",align:"center"},
|
||||
{title: "PM10江南", dataIndex: "jiangNanPm10",align:"center"},
|
||||
{title: "CO江南", dataIndex: "jiangNanCo",align:"center"},
|
||||
{title: "O3_8h江南", dataIndex: "jiangNanO3",align:"center"},
|
||||
{title: "PM2.5江南", dataIndex: "jiangNanPm25",align:"center"},
|
||||
{title: "AQI江南", dataIndex: "jiangNanAqi",align:"center"},
|
||||
{title: "类别江南", dataIndex: "jiangNanAqiCategory",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",customRender:({text})=> typeof text == "number"?text.toFixed(0)+"":""},
|
||||
|
||||
{title: "SO2青秀", dataIndex: "qingXiuSo2",align:"center"},
|
||||
{title: "NO2青秀", dataIndex: "qingXiuNo2",align:"center"},
|
||||
{title: "PM10青秀", dataIndex: "qingXiuPm10",align:"center"},
|
||||
{title: "CO青秀", dataIndex: "qingXiuCo",align:"center"},
|
||||
{title: "O3_8h青秀", dataIndex: "qingXiuO3",align:"center"},
|
||||
{title: "PM2.5青秀", dataIndex: "qingXiuPm25",align:"center"},
|
||||
{title: "AQI青秀", dataIndex: "qingXiuAqi",align:"center"},
|
||||
{title: "类别青秀", dataIndex: "qingXiuAqiCategory",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",customRender:({text})=> typeof text == "number"?text.toFixed(0)+"":""},
|
||||
|
||||
{title: "SO2西乡塘", dataIndex: "xiXiangTangSo2",align:"center"},
|
||||
{title: "NO2西乡塘", dataIndex: "xiXiangTangNo2",align:"center"},
|
||||
{title: "PM10西乡塘", dataIndex: "xiXiangTangPm10",align:"center"},
|
||||
{title: "CO西乡塘", dataIndex: "xiXiangTangCo",align:"center"},
|
||||
{title: "O3_8h西乡塘", dataIndex: "xiXiangTangO3",align:"center"},
|
||||
{title: "PM2.5西乡塘", dataIndex: "xiXiangTangPm25",align:"center"},
|
||||
{title: "AQI西乡塘", dataIndex: "xiXiangTangAqi",align:"center"},
|
||||
{title: "类别西乡塘", dataIndex: "xiXiangTangAqiCategory",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",customRender:({text})=> typeof text == "number"?text.toFixed(0)+"":""},
|
||||
|
||||
{title: "SO2邕宁", dataIndex: "yongNingSo2",align:"center"},
|
||||
{title: "NO2邕宁", dataIndex: "yongNingNo2",align:"center"},
|
||||
{title: "PM10邕宁", dataIndex: "yongNingPm10",align:"center"},
|
||||
{title: "CO邕宁", dataIndex: "yongNingCo",align:"center"},
|
||||
{title: "O3_8h邕宁", dataIndex: "yongNingO3",align:"center"},
|
||||
{title: "PM2.5邕宁", dataIndex: "yongNingPm25",align:"center"},
|
||||
{title: "AQI邕宁", dataIndex: "yongNingAqi",align:"center"},
|
||||
{title: "类别邕宁", dataIndex: "yongNingAqiCategory",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",customRender:({text})=> typeof text == "number"?text.toFixed(0)+"":""},
|
||||
|
||||
{title: "SO2良庆", dataIndex: "liangQingSo2",align:"center"},
|
||||
{title: "NO2良庆", dataIndex: "liangQingNo2",align:"center"},
|
||||
{title: "PM10良庆", dataIndex: "liangQingPm10",align:"center"},
|
||||
{title: "CO良庆", dataIndex: "liangQingCo",align:"center"},
|
||||
{title: "O3_8h良庆", dataIndex: "liangQingO3",align:"center"},
|
||||
{title: "PM2.5良庆", dataIndex: "liangQingPm25",align:"center"},
|
||||
{title: "AQI良庆", dataIndex: "liangQingAqi",align:"center"},
|
||||
{title: "类别良庆", dataIndex: "liangQingAqiCategory",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",customRender:({text})=> typeof text == "number"?text.toFixed(0)+"":""},
|
||||
|
||||
{title: "SO2高新", dataIndex: "gaoXinSo2",align:"center"},
|
||||
{title: "NO2高新", dataIndex: "gaoXinNo2",align:"center"},
|
||||
{title: "PM10高新", dataIndex: "gaoXinPm10",align:"center"},
|
||||
{title: "CO高新", dataIndex: "gaoXinCo",align:"center"},
|
||||
{title: "O3_8h高新", dataIndex: "gaoXinO3",align:"center"},
|
||||
{title: "PM2.5高新", dataIndex: "gaoXinPm25",align:"center"},
|
||||
{title: "AQI高新", dataIndex: "gaoXinAqi",align:"center"},
|
||||
{title: "类别高新", dataIndex: "gaoXinAqiCategory",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",customRender:({text})=> typeof text == "number"?text.toFixed(0)+"":""},
|
||||
|
||||
{title: "SO2经开", dataIndex: "jingKaiSo2",align:"center"},
|
||||
{title: "NO2经开", dataIndex: "jingKaiNo2",align:"center"},
|
||||
{title: "PM10经开", dataIndex: "jingKaiPm10",align:"center"},
|
||||
{title: "Co经开", dataIndex: "jingKaiCo",align:"center"},
|
||||
{title: "O3_8h经开", dataIndex: "jingKaiO3",align:"center"},
|
||||
{title: "PM2.5经开", dataIndex: "jingKaiPm25",align:"center"},
|
||||
{title: "AQI经开", dataIndex: "jingKaiAqi",align:"center"},
|
||||
{title: "类别经开", dataIndex: "jingKaiAqiCategory",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",customRender:({text})=> typeof text == "number"?text.toFixed(0)+"":""},
|
||||
],
|
||||
regionLevelOptions: [],
|
||||
time: undefined,
|
||||
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();
|
||||
},
|
||||
@@ -198,21 +191,6 @@ export default {
|
||||
/* 刷新表格 */
|
||||
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
|
||||
});
|
||||
@@ -248,12 +226,18 @@ export default {
|
||||
})
|
||||
arr.push(th1, th2);
|
||||
this.data.forEach((d) => {
|
||||
const td = columnsTemp.map((item) => d[item.dataIndex]);
|
||||
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());
|
||||
|
||||
this.$util.exportSheet(XLSX, sheet, moment(this.where.timeStart).format("YYYY年MM月DD日") + "至" + moment(this.where.timeEnd).format("YYYY年MM月DD日"));
|
||||
|
||||
},
|
||||
},
|
||||
|
||||
@@ -4,12 +4,8 @@
|
||||
<!-- 搜索表单 -->
|
||||
<a-form
|
||||
:model="where"
|
||||
layout="vertical"
|
||||
:label-col="{ md: { span: 6 }, sm: { span: 24 } }"
|
||||
:wrapper-col="{ md: { span: 18 }, sm: { span: 24 } }"
|
||||
layout="inline"
|
||||
>
|
||||
<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
|
||||
@@ -19,27 +15,21 @@
|
||||
</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 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 00:00:00" v-model:value="where.timeEnd"></a-date-picker>
|
||||
</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"
|
||||
@@ -62,7 +52,6 @@
|
||||
import _ from "lodash";
|
||||
import XLSX from "xlsx";
|
||||
import {statisticUrl, getColumnOptions,statisticArea} from "@/api/ecology/air";
|
||||
import { Modal } from "ant-design-vue";
|
||||
import locale from "ant-design-vue/es/date-picker/locale/zh_CN";
|
||||
import moment from "moment";
|
||||
|
||||
@@ -71,6 +60,7 @@ export default {
|
||||
name: "StatisticAirAvg",
|
||||
components: {},
|
||||
data() {
|
||||
const year = new Date().getFullYear();
|
||||
return {
|
||||
data: [],
|
||||
locale,
|
||||
@@ -201,16 +191,19 @@ export default {
|
||||
|
||||
],
|
||||
regionLevelOptions: [],
|
||||
time: undefined,
|
||||
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();
|
||||
},
|
||||
@@ -238,21 +231,6 @@ export default {
|
||||
/* 刷新表格 */
|
||||
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");
|
||||
}
|
||||
|
||||
if(this.where.regionLevel == "area"){
|
||||
delete where["regionLevel"]
|
||||
@@ -297,7 +275,7 @@ export default {
|
||||
});
|
||||
let sheet = XLSX.utils.aoa_to_sheet(arr);
|
||||
sheet['!merges'] = merges;
|
||||
this.$util.exportSheet(XLSX, sheet, new Date().getTime().toString());
|
||||
this.$util.exportSheet(XLSX, sheet, moment(this.where.timeStart).format("YYYY年MM月DD日") + "至" + moment(this.where.timeEnd).format("YYYY年MM月DD日"));
|
||||
|
||||
},
|
||||
},
|
||||
|
||||
@@ -71,8 +71,11 @@
|
||||
<a-form-item label="点位编码" name="placeCode">
|
||||
<a-input v-model:value="form.placeCode" placeholder="请输入点位编码" allow-clear />
|
||||
</a-form-item>
|
||||
<a-form-item label="测点高度" name="placeHeight">
|
||||
<a-input v-model:value="form.placeHeight" placeholder="请输入测点高度" allow-clear />
|
||||
<a-form-item label="所属路段" name="road">
|
||||
<a-input v-model:value="form.road" placeholder="请输入所属路段" allow-clear />
|
||||
</a-form-item>
|
||||
<a-form-item label="所属城区" name="area">
|
||||
<a-input v-model:value="form.area" placeholder="请输入所属城区" allow-clear />
|
||||
</a-form-item>
|
||||
<a-form-item label="功能区类型" name="functionType">
|
||||
<a-input v-model:value="form.functionType" placeholder="请输入功能区类型" allow-clear />
|
||||
@@ -80,38 +83,17 @@
|
||||
<a-form-item label="功能区代码" name="functionCode">
|
||||
<a-input v-model:value="form.functionCode" placeholder="请输入功能区代码" allow-clear />
|
||||
</a-form-item>
|
||||
<a-form-item label="测点高度" name="placeHeight">
|
||||
<a-input v-model:value="form.placeHeight" placeholder="请输入测点高度" allow-clear />
|
||||
</a-form-item>
|
||||
<a-form-item label="测点经度" name="placeLng">
|
||||
<a-input v-model:value="form.placeLng" placeholder="请输入测点经度" allow-clear />
|
||||
<a-input type="number" v-model:value="form.placeLng" placeholder="请输入测点经度" allow-clear />
|
||||
</a-form-item>
|
||||
<a-form-item label="测点纬度" name="placeLat">
|
||||
<a-input v-model:value="form.placeLat" placeholder="请输入测点纬度" allow-clear />
|
||||
<a-input type="number" v-model:value="form.placeLat" placeholder="请输入测点纬度" allow-clear />
|
||||
</a-form-item>
|
||||
<a-form-item label="测点参照物" name="refObj">
|
||||
<a-input v-model:value="form.refObj" placeholder="请输入测点参照物" allow-clear />
|
||||
</a-form-item>
|
||||
<a-form-item label="监测站名" name="station">
|
||||
<a-input v-model:value="form.station" placeholder="请输入监测站名" allow-clear />
|
||||
</a-form-item>
|
||||
<a-form-item label="监测仪器型号" name="monitorInstrumentModel">
|
||||
<a-input v-model:value="form.monitorInstrumentModel" placeholder="请输入测监测仪器型号" allow-clear />
|
||||
</a-form-item>
|
||||
<a-form-item label="监测仪器编号" name="monitorInstrumentCode">
|
||||
<a-input v-model:value="form.monitorInstrumentCode" placeholder="请输入监测仪器编号" allow-clear />
|
||||
</a-form-item>
|
||||
<a-form-item label="监测前校准值" name="beforeMonitorValue">
|
||||
<a-input v-model:value="form.beforeMonitorValue" placeholder="请输入监测前校准值" allow-clear />
|
||||
</a-form-item>
|
||||
<a-form-item label="监测后校准值" name="afterMonitorValue">
|
||||
<a-input v-model:value="form.afterMonitorValue" placeholder="请输入监测后校准值" allow-clear />
|
||||
</a-form-item>
|
||||
<a-form-item label="声校准器测量声压值" name="soundPressureValue">
|
||||
<a-input v-model:value="form.soundPressureValue" placeholder="请输入声校准器测量声压值" allow-clear />
|
||||
</a-form-item>
|
||||
<a-form-item label="声校准仪器型号" name="soundInstrumentModel">
|
||||
<a-input v-model:value="form.soundInstrumentModel" placeholder="请输入声校准仪器型号" allow-clear />
|
||||
</a-form-item>
|
||||
<a-form-item label="声校准仪器编号" name="soundInstrumentCode">
|
||||
<a-input v-model:value="form.soundInstrumentCode" placeholder="请输入声校准仪器编号" allow-clear />
|
||||
<a-form-item label="点位等级" name="regionLevel">
|
||||
<a-input v-model:value="form.regionLevel" placeholder="请输入点位等级" allow-clear />
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</a-modal>
|
||||
@@ -156,6 +138,13 @@
|
||||
>删除
|
||||
</a-button>
|
||||
</a-popconfirm>
|
||||
<a-upload
|
||||
:before-upload="importFile"
|
||||
:showUploadList="false"
|
||||
accept=".xls,.xlsx,.csv"
|
||||
>
|
||||
<a-button>导入</a-button>
|
||||
</a-upload>
|
||||
<a-button @click="exportData" type="primary">导出</a-button>
|
||||
</a-space>
|
||||
</template>
|
||||
@@ -195,9 +184,11 @@ import {
|
||||
removePlace,
|
||||
removeBatchPlace,
|
||||
getColumnOptions,
|
||||
copyBatchPlace
|
||||
copyBatchPlace,
|
||||
savePlaceBatch
|
||||
} from "@/api/ecology/noise/function-noise-place";
|
||||
import XLSX from "xlsx";
|
||||
import {Modal} from "ant-design-vue";
|
||||
// import moment from "moment";
|
||||
export default {
|
||||
name: "FunctionNoisePlace",
|
||||
@@ -230,62 +221,15 @@ export default {
|
||||
dataIndex: "functionType",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "功能区代码",
|
||||
dataIndex: "functionCode",
|
||||
sorter: true,
|
||||
},
|
||||
{title: "功能区代码",dataIndex: "functionCode",sorter: true, },
|
||||
{
|
||||
title: "测点经度",
|
||||
dataIndex: "placeLng",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "测点纬度",
|
||||
dataIndex: "placeLat",
|
||||
sorter: true,
|
||||
},
|
||||
{title: "测点纬度",dataIndex: "placeLat",sorter: true,},
|
||||
{title: "点位等级",dataIndex: "regionLevel",sorter: true,},
|
||||
|
||||
{
|
||||
title: "测点参照物",
|
||||
dataIndex: "refObj",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "监测站名",
|
||||
dataIndex: "station",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "监测仪器型号",
|
||||
dataIndex: "monitorInstrumentModel",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "监测仪器编号",
|
||||
dataIndex: "monitorInstrumentCode",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "监测前校准值",
|
||||
dataIndex: "beforeMonitorValue",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "声校准器测量声压值",
|
||||
dataIndex: "soundPressureValue",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "声校准仪器型号",
|
||||
dataIndex: "soundInstrumentModel",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "声校准仪器编号",
|
||||
dataIndex: "soundInstrumentCode",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
key: "action",
|
||||
@@ -465,6 +409,97 @@ export default {
|
||||
hide();
|
||||
})
|
||||
},
|
||||
importFile(file) {
|
||||
const hide = this.$message.loading("导入中..", 0);
|
||||
let reader = new FileReader();
|
||||
reader.onload = (e) => {
|
||||
try {
|
||||
let data = new Uint8Array(e.target.result);
|
||||
let workbook = XLSX.read(data, {
|
||||
type: "array",
|
||||
});
|
||||
let sheetNames = workbook.SheetNames;
|
||||
// 解析成二维数组
|
||||
let aoa = XLSX.utils.sheet_to_json(workbook.Sheets[sheetNames[0]], {
|
||||
header: 1,
|
||||
});
|
||||
|
||||
// const reportDate = aoa[1][0].replace(/[^\d]+/g, "-");
|
||||
const roadNoiseList = aoa.filter(
|
||||
(item) => {
|
||||
return item.length >= 10 && item[0] && !item[0].toString().includes("年")
|
||||
}
|
||||
);
|
||||
|
||||
// 解析成对象数组
|
||||
const billData = roadNoiseList.map(item=>{
|
||||
return {
|
||||
year:item[0],
|
||||
placeCode:item[1],
|
||||
placeName:item[2],
|
||||
road:item[3],
|
||||
area:item[4],
|
||||
functionCode:item[5],
|
||||
functionType:item[6],
|
||||
placeHeight:item[7],
|
||||
placeLng:item[8],
|
||||
placeLat:item[9],
|
||||
regionLevel:item[10],
|
||||
}
|
||||
});
|
||||
|
||||
if (!billData || billData.length == 0) {
|
||||
hide();
|
||||
Modal.error({
|
||||
title: "导入失败",
|
||||
content: "找不到可用数据",
|
||||
});
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (billData.length > 0) {
|
||||
// 上传到服务器
|
||||
savePlaceBatch(billData)
|
||||
.then((res) => {
|
||||
if (res.data.code == 0) {
|
||||
Modal.success({
|
||||
title: "导入成功",
|
||||
content: `成功导入${
|
||||
billData.length
|
||||
}条数据`,
|
||||
});
|
||||
this.reload();
|
||||
this.getOptions();
|
||||
} else {
|
||||
Modal.error({
|
||||
title: "导入失败",
|
||||
content: "数据上传出错",
|
||||
});
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
Modal.error({
|
||||
title: "导入失败",
|
||||
content: "数据上传出错",
|
||||
});
|
||||
})
|
||||
.finally(() => {
|
||||
hide();
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
hide();
|
||||
Modal.error({
|
||||
title: "导入失败",
|
||||
content: error.message,
|
||||
});
|
||||
}
|
||||
// console.log(billData);
|
||||
};
|
||||
reader.readAsArrayBuffer(file);
|
||||
return false;
|
||||
},
|
||||
|
||||
},
|
||||
};
|
||||
|
||||
@@ -69,51 +69,31 @@
|
||||
<a-form-item label="测点名称" name="placeName">
|
||||
<a-input v-model:value="form.placeName" placeholder="请输入测点名称" allow-clear/>
|
||||
</a-form-item>
|
||||
<a-form-item label="点位编码" name="placeCode">
|
||||
<a-input v-model:value="form.placeCode" placeholder="请输入点位编码" allow-clear/>
|
||||
</a-form-item>
|
||||
<a-form-item label="所属城区" name="area">
|
||||
<a-input v-model:value="form.area" placeholder="请输入所属城区" allow-clear/>
|
||||
</a-form-item>
|
||||
<a-form-item label="所属路段" name="road">
|
||||
<a-input v-model:value="form.road" placeholder="请输入所属路段" allow-clear/>
|
||||
</a-form-item>
|
||||
<a-form-item label="路长" name="roadLength">
|
||||
<a-input type="number" v-model:value="form.roadLength" placeholder="请输入所属路长" allow-clear/>
|
||||
</a-form-item>
|
||||
<a-form-item label="路宽" name="roadWidth">
|
||||
<a-input type="number" v-model:value="form.roadWidth" placeholder="请输入所属路宽" allow-clear/>
|
||||
</a-form-item>
|
||||
<a-form-item label="测点经度" name="placeLng">
|
||||
<a-input v-model:value="form.placeLng" placeholder="请输入测点经度" allow-clear/>
|
||||
</a-form-item>
|
||||
<a-form-item label="测点纬度" name="placeLat">
|
||||
<a-input v-model:value="form.placeLat" placeholder="请输入测点纬度" allow-clear/>
|
||||
</a-form-item>
|
||||
<a-form-item label="机动车车道数" name="motorway">
|
||||
<a-input type="number" v-model:value="form.motorway" placeholder="请输入机动车车道数" allow-clear/>
|
||||
</a-form-item>
|
||||
<a-form-item label="车道类别" name="motorwayType">
|
||||
<a-input v-model:value="form.motorwayType" placeholder="请输入车道类别" allow-clear/>
|
||||
</a-form-item>
|
||||
<a-form-item label="道路等级" name="motorwayLevel">
|
||||
<a-input v-model:value="form.motorwayLevel" placeholder="请输入道路等级" allow-clear/>
|
||||
</a-form-item>
|
||||
<a-form-item label="测点参照物" name="refObj">
|
||||
<a-input v-model:value="form.refObj" placeholder="请输入测点参照物" allow-clear/>
|
||||
</a-form-item>
|
||||
<a-form-item label="道路覆盖人口(万人)" name="people">
|
||||
<a-input v-model:value="form.people" placeholder="请输入道路覆盖人口(万人)" allow-clear/>
|
||||
</a-form-item>
|
||||
<a-form-item label="监测站名" name="station">
|
||||
<a-input v-model:value="form.station" placeholder="请输入监测站名" allow-clear/>
|
||||
</a-form-item>
|
||||
<a-form-item label="监测仪器型号" name="monitorInstrumentModel">
|
||||
<a-input v-model:value="form.monitorInstrumentModel" placeholder="请输入测监测仪器型号" allow-clear/>
|
||||
</a-form-item>
|
||||
<a-form-item label="监测仪器编号" name="monitorInstrumentCode">
|
||||
<a-input v-model:value="form.monitorInstrumentCode" placeholder="请输入监测仪器编号" allow-clear/>
|
||||
</a-form-item>
|
||||
<a-form-item label="监测前校准值" name="beforeMonitorValue">
|
||||
<a-input v-model:value="form.beforeMonitorValue" placeholder="请输入监测前校准值" allow-clear/>
|
||||
</a-form-item>
|
||||
<a-form-item label="监测后校准值" name="afterMonitorValue">
|
||||
<a-input v-model:value="form.afterMonitorValue" placeholder="请输入监测后校准值" allow-clear/>
|
||||
</a-form-item>
|
||||
<a-form-item label="声校准器测量声压值" name="soundPressureValue">
|
||||
<a-input v-model:value="form.soundPressureValue" placeholder="请输入声校准器测量声压值" allow-clear/>
|
||||
</a-form-item>
|
||||
<a-form-item label="声校准仪器型号" name="soundInstrumentModel">
|
||||
<a-input v-model:value="form.soundInstrumentModel" placeholder="请输入声校准仪器型号" allow-clear/>
|
||||
</a-form-item>
|
||||
<a-form-item label="声校准仪器编号" name="soundInstrumentCode">
|
||||
<a-input v-model:value="form.soundInstrumentCode" placeholder="请输入声校准仪器编号" allow-clear/>
|
||||
<a-form-item label="点位等级" name="regionLevel">
|
||||
<a-input v-model:value="form.regionLevel" placeholder="请输入点位等级" allow-clear/>
|
||||
</a-form-item>
|
||||
|
||||
</a-form>
|
||||
</a-modal>
|
||||
<!-- 表格 -->
|
||||
@@ -159,6 +139,13 @@
|
||||
>删除
|
||||
</a-button>
|
||||
</a-popconfirm>
|
||||
<a-upload
|
||||
:before-upload="importFile"
|
||||
:showUploadList="false"
|
||||
accept=".xls,.xlsx,.csv"
|
||||
>
|
||||
<a-button>导入</a-button>
|
||||
</a-upload>
|
||||
<a-button @click="exportData" type="primary">导出</a-button>
|
||||
</a-space>
|
||||
</template>
|
||||
@@ -200,10 +187,12 @@ import {
|
||||
removePlace,
|
||||
removeBatchPlace,
|
||||
copyBatchPlace,
|
||||
getColumnOptions
|
||||
getColumnOptions,
|
||||
savePlaceBatch
|
||||
} from "@/api/ecology/noise/road-noise-place";
|
||||
import {DownOutlined} from '@ant-design/icons-vue';
|
||||
import XLSX from "xlsx";
|
||||
import {Modal} from "ant-design-vue";
|
||||
// import moment from "moment";
|
||||
export default {
|
||||
name: "RoadNoisePlace",
|
||||
@@ -216,86 +205,15 @@ export default {
|
||||
selection: [],
|
||||
// 表格列配置
|
||||
columns: [
|
||||
{
|
||||
title: "年份",
|
||||
dataIndex: "year",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "测点名称",
|
||||
dataIndex: "placeName",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "测点经度",
|
||||
dataIndex: "placeLng",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "测点纬度",
|
||||
dataIndex: "placeLat",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "机动车车道数",
|
||||
dataIndex: "motorway",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "车道类别",
|
||||
dataIndex: "motorwayType",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "道路等级",
|
||||
dataIndex: "motorwayLevel",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "测点参照物",
|
||||
dataIndex: "refObj",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "道路覆盖人口(万人)",
|
||||
dataIndex: "people",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "监测站名",
|
||||
dataIndex: "station",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "监测仪器型号",
|
||||
dataIndex: "monitorInstrumentModel",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "监测仪器编号",
|
||||
dataIndex: "monitorInstrumentCode",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "监测前校准值",
|
||||
dataIndex: "beforeMonitorValue",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "声校准器测量声压值",
|
||||
dataIndex: "soundPressureValue",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "声校准仪器型号",
|
||||
dataIndex: "soundInstrumentModel",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "声校准仪器编号",
|
||||
dataIndex: "soundInstrumentCode",
|
||||
sorter: true,
|
||||
},
|
||||
{title: "年份",dataIndex: "year",sorter: true,},
|
||||
{title: "测点名称",dataIndex: "placeName",sorter: true,},
|
||||
{title: "点位编码",dataIndex: "placeCode",sorter: true,},
|
||||
{title: "所属城区",dataIndex: "area",sorter: true,},
|
||||
{title: "所属路段",dataIndex: "road",sorter: true,},
|
||||
{title: "路长",dataIndex: "roadLength",sorter: true,},
|
||||
{title: "路宽",dataIndex: "roadWidth",sorter: true,},
|
||||
{title: "测点经度",dataIndex: "placeLng",sorter: true, },
|
||||
{title: "测点纬度",dataIndex: "placeLat",sorter: true,},
|
||||
{
|
||||
title: "操作",
|
||||
key: "action",
|
||||
@@ -321,10 +239,10 @@ export default {
|
||||
form: {},
|
||||
loading: false,
|
||||
rules: {
|
||||
year: [{required: true, message: '请输入年份'}],
|
||||
placeName: [{required: true, message: '请选择测点名称'}],
|
||||
placeLng: [{required: true, message: '请输入测点经度',},],
|
||||
placeLat: [{required: true, message: '请输入测点纬度',},],
|
||||
// year: [{required: true, message: '请输入年份'}],
|
||||
// placeName: [{required: true, message: '请选择测点名称'}],
|
||||
// placeLng: [{required: true, message: '请输入测点经度',},],
|
||||
// placeLat: [{required: true, message: '请输入测点纬度',},],
|
||||
},
|
||||
};
|
||||
},
|
||||
@@ -474,7 +392,97 @@ export default {
|
||||
|
||||
let sheet = XLSX.utils.aoa_to_sheet(arr);
|
||||
this.$util.exportSheet(XLSX, sheet, new Date().getTime().toString());
|
||||
},
|
||||
importFile(file) {
|
||||
const hide = this.$message.loading("导入中..", 0);
|
||||
let reader = new FileReader();
|
||||
reader.onload = (e) => {
|
||||
try {
|
||||
let data = new Uint8Array(e.target.result);
|
||||
let workbook = XLSX.read(data, {
|
||||
type: "array",
|
||||
});
|
||||
let sheetNames = workbook.SheetNames;
|
||||
// 解析成二维数组
|
||||
let aoa = XLSX.utils.sheet_to_json(workbook.Sheets[sheetNames[0]], {
|
||||
header: 1,
|
||||
});
|
||||
|
||||
// const reportDate = aoa[1][0].replace(/[^\d]+/g, "-");
|
||||
const roadNoiseList = aoa.filter(
|
||||
(item) => {
|
||||
return item.length >= 10 && item[0] && !item[0].toString().includes("年")
|
||||
}
|
||||
);
|
||||
|
||||
// 解析成对象数组
|
||||
const billData = roadNoiseList.map(item=>{
|
||||
return {
|
||||
year:item[0],
|
||||
placeCode:item[1],
|
||||
placeName:item[2],
|
||||
road:item[3],
|
||||
area:item[4],
|
||||
roadLength:item[5],
|
||||
roadWidth:item[6],
|
||||
placeLng:item[7],
|
||||
placeLat:item[8],
|
||||
regionLevel:item[9],
|
||||
}
|
||||
});
|
||||
|
||||
if (!billData || billData.length == 0) {
|
||||
hide();
|
||||
Modal.error({
|
||||
title: "导入失败",
|
||||
content: "找不到可用数据",
|
||||
});
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (billData.length > 0) {
|
||||
// 上传到服务器
|
||||
savePlaceBatch(billData)
|
||||
.then((res) => {
|
||||
if (res.data.code == 0) {
|
||||
Modal.success({
|
||||
title: "导入成功",
|
||||
content: `成功导入${
|
||||
billData.length
|
||||
}条数据`,
|
||||
});
|
||||
this.reload();
|
||||
this.getOptions();
|
||||
} else {
|
||||
Modal.error({
|
||||
title: "导入失败",
|
||||
content: "数据上传出错",
|
||||
});
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
Modal.error({
|
||||
title: "导入失败",
|
||||
content: "数据上传出错",
|
||||
});
|
||||
})
|
||||
.finally(() => {
|
||||
hide();
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
hide();
|
||||
Modal.error({
|
||||
title: "导入失败",
|
||||
content: error.message,
|
||||
});
|
||||
}
|
||||
// console.log(billData);
|
||||
};
|
||||
reader.readAsArrayBuffer(file);
|
||||
return false;
|
||||
},
|
||||
|
||||
},
|
||||
};
|
||||
|
||||
@@ -71,43 +71,31 @@
|
||||
<a-form-item label="点位编码" name="placeCode">
|
||||
<a-input v-model:value="form.placeCode" placeholder="请输入点位编码" allow-clear/>
|
||||
</a-form-item>
|
||||
<a-form-item label="所属路段" name="road">
|
||||
<a-input v-model:value="form.road" placeholder="请输入所属路段" allow-clear />
|
||||
</a-form-item>
|
||||
<a-form-item label="所属城区" name="area">
|
||||
<a-input v-model:value="form.area" placeholder="请输入所属城区" allow-clear />
|
||||
</a-form-item>
|
||||
<a-form-item label="功能区代码" name="functionCode">
|
||||
<a-input v-model:value="form.functionCode" placeholder="请输入功能区代码" allow-clear />
|
||||
</a-form-item>
|
||||
<a-form-item label="网格边长" name="girdLength">
|
||||
<a-input type="number" v-model:value="form.girdLength" placeholder="请输入网格边长" allow-clear/>
|
||||
</a-form-item>
|
||||
<a-form-item label="声源代码" name="sourceCode">
|
||||
<a-input v-model:value="form.sourceCode" placeholder="请输入声源代码" allow-clear />
|
||||
</a-form-item>
|
||||
<a-form-item label="测点经度" name="placeLng">
|
||||
<a-input v-model:value="form.placeLng" placeholder="请输入测点经度" allow-clear/>
|
||||
<a-input type="number" v-model:value="form.placeLng" placeholder="请输入测点经度" allow-clear/>
|
||||
</a-form-item>
|
||||
<a-form-item label="测点纬度" name="placeLat">
|
||||
<a-input v-model:value="form.placeLat" placeholder="请输入测点纬度" allow-clear/>
|
||||
<a-input type="number" v-model:value="form.placeLat" placeholder="请输入测点纬度" allow-clear/>
|
||||
</a-form-item>
|
||||
<a-form-item label="点位等级" name="regionLevel">
|
||||
<a-input v-model:value="form.regionLevel" placeholder="请输入点位等级" allow-clear />
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item label="测点参照物" name="refObj">
|
||||
<a-input v-model:value="form.refObj" placeholder="请输入测点参照物" allow-clear/>
|
||||
</a-form-item>
|
||||
<!-- <a-form-item label="网格覆盖人口(万人)" name="people">-->
|
||||
<!-- <a-input v-model:value="form.people" placeholder="请输入网格覆盖人口(万人)" allow-clear />-->
|
||||
<!-- </a-form-item>-->
|
||||
<a-form-item label="监测站名" name="station">
|
||||
<a-input v-model:value="form.station" placeholder="请输入监测站名" allow-clear/>
|
||||
</a-form-item>
|
||||
<a-form-item label="监测仪器型号" name="monitorInstrumentModel">
|
||||
<a-input v-model:value="form.monitorInstrumentModel" placeholder="请输入测监测仪器型号" allow-clear/>
|
||||
</a-form-item>
|
||||
<a-form-item label="监测仪器编号" name="monitorInstrumentCode">
|
||||
<a-input v-model:value="form.monitorInstrumentCode" placeholder="请输入监测仪器编号" allow-clear/>
|
||||
</a-form-item>
|
||||
<a-form-item label="监测前校准值" name="beforeMonitorValue">
|
||||
<a-input v-model:value="form.beforeMonitorValue" placeholder="请输入监测前校准值" allow-clear/>
|
||||
</a-form-item>
|
||||
<a-form-item label="监测后校准值" name="afterMonitorValue">
|
||||
<a-input v-model:value="form.afterMonitorValue" placeholder="请输入监测后校准值" allow-clear/>
|
||||
</a-form-item>
|
||||
<a-form-item label="声校准器测量声压值" name="soundPressureValue">
|
||||
<a-input v-model:value="form.soundPressureValue" placeholder="请输入声校准器测量声压值" allow-clear/>
|
||||
</a-form-item>
|
||||
<a-form-item label="声校准仪器型号" name="soundInstrumentModel">
|
||||
<a-input v-model:value="form.soundInstrumentModel" placeholder="请输入声校准仪器型号" allow-clear/>
|
||||
</a-form-item>
|
||||
<a-form-item label="声校准仪器编号" name="soundInstrumentCode">
|
||||
<a-input v-model:value="form.soundInstrumentCode" placeholder="请输入声校准仪器编号" allow-clear/>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</a-modal>
|
||||
<!-- 表格 -->
|
||||
@@ -151,6 +139,13 @@
|
||||
>删除
|
||||
</a-button>
|
||||
</a-popconfirm>
|
||||
<a-upload
|
||||
:before-upload="importFile"
|
||||
:showUploadList="false"
|
||||
accept=".xls,.xlsx,.csv"
|
||||
>
|
||||
<a-button>导入</a-button>
|
||||
</a-upload>
|
||||
<a-button @click="exportData" type="primary">导出</a-button>
|
||||
</a-space>
|
||||
</template>
|
||||
@@ -192,10 +187,12 @@ import {
|
||||
removePlace,
|
||||
removeBatchPlace,
|
||||
copyBatchPlace,
|
||||
getColumnOptions
|
||||
getColumnOptions,
|
||||
savePlaceBatch
|
||||
} from "@/api/ecology/noise/zone-noise-place";
|
||||
import {DownOutlined} from '@ant-design/icons-vue';
|
||||
import XLSX from "xlsx";
|
||||
import {Modal} from "ant-design-vue";
|
||||
// import moment from "moment";
|
||||
export default {
|
||||
name: "ZoneNoisePlace",
|
||||
@@ -222,62 +219,20 @@ export default {
|
||||
dataIndex: "placeCode",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "测点经度",
|
||||
dataIndex: "placeLng",
|
||||
sorter: true,
|
||||
},
|
||||
{title: "所属路段",dataIndex: "road",sorter: true, },
|
||||
{title: "所属城区",dataIndex: "area",sorter: true, },
|
||||
{title: "功能区代码",dataIndex: "functionCode",sorter: true, },
|
||||
{title: "网格边长",dataIndex: "gridLength",sorter: true, },
|
||||
{title: "声源代码",dataIndex: "sourceCode",sorter: true, },
|
||||
|
||||
{title: "测点经度",dataIndex: "placeLng",sorter: true,},
|
||||
{
|
||||
title: "测点纬度",
|
||||
dataIndex: "placeLat",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "测点参照物",
|
||||
dataIndex: "refObj",
|
||||
sorter: true,
|
||||
},
|
||||
|
||||
{
|
||||
title: "监测站名",
|
||||
dataIndex: "station",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "监测仪器型号",
|
||||
dataIndex: "monitorInstrumentModel",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "监测仪器编号",
|
||||
dataIndex: "monitorInstrumentCode",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "监测前校准值",
|
||||
dataIndex: "beforeMonitorValue",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "声校准器测量声压值",
|
||||
dataIndex: "soundPressureValue",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "声校准仪器型号",
|
||||
dataIndex: "soundInstrumentModel",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "声校准仪器编号",
|
||||
dataIndex: "soundInstrumentCode",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
key: "action",
|
||||
width: 150,
|
||||
align: "center",
|
||||
{title: "点位等级",dataIndex: "regionLevel",sorter: true, },
|
||||
{title: "操作",key: "action",width: 150,align: "center",
|
||||
fixed: "right",
|
||||
slots: {
|
||||
customRender: "action",
|
||||
@@ -299,11 +254,11 @@ export default {
|
||||
form: {},
|
||||
loading: false,
|
||||
rules: {
|
||||
year: [{required: true, message: '请输入年份'}],
|
||||
placeName: [{required: true, message: '请输入测点名称'}],
|
||||
placeCode: [{required: true, message: '请输入点位编码'}],
|
||||
placeLng: [{required: true, message: '请输入测点经度',},],
|
||||
placeLat: [{required: true, message: '请输入测点纬度',},],
|
||||
// year: [{required: true, message: '请输入年份'}],
|
||||
// placeName: [{required: true, message: '请输入测点名称'}],
|
||||
// placeCode: [{required: true, message: '请输入点位编码'}],
|
||||
// placeLng: [{required: true, message: '请输入测点经度',},],
|
||||
// placeLat: [{required: true, message: '请输入测点纬度',},],
|
||||
},
|
||||
};
|
||||
},
|
||||
@@ -455,7 +410,99 @@ export default {
|
||||
|
||||
let sheet = XLSX.utils.aoa_to_sheet(arr);
|
||||
this.$util.exportSheet(XLSX, sheet, new Date().getTime().toString());
|
||||
},
|
||||
importFile(file) {
|
||||
const hide = this.$message.loading("导入中..", 0);
|
||||
let reader = new FileReader();
|
||||
reader.onload = (e) => {
|
||||
try {
|
||||
let data = new Uint8Array(e.target.result);
|
||||
let workbook = XLSX.read(data, {
|
||||
type: "array",
|
||||
});
|
||||
let sheetNames = workbook.SheetNames;
|
||||
// 解析成二维数组
|
||||
let aoa = XLSX.utils.sheet_to_json(workbook.Sheets[sheetNames[0]], {
|
||||
header: 1,
|
||||
});
|
||||
|
||||
// const reportDate = aoa[1][0].replace(/[^\d]+/g, "-");
|
||||
const roadNoiseList = aoa.filter(
|
||||
(item) => {
|
||||
return item.length >= 10 && item[0] && !item[0].toString().includes("年")
|
||||
}
|
||||
);
|
||||
|
||||
// 解析成对象数组
|
||||
const billData = roadNoiseList.map(item=>{
|
||||
return {
|
||||
year:item[0],
|
||||
placeCode:item[1],
|
||||
placeName:item[2],
|
||||
road:item[3],
|
||||
area:item[4],
|
||||
functionCode:item[5],
|
||||
gridLength:item[6],
|
||||
gridWidth:item[6],
|
||||
sourceCode:item[7],
|
||||
placeLng:item[8],
|
||||
placeLat:item[9],
|
||||
regionLevel:item[10],
|
||||
}
|
||||
});
|
||||
|
||||
if (!billData || billData.length == 0) {
|
||||
hide();
|
||||
Modal.error({
|
||||
title: "导入失败",
|
||||
content: "找不到可用数据",
|
||||
});
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (billData.length > 0) {
|
||||
// 上传到服务器
|
||||
savePlaceBatch(billData)
|
||||
.then((res) => {
|
||||
if (res.data.code == 0) {
|
||||
Modal.success({
|
||||
title: "导入成功",
|
||||
content: `成功导入${
|
||||
billData.length
|
||||
}条数据`,
|
||||
});
|
||||
this.reload();
|
||||
this.getOptions();
|
||||
} else {
|
||||
Modal.error({
|
||||
title: "导入失败",
|
||||
content: "数据上传出错",
|
||||
});
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
Modal.error({
|
||||
title: "导入失败",
|
||||
content: "数据上传出错",
|
||||
});
|
||||
})
|
||||
.finally(() => {
|
||||
hide();
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
hide();
|
||||
Modal.error({
|
||||
title: "导入失败",
|
||||
content: error.message,
|
||||
});
|
||||
}
|
||||
// console.log(billData);
|
||||
};
|
||||
reader.readAsArrayBuffer(file);
|
||||
return false;
|
||||
},
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
const tableColumns = [
|
||||
const innerTableColumns = [
|
||||
{title: "监测时间", dataIndex: "monitorTime", sorter: true,},
|
||||
{title: "点位名称",dataIndex: "pointName",sorter: true,},
|
||||
{title: "断面名称", dataIndex: "pointName", sorter: true,},
|
||||
{title: "水温(℃)", dataIndex: "waterTemperature", sorter: true,},
|
||||
{title: "pH值(无量纲)", dataIndex: "ph", sorter: true,},
|
||||
{title: "透明度(cm)", dataIndex: "transparency", sorter: true,},
|
||||
@@ -27,5 +27,53 @@ const tableColumns = [
|
||||
{title: "氧化还原电位(mV)", dataIndex: "oxidationReductionPotential", sorter: true,},
|
||||
{title: "备注", dataIndex: "remark", sorter: true,},
|
||||
];
|
||||
const specialTableColumns = [
|
||||
{title: "监测时间", dataIndex: "monitorTime", sorter: true,},
|
||||
{title: "测站名称", dataIndex: "stationName", sorter: true,},
|
||||
{title: "测站代码", dataIndex: "stationCode", sorter: true,},
|
||||
{title: "湖库名称", dataIndex: "lakeLibraryName", sorter: true,},
|
||||
{title: "湖库代码", dataIndex: "lakeLibraryCode", sorter: true,},
|
||||
{title: "断面名称", dataIndex: "sectionName", sorter: true,},
|
||||
{title: "断面代码", dataIndex: "sectionCode", sorter: true,},
|
||||
{title: "控制属性", dataIndex: "controlAttributes", sorter: true,},
|
||||
{title: "所属流域", dataIndex: "watershed", sorter: true,},
|
||||
{title: "水期代码", dataIndex: "waterPeriodCode", sorter: true,},
|
||||
|
||||
export {tableColumns}
|
||||
{title: "浊度(NTU)", dataIndex: "turbidity", sorter: true,},
|
||||
{title: "水温(℃)", dataIndex: "wTemp", sorter: true,},
|
||||
{title: "水位(m)", dataIndex: "wd", sorter: true,},
|
||||
{title: "pH值", dataIndex: "ph", sorter: true,},
|
||||
{title: "电导率(ms/m)", dataIndex: "wCond", sorter: true,},
|
||||
{title: "透明度(cm)", dataIndex: "transp", sorter: true,},
|
||||
{title: "溶解氧 (mg/L)", dataIndex: "dissolvedOxygen", sorter: true,},
|
||||
{title: "高锰酸盐指数 (mg/L)", dataIndex: "codmn", sorter: true,},
|
||||
{title: "氨氮 (mg/L)", dataIndex: "nh4N", sorter: true,},
|
||||
{title: "石油类 (mg/L)", dataIndex: "oils", sorter: true,},
|
||||
{title: "总氮 (mg/L)", dataIndex: "nTotal", sorter: true,},
|
||||
{title: "总磷 (mg/L)", dataIndex: "pTotal", sorter: true,},
|
||||
{title: "叶绿素 (mg/L)", dataIndex: "chlA", sorter: true,},
|
||||
{title: "挥发酚 (mg/L)", dataIndex: "vPhen", sorter: true,},
|
||||
{title: "汞 (mg/L)", dataIndex: "wHg", sorter: true,},
|
||||
{title: "铅 (mg/L)", dataIndex: "wPb", sorter: true,},
|
||||
{title: "化学需氧量 (mg/L)", dataIndex: "codcr", sorter: true,},
|
||||
{title: "铜 (mg/L)", dataIndex: "wCu", sorter: true,},
|
||||
{title: "锌 (mg/L)", dataIndex: "wZn", sorter: true,},
|
||||
{title: "氟化物 (mg/L)", dataIndex: "f", sorter: true,},
|
||||
{title: "硒 (mg/L)", dataIndex: "se", sorter: true,},
|
||||
{title: "砷 (mg/L)", dataIndex: "as", sorter: true,},
|
||||
{title: "镉 (mg/L)", dataIndex: "cd", sorter: true,},
|
||||
{title: "六价铬 (mg/L)", dataIndex: "cr6", sorter: true,},
|
||||
{title: "氰化物 (mg/L)", dataIndex: "cnTotal", sorter: true,},
|
||||
{title: "阴离子表面活性剂 (mg/L)", dataIndex: "anSaa", sorter: true,},
|
||||
{title: "硫化物 (mg/L)", dataIndex: "s", sorter: true,},
|
||||
{title: "粪大肠菌群 (mg/L)", dataIndex: "coloOrg", sorter: true,},
|
||||
{title: "硫酸盐 (mg/L)", dataIndex: "so4", sorter: true,},
|
||||
{title: "氯化物 (mg/L)", dataIndex: "cl", sorter: true,},
|
||||
{title: "硝酸盐 (mg/L)", dataIndex: "no3N", sorter: true,},
|
||||
{title: "铁 (mg/L)", dataIndex: "wFe", sorter: true,},
|
||||
{title: "锰 (mg/L)", dataIndex: "wMn", sorter: true,},
|
||||
{title: "水质类别", dataIndex: "waterQualityCategory", sorter: true,},
|
||||
{title: "系统编码", dataIndex: "systemCode", sorter: true,},
|
||||
{title: "备注", dataIndex: "remark", sorter: true,},
|
||||
];
|
||||
export {innerTableColumns, specialTableColumns}
|
||||
|
||||
@@ -7,6 +7,9 @@
|
||||
:before-upload="importFileInnerCity"
|
||||
:showUploadList="false"
|
||||
accept=".xls,.xlsx,.csv"
|
||||
ref="otherInnerLakeUpload"
|
||||
v-show="false"
|
||||
id="otherInnerLakeUpload"
|
||||
>
|
||||
<a-button>城市内湖导入</a-button>
|
||||
</a-upload>
|
||||
@@ -14,10 +17,28 @@
|
||||
:before-upload="importFileWuxiang"
|
||||
:showUploadList="false"
|
||||
accept=".xls,.xlsx,.csv"
|
||||
ref="wuxaingInnerLakeUpload"
|
||||
v-show="false"
|
||||
id="wuxaingInnerLakeUpload"
|
||||
>
|
||||
<a-button>五象湖导入</a-button>
|
||||
</a-upload>
|
||||
|
||||
<a-dropdown>
|
||||
<template #overlay>
|
||||
<a-menu @click="handleMenuClick">
|
||||
<a-menu-item key="wuxaingInnerLakeUpload">
|
||||
五象湖
|
||||
</a-menu-item>
|
||||
<a-menu-item key="otherInnerLakeUpload">
|
||||
其他内湖
|
||||
</a-menu-item>
|
||||
</a-menu>
|
||||
</template>
|
||||
<a-button>
|
||||
城市内湖导入
|
||||
<DownOutlined/>
|
||||
</a-button>
|
||||
</a-dropdown>
|
||||
<a-upload
|
||||
:before-upload="importFileSpecial"
|
||||
:showUploadList="false"
|
||||
@@ -60,6 +81,9 @@ export default {
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
handleMenuClick(e) {
|
||||
document.getElementById(e.key).click()
|
||||
},
|
||||
/* 导入本地excel文件 */
|
||||
importFileInnerCity(file) {
|
||||
const hide = this.$message.loading("导入中..", 0);
|
||||
|
||||
@@ -7,12 +7,6 @@
|
||||
|
||||
<!-- 搜索表单 -->
|
||||
<a-form layout="inline" :model="where" :labelCol="{ offset: 1}">
|
||||
<a-form-item label="区域等级:">
|
||||
<a-select v-model:value="where.regionLevel" allowClear placeholder="未选择">
|
||||
<a-select-option :value="'市级'">市级</a-select-option>
|
||||
<a-select-option :value="'县级'">县级</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
<a-form-item label="审核状态:">
|
||||
<a-select v-model:value="where.checked" allowClear placeholder="未选择">
|
||||
<a-select-option :value="1">已审核</a-select-option>
|
||||
|
||||
@@ -143,7 +143,7 @@ import {
|
||||
} from "@/api/ecology/special-lake";
|
||||
import locale from "ant-design-vue/es/date-picker/locale/zh_CN";
|
||||
import moment from "moment";
|
||||
import { tableColumns } from "./colums";
|
||||
import { specialTableColumns } from "./colums";
|
||||
// import utils from "./utils";
|
||||
export default {
|
||||
name: "LakeCollectWater",
|
||||
@@ -156,10 +156,10 @@ export default {
|
||||
// 表格数据接口
|
||||
url: pageLakeUrl,
|
||||
selection: [],
|
||||
tableColumns,
|
||||
tableColumns: specialTableColumns,
|
||||
// 表格列配置
|
||||
columns: [
|
||||
...tableColumns,
|
||||
...specialTableColumns,
|
||||
{
|
||||
title: "创建人",
|
||||
dataIndex: "userName",
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import moment from "moment";
|
||||
|
||||
export default {
|
||||
// 城市内湖导入
|
||||
toInnerCityLakeObjData(excelData, reportDate) {
|
||||
@@ -33,7 +34,7 @@ export default {
|
||||
anSaa: item [21],
|
||||
s: item [22],
|
||||
oxidationReductionPotential: item [23],
|
||||
remark:item [23],
|
||||
remark: item [24],
|
||||
|
||||
}
|
||||
return row;
|
||||
@@ -92,7 +93,7 @@ export default {
|
||||
sectionCode: item [6],
|
||||
controlAttributes: item [7],
|
||||
watershed: item [8],
|
||||
monitorTime:item [9],
|
||||
monitorTime: new Date(item[9]).getTime(),
|
||||
waterPeriodCode: item [10],
|
||||
turbidity: item [11],
|
||||
wTemp: item [12],
|
||||
@@ -129,8 +130,9 @@ export default {
|
||||
wFe: item [43],
|
||||
wMn: item [44],
|
||||
waterQualityCategory: item [45],
|
||||
remark:item [49],
|
||||
remark: item [46],
|
||||
systemCode: item[47],
|
||||
|
||||
}
|
||||
return row;
|
||||
})
|
||||
|
||||
@@ -7,12 +7,6 @@
|
||||
|
||||
<!-- 搜索表单 -->
|
||||
<a-form layout="inline" :model="where" :labelCol="{ offset: 1}">
|
||||
<a-form-item label="区域等级:">
|
||||
<a-select v-model:value="where.regionLevel" allowClear placeholder="未选择">
|
||||
<a-select-option :value="'市级'">市级</a-select-option>
|
||||
<a-select-option :value="'县级'">县级</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
<a-form-item label="审核状态:">
|
||||
<a-select v-model:value="where.checked" allowClear placeholder="未选择">
|
||||
<a-select-option :value="1">已审核</a-select-option>
|
||||
|
||||
@@ -143,7 +143,7 @@ import {
|
||||
} from "@/api/ecology/lake";
|
||||
import locale from "ant-design-vue/es/date-picker/locale/zh_CN";
|
||||
import moment from "moment";
|
||||
import { tableColumns } from "./colums";
|
||||
import { innerTableColumns } from "./colums";
|
||||
// import utils from "./utils";
|
||||
export default {
|
||||
name: "SpecialLakeCollectWater",
|
||||
@@ -156,10 +156,10 @@ export default {
|
||||
// 表格数据接口
|
||||
url: pageLakeUrl,
|
||||
selection: [],
|
||||
tableColumns,
|
||||
tableColumns: innerTableColumns,
|
||||
// 表格列配置
|
||||
columns: [
|
||||
...tableColumns,
|
||||
...innerTableColumns,
|
||||
{
|
||||
title: "创建人",
|
||||
dataIndex: "userName",
|
||||
|
||||
@@ -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>
|
||||
@@ -1,476 +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.regionLevel" allowClear showSearch>
|
||||
<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.place" allowClear showSearch>
|
||||
<a-select-option
|
||||
v-for="(item) in palceOptions"
|
||||
: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.area" allowClear showSearch>
|
||||
<a-select-option
|
||||
v-for="(item) in areaOptions"
|
||||
: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="zoneNoiseId"
|
||||
:datasource="url"
|
||||
:columns="columns"
|
||||
:where="where"
|
||||
:scroll="{ x: 'max-content' }"
|
||||
@done="(d) => (data = d.data)"
|
||||
>
|
||||
<template #Leq="{ text,record }">
|
||||
<a-tag v-if="(record.timeSlot == '昼' && text <= 68) || (record.timeSlot == '夜' && text <= 58)" color="green">{{text}}</a-tag>
|
||||
<a-tag v-else-if="(record.timeSlot == '昼' && text > 68 && text <=70) || (record.timeSlot == '夜' && text > 58 && text <=60)" color="blue">{{text}}</a-tag>
|
||||
<a-tag v-else-if="(record.timeSlot == '昼' && text > 70 && text <=72) || (record.timeSlot == '夜' && text > 60 && text <=62)" color="red">{{text}}</a-tag>
|
||||
<a-tag v-else-if="(record.timeSlot == '昼' && text > 62 && text <=74) || (record.timeSlot == '夜' && text > 62 && text <=64)" color="red">{{text}}</a-tag>
|
||||
<a-tag v-else-if="(record.timeSlot == '昼' && text > 74 ) || (record.timeSlot == '夜' && text > 64)" color="red">{{text}}</a-tag>
|
||||
<template v-else color="#FFF">{{text}}</template>
|
||||
</template>
|
||||
</ele-pro-table>
|
||||
</a-card>
|
||||
</div>
|
||||
<!-- 编辑弹窗 -->
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// import _ from "lodash";
|
||||
import XLSX from "xlsx";
|
||||
import { pageZoneNoiseUrl, getColumnOptions } from "@/api/ecology/noise/zone-sound";
|
||||
import locale from "ant-design-vue/es/date-picker/locale/zh_CN";
|
||||
import moment from "moment";
|
||||
// import utils from "./utils";
|
||||
export default {
|
||||
name: "StatisticSoundZoneBase",
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
data: [],
|
||||
locale,
|
||||
bill: {},
|
||||
// 表格数据接口
|
||||
url: pageZoneNoiseUrl,
|
||||
selection: [],
|
||||
// 表格列配置
|
||||
columns: [
|
||||
{
|
||||
title: "监测日期",
|
||||
dataIndex: "monitorTime",
|
||||
sorter: true,
|
||||
customRender: ({text})=> moment(text,"YYYY/MM/DD HH:mm:ss").format("YYYY-MM-DD HH:mm")
|
||||
},
|
||||
{
|
||||
title: "测点名称",
|
||||
dataIndex: "place",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "所属城区",
|
||||
dataIndex: "area",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "网格长(米)",
|
||||
dataIndex: "gridLength",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "网格宽(米)",
|
||||
dataIndex: "gridWidth",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "网格点号",
|
||||
dataIndex: "gridNo",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "主要声源",
|
||||
dataIndex: "source",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "时段",
|
||||
dataIndex: "timeSlot",
|
||||
sorter: true,
|
||||
},
|
||||
// {
|
||||
// title: '月',
|
||||
// dataIndex: 'monitorMonth',
|
||||
// sorter: true
|
||||
// },
|
||||
// {
|
||||
// title: '日',
|
||||
// dataIndex: 'monitorDay',
|
||||
// sorter: true
|
||||
// },
|
||||
// {
|
||||
// title: '时',
|
||||
// dataIndex: 'monitorHour',
|
||||
// sorter: true
|
||||
// },
|
||||
// {
|
||||
// title: '分',
|
||||
// dataIndex: 'monitorMinute',
|
||||
// sorter: true
|
||||
// },
|
||||
{
|
||||
title: "LeqdB(A)",
|
||||
dataIndex: "indexLeq",
|
||||
slots: {customRender: "Leq"},
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "SDdB(A)",
|
||||
dataIndex: "indexSd",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "L10dB(A)",
|
||||
dataIndex: "indexL10",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "L50dB(A)",
|
||||
dataIndex: "indexL50",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "L90dB(A)",
|
||||
dataIndex: "indexL90",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "LmindB(A)",
|
||||
dataIndex: "indexLmin",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "LmaxdB(A)",
|
||||
dataIndex: "indexLmax",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "监测站名",
|
||||
dataIndex: "station",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "监测仪器型号",
|
||||
dataIndex: "monitorInstrumentModel",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "监测仪器编号",
|
||||
dataIndex: "monitorInstrumentCode",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "监测前校准值",
|
||||
dataIndex: "beforeMonitorValue",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "声校准器测量声压值",
|
||||
dataIndex: "soundPressureValue",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "声校准仪器型号",
|
||||
dataIndex: "soundInstrumentModel",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "声校准仪器编号",
|
||||
dataIndex: "soundInstrumentCode",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "区域等级",
|
||||
dataIndex: "regionLevel",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "备注",
|
||||
dataIndex: "remark",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "创建人",
|
||||
dataIndex: "username",
|
||||
sorter: true,
|
||||
},
|
||||
],
|
||||
palceOptions: [],
|
||||
areaOptions: [],
|
||||
regionLevelOptions: [],
|
||||
// 表格搜索条件
|
||||
where: {
|
||||
checked: 1,
|
||||
},
|
||||
// 表格选中数据
|
||||
selectionList: [],
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.loadOptionData();
|
||||
},
|
||||
methods: {
|
||||
/**获取下来框数据 */
|
||||
loadOptionData() {
|
||||
getColumnOptions("place").then((res) => {
|
||||
this.palceOptions = res.data.data.map((item) => {
|
||||
return {
|
||||
label: item,
|
||||
value: item,
|
||||
};
|
||||
});
|
||||
});
|
||||
getColumnOptions("area").then((res) => {
|
||||
this.areaOptions = res.data.data.map((item) => {
|
||||
return {
|
||||
label: item,
|
||||
value: item,
|
||||
};
|
||||
});
|
||||
});
|
||||
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 = {
|
||||
checked: 1,
|
||||
};
|
||||
this.reload();
|
||||
},
|
||||
exportFile() {
|
||||
const columns = [
|
||||
{
|
||||
title: "行政区划代码",
|
||||
dataIndex: "regionCode",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "监测年度",
|
||||
dataIndex: "monitorYear",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "点位编码",
|
||||
dataIndex: "placeCode",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "测点名称",
|
||||
dataIndex: "place",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "测点经度",
|
||||
dataIndex: "placeLng",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "测点纬度",
|
||||
dataIndex: "placeLat",
|
||||
sorter: true,
|
||||
},
|
||||
|
||||
{
|
||||
title: "测点参照物",
|
||||
dataIndex: "refObj",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "网格边长",
|
||||
dataIndex: "gridLength",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "网格覆盖人口(万)",
|
||||
dataIndex: "people",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "功能区代码",
|
||||
dataIndex: "functionCode",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "月",
|
||||
dataIndex: "monitorMonth",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "日",
|
||||
dataIndex: "monitorDay",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "时",
|
||||
dataIndex: "monitorHour",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "分",
|
||||
dataIndex: "monitorMinute",
|
||||
sorter: true,
|
||||
},
|
||||
|
||||
{
|
||||
title: "Leq",
|
||||
dataIndex: "indexLeq",
|
||||
sorter: true,
|
||||
},
|
||||
|
||||
{
|
||||
title: "L10",
|
||||
dataIndex: "indexL10",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "L50",
|
||||
dataIndex: "indexL50",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "L90",
|
||||
dataIndex: "indexL90",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "最大值",
|
||||
dataIndex: "indexLmax",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "最小值",
|
||||
dataIndex: "indexLmin",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "标准差(SD)",
|
||||
dataIndex: "indexSd",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "监测站名",
|
||||
dataIndex: "station",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "监测仪器型号",
|
||||
dataIndex: "monitorInstrumentModel",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "监测仪器编号",
|
||||
dataIndex: "monitorInstrumentCode",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "监测前校准值",
|
||||
dataIndex: "beforeMonitorValue",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "声校准器测量声压值",
|
||||
dataIndex: "soundPressureValue",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "声校准仪器型号",
|
||||
dataIndex: "soundInstrumentModel",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "声校准仪器编号",
|
||||
dataIndex: "soundInstrumentCode",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "区域等级",
|
||||
dataIndex: "regionLevel",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "备注",
|
||||
dataIndex: "remark",
|
||||
sorter: true,
|
||||
},
|
||||
];
|
||||
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>
|
||||
@@ -2,20 +2,14 @@
|
||||
<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 key="inner" tab="城市内湖">
|
||||
<inner-lake></inner-lake>
|
||||
</a-tab-pane>
|
||||
<a-tab-pane key="source-statistic" tab="声源">
|
||||
<source-statistic></source-statistic>
|
||||
<a-tab-pane key="special" tab="专项湖库">
|
||||
<special-lake></special-lake>
|
||||
</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 key="special-avg" tab="专项湖库均值">
|
||||
<special-avg></special-avg>
|
||||
</a-tab-pane>
|
||||
</a-tabs>
|
||||
</a-card>
|
||||
@@ -23,30 +17,19 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
/**
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
import BaseStatistic from "./base.vue";
|
||||
// import QuarterStatistic from "./quarter.vue";
|
||||
// import Compare from "./compare.vue";
|
||||
import AverageStatistic from "./average.vue";
|
||||
import SourceStatistic from "./source.vue";
|
||||
import YearStatistic from "./year.vue";
|
||||
|
||||
import SpecialLake from "./special-lake.vue";
|
||||
import InnerLake from "./inner-lake.vue";
|
||||
import SpecialAvg from "./special-avg"
|
||||
export default {
|
||||
name: 'StatisticSoundZone',
|
||||
name: 'StatisticLake',
|
||||
components: {
|
||||
BaseStatistic,
|
||||
SourceStatistic,
|
||||
// Compare,
|
||||
AverageStatistic,
|
||||
YearStatistic
|
||||
SpecialLake,
|
||||
InnerLake,
|
||||
SpecialAvg
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
activeKey: 'base'
|
||||
activeKey: 'inner'
|
||||
};
|
||||
|
||||
},
|
||||
|
||||
158
src/views/water/lake/statistic/inner-lake.vue
Normal file
158
src/views/water/lake/statistic/inner-lake.vue
Normal file
@@ -0,0 +1,158 @@
|
||||
<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.place" allowClear showSearch>
|
||||
<a-select-option
|
||||
v-for="(item) in palceOptions"
|
||||
: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.area" allowClear showSearch>
|
||||
<a-select-option
|
||||
v-for="(item) in areaOptions"
|
||||
: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="lakeLibrarySpecialId"
|
||||
: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 {pageLakeUrl, getColumnOptions} from "@/api/ecology/lake";
|
||||
import locale from "ant-design-vue/es/date-picker/locale/zh_CN";
|
||||
// import moment from "moment";
|
||||
import {innerTableColumns} from "../collect/colums"
|
||||
// import utils from "./utils";
|
||||
export default {
|
||||
name: "StatisticInnerLakeBase",
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
data: [],
|
||||
locale,
|
||||
bill: {},
|
||||
// 表格数据接口
|
||||
url: pageLakeUrl,
|
||||
selection: [],
|
||||
// 表格列配置
|
||||
columns: innerTableColumns,
|
||||
palceOptions: [],
|
||||
areaOptions: [],
|
||||
regionLevelOptions: [],
|
||||
// 表格搜索条件
|
||||
where: {
|
||||
checked: 1,
|
||||
},
|
||||
// 表格选中数据
|
||||
selectionList: [],
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.loadOptionData();
|
||||
},
|
||||
methods: {
|
||||
/**获取下来框数据 */
|
||||
loadOptionData() {
|
||||
getColumnOptions("place").then((res) => {
|
||||
this.palceOptions = res.data.data.map((item) => {
|
||||
return {
|
||||
label: item,
|
||||
value: item,
|
||||
};
|
||||
});
|
||||
});
|
||||
getColumnOptions("area").then((res) => {
|
||||
this.areaOptions = res.data.data.map((item) => {
|
||||
return {
|
||||
label: item,
|
||||
value: item,
|
||||
};
|
||||
});
|
||||
});
|
||||
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 = {
|
||||
checked: 1,
|
||||
};
|
||||
this.reload();
|
||||
},
|
||||
exportFile() {
|
||||
const columns = this.columns;
|
||||
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,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>
|
||||
201
src/views/water/lake/statistic/special-avg.vue
Normal file
201
src/views/water/lake/statistic/special-avg.vue
Normal file
@@ -0,0 +1,201 @@
|
||||
<template>
|
||||
<div class="ele-body">
|
||||
<a-card :bordered="false">
|
||||
<!-- 搜索表单 -->
|
||||
<a-form :model="where" layout="inline">
|
||||
<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 00:00:00" 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 {avgUrl, getColumnOptions} from "@/api/ecology/special-lake";
|
||||
// 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: avgUrl,
|
||||
selection: [],
|
||||
modelOptions: [
|
||||
{label: "市", value: "city"},
|
||||
{label: "县", value: "county"},
|
||||
{label: "站点", value: "place"},
|
||||
|
||||
],
|
||||
// 表格列配置
|
||||
columns: [
|
||||
{title: "测站名称", dataIndex: "stationName", sorter: true,},
|
||||
{title: "测站代码", dataIndex: "stationCode", sorter: true,},
|
||||
{title: "湖库名称", dataIndex: "lakeLibraryName", sorter: true,},
|
||||
{title: "湖库代码", dataIndex: "lakeLibraryCode", sorter: true,},
|
||||
{title: "断面名称", dataIndex: "sectionName", sorter: true,},
|
||||
{title: "断面代码", dataIndex: "sectionCode", sorter: true,},
|
||||
{title: "控制属性", dataIndex: "controlAttributes", sorter: true,},
|
||||
{title: "所属流域", dataIndex: "watershed", sorter: true,},
|
||||
{title: "水期代码", dataIndex: "waterPeriodCode", sorter: true,},
|
||||
|
||||
{title: "浊度(NTU)", dataIndex: "turbidity", sorter: true,},
|
||||
{title: "水温(℃)", dataIndex: "wTemp", sorter: true,},
|
||||
{title: "水位(m)", dataIndex: "wd", sorter: true,},
|
||||
{title: "pH值", dataIndex: "ph", sorter: true,},
|
||||
{title: "电导率(ms/m)", dataIndex: "wCond", sorter: true,},
|
||||
{title: "透明度(cm)", dataIndex: "transp", sorter: true,},
|
||||
{title: "溶解氧 (mg/L)", dataIndex: "dissolvedOxygen", sorter: true,},
|
||||
{title: "高锰酸盐指数 (mg/L)", dataIndex: "codmn", sorter: true,},
|
||||
{title: "氨氮 (mg/L)", dataIndex: "nh4N", sorter: true,},
|
||||
{title: "石油类 (mg/L)", dataIndex: "oils", sorter: true,},
|
||||
{title: "总氮 (mg/L)", dataIndex: "nTotal", sorter: true,},
|
||||
{title: "总磷 (mg/L)", dataIndex: "pTotal", sorter: true,},
|
||||
{title: "叶绿素 (mg/L)", dataIndex: "chlA", sorter: true,},
|
||||
{title: "挥发酚 (mg/L)", dataIndex: "vPhen", sorter: true,},
|
||||
{title: "汞 (mg/L)", dataIndex: "wHg", sorter: true,},
|
||||
{title: "铅 (mg/L)", dataIndex: "wPb", sorter: true,},
|
||||
{title: "化学需氧量 (mg/L)", dataIndex: "codcr", sorter: true,},
|
||||
{title: "铜 (mg/L)", dataIndex: "wCu", sorter: true,},
|
||||
{title: "锌 (mg/L)", dataIndex: "wZn", sorter: true,},
|
||||
{title: "氟化物 (mg/L)", dataIndex: "f", sorter: true,},
|
||||
{title: "硒 (mg/L)", dataIndex: "se", sorter: true,},
|
||||
{title: "砷 (mg/L)", dataIndex: "as", sorter: true,},
|
||||
{title: "镉 (mg/L)", dataIndex: "cd", sorter: true,},
|
||||
{title: "六价铬 (mg/L)", dataIndex: "cr6", sorter: true,},
|
||||
{title: "氰化物 (mg/L)", dataIndex: "cnTotal", sorter: true,},
|
||||
{title: "阴离子表面活性剂 (mg/L)", dataIndex: "anSaa", sorter: true,},
|
||||
{title: "硫化物 (mg/L)", dataIndex: "s", sorter: true,},
|
||||
{title: "粪大肠菌群 (mg/L)", dataIndex: "coloOrg", sorter: true,},
|
||||
{title: "硫酸盐 (mg/L)", dataIndex: "so4", sorter: true,},
|
||||
{title: "氯化物 (mg/L)", dataIndex: "cl", sorter: true,},
|
||||
{title: "硝酸盐 (mg/L)", dataIndex: "no3N", sorter: true,},
|
||||
{title: "铁 (mg/L)", dataIndex: "wFe", sorter: true,},
|
||||
{title: "锰 (mg/L)", dataIndex: "wMn", sorter: true,},
|
||||
{title: "水质类别", dataIndex: "waterQualityCategory", sorter: true,},
|
||||
],
|
||||
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();
|
||||
},
|
||||
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>
|
||||
333
src/views/water/lake/statistic/special-lake.vue
Normal file
333
src/views/water/lake/statistic/special-lake.vue
Normal file
@@ -0,0 +1,333 @@
|
||||
<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.place" allowClear showSearch>
|
||||
<a-select-option
|
||||
v-for="(item) in palceOptions"
|
||||
: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.area" allowClear showSearch>
|
||||
<a-select-option
|
||||
v-for="(item) in areaOptions"
|
||||
: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="zoneNoiseId"
|
||||
:datasource="url"
|
||||
:columns="columns"
|
||||
:where="where"
|
||||
:scroll="{ x: 'max-content' }"
|
||||
@done="(d) => (data = d.data)"
|
||||
>
|
||||
<template #Leq="{ text,record }">
|
||||
<a-tag v-if="(record.timeSlot == '昼' && text <= 68) || (record.timeSlot == '夜' && text <= 58)"
|
||||
color="green">{{ text }}
|
||||
</a-tag>
|
||||
<a-tag
|
||||
v-else-if="(record.timeSlot == '昼' && text > 68 && text <=70) || (record.timeSlot == '夜' && text > 58 && text <=60)"
|
||||
color="blue">{{ text }}
|
||||
</a-tag>
|
||||
<a-tag
|
||||
v-else-if="(record.timeSlot == '昼' && text > 70 && text <=72) || (record.timeSlot == '夜' && text > 60 && text <=62)"
|
||||
color="red">{{ text }}
|
||||
</a-tag>
|
||||
<a-tag
|
||||
v-else-if="(record.timeSlot == '昼' && text > 62 && text <=74) || (record.timeSlot == '夜' && text > 62 && text <=64)"
|
||||
color="red">{{ text }}
|
||||
</a-tag>
|
||||
<a-tag v-else-if="(record.timeSlot == '昼' && text > 74 ) || (record.timeSlot == '夜' && text > 64)"
|
||||
color="red">{{ text }}
|
||||
</a-tag>
|
||||
<template v-else color="#FFF">{{ text }}</template>
|
||||
</template>
|
||||
</ele-pro-table>
|
||||
</a-card>
|
||||
</div>
|
||||
<!-- 编辑弹窗 -->
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// import _ from "lodash";
|
||||
import XLSX from "xlsx";
|
||||
import {pageLakeUrl, getColumnOptions} from "@/api/ecology/special-lake";
|
||||
import locale from "ant-design-vue/es/date-picker/locale/zh_CN";
|
||||
// import moment from "moment";
|
||||
import {specialTableColumns} from "../collect/colums"
|
||||
// import utils from "./utils";
|
||||
export default {
|
||||
name: "StatisticSoundZoneBase",
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
data: [],
|
||||
locale,
|
||||
bill: {},
|
||||
// 表格数据接口
|
||||
url: pageLakeUrl,
|
||||
selection: [],
|
||||
// 表格列配置
|
||||
columns: specialTableColumns,
|
||||
palceOptions: [],
|
||||
areaOptions: [],
|
||||
regionLevelOptions: [],
|
||||
// 表格搜索条件
|
||||
where: {
|
||||
checked: 1,
|
||||
},
|
||||
// 表格选中数据
|
||||
selectionList: [],
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.loadOptionData();
|
||||
},
|
||||
methods: {
|
||||
/**获取下来框数据 */
|
||||
loadOptionData() {
|
||||
getColumnOptions("place").then((res) => {
|
||||
this.palceOptions = res.data.data.map((item) => {
|
||||
return {
|
||||
label: item,
|
||||
value: item,
|
||||
};
|
||||
});
|
||||
});
|
||||
getColumnOptions("area").then((res) => {
|
||||
this.areaOptions = res.data.data.map((item) => {
|
||||
return {
|
||||
label: item,
|
||||
value: item,
|
||||
};
|
||||
});
|
||||
});
|
||||
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 = {
|
||||
checked: 1,
|
||||
};
|
||||
this.reload();
|
||||
},
|
||||
exportFile() {
|
||||
const columns = [
|
||||
{
|
||||
title: "行政区划代码",
|
||||
dataIndex: "regionCode",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "监测年度",
|
||||
dataIndex: "monitorYear",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "点位编码",
|
||||
dataIndex: "placeCode",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "测点名称",
|
||||
dataIndex: "place",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "测点经度",
|
||||
dataIndex: "placeLng",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "测点纬度",
|
||||
dataIndex: "placeLat",
|
||||
sorter: true,
|
||||
},
|
||||
|
||||
{
|
||||
title: "测点参照物",
|
||||
dataIndex: "refObj",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "网格边长",
|
||||
dataIndex: "gridLength",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "网格覆盖人口(万)",
|
||||
dataIndex: "people",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "功能区代码",
|
||||
dataIndex: "functionCode",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "月",
|
||||
dataIndex: "monitorMonth",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "日",
|
||||
dataIndex: "monitorDay",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "时",
|
||||
dataIndex: "monitorHour",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "分",
|
||||
dataIndex: "monitorMinute",
|
||||
sorter: true,
|
||||
},
|
||||
|
||||
{
|
||||
title: "Leq",
|
||||
dataIndex: "indexLeq",
|
||||
sorter: true,
|
||||
},
|
||||
|
||||
{
|
||||
title: "L10",
|
||||
dataIndex: "indexL10",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "L50",
|
||||
dataIndex: "indexL50",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "L90",
|
||||
dataIndex: "indexL90",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "最大值",
|
||||
dataIndex: "indexLmax",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "最小值",
|
||||
dataIndex: "indexLmin",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "标准差(SD)",
|
||||
dataIndex: "indexSd",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "监测站名",
|
||||
dataIndex: "station",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "监测仪器型号",
|
||||
dataIndex: "monitorInstrumentModel",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "监测仪器编号",
|
||||
dataIndex: "monitorInstrumentCode",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "监测前校准值",
|
||||
dataIndex: "beforeMonitorValue",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "声校准器测量声压值",
|
||||
dataIndex: "soundPressureValue",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "声校准仪器型号",
|
||||
dataIndex: "soundInstrumentModel",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "声校准仪器编号",
|
||||
dataIndex: "soundInstrumentCode",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "区域等级",
|
||||
dataIndex: "regionLevel",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "备注",
|
||||
dataIndex: "remark",
|
||||
sorter: true,
|
||||
},
|
||||
];
|
||||
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