字典、统计
This commit is contained in:
@@ -1,242 +1,244 @@
|
||||
<template>
|
||||
<div class="ele-body">
|
||||
<a-card style="width: 100%" :bordered="false">
|
||||
<template #title>
|
||||
<a-space>
|
||||
<a-upload
|
||||
:before-upload="importFileCity"
|
||||
:showUploadList="false"
|
||||
accept=".xls,.xlsx,.csv"
|
||||
>
|
||||
<a-button>市级导入</a-button>
|
||||
</a-upload>
|
||||
<!-- <a-upload
|
||||
:before-upload="importFileArea"
|
||||
:showUploadList="false"
|
||||
accept=".xls,.xlsx,.csv"
|
||||
>
|
||||
<a-button>县级导入</a-button>
|
||||
</a-upload> -->
|
||||
</a-space>
|
||||
</template>
|
||||
<a-tabs v-model:activeKey="activeKey">
|
||||
<a-tab-pane tab="噪声信息" key="noise">
|
||||
<noise-bill ref="noise"></noise-bill>
|
||||
</a-tab-pane>
|
||||
</a-tabs>
|
||||
</a-card>
|
||||
</div>
|
||||
<div class="ele-body">
|
||||
<a-card style="width: 100%" :bordered="false">
|
||||
<template #title>
|
||||
<a-space>
|
||||
<a-upload
|
||||
:before-upload="importFileCity"
|
||||
:showUploadList="false"
|
||||
accept=".xls,.xlsx,.csv"
|
||||
>
|
||||
<a-button>市级导入</a-button>
|
||||
</a-upload>
|
||||
<a-upload
|
||||
:before-upload="importFileArea"
|
||||
:showUploadList="false"
|
||||
accept=".xls,.xlsx,.csv"
|
||||
>
|
||||
<a-button>县级导入</a-button>
|
||||
</a-upload>
|
||||
</a-space>
|
||||
</template>
|
||||
<a-tabs v-model:activeKey="activeKey">
|
||||
<a-tab-pane tab="噪声信息" key="noise">
|
||||
<noise-bill ref="noise"></noise-bill>
|
||||
</a-tab-pane>
|
||||
</a-tabs>
|
||||
</a-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import XLSX from "xlsx";
|
||||
import utils from "./utils";
|
||||
import { Modal } from "ant-design-vue";
|
||||
import {Modal} from "ant-design-vue";
|
||||
import NoiseBill from "./noise-bill.vue";
|
||||
import { saveZoneNoiseBill } from "@/api/ecology/noise/zone-sound";
|
||||
import {saveZoneNoiseBill} from "@/api/ecology/noise/zone-sound";
|
||||
|
||||
export default {
|
||||
name: "ZoneCollectIndex",
|
||||
components: {
|
||||
NoiseBill,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
activeKey: "noise",
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
/* 导入本地excel文件 */
|
||||
importFileCity(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",
|
||||
});
|
||||
//0.昼间数据 1.夜间数据 2.其他信息
|
||||
let sheetNames = workbook.SheetNames;
|
||||
// 解析成二维数组
|
||||
let aoa = XLSX.utils.sheet_to_json(workbook.Sheets[sheetNames[0]], {
|
||||
header: 1,
|
||||
});
|
||||
let aoa2 = XLSX.utils.sheet_to_json(workbook.Sheets[sheetNames[1]], {
|
||||
header: 1,
|
||||
});
|
||||
|
||||
const reportDate = aoa[1][0].replace(/[^\d]+/g, "-");
|
||||
const reportDate2 = aoa2[1][0].replace(/[^\d]+/g, "-");
|
||||
|
||||
const zoneNoiseList = aoa.filter(
|
||||
(item) => {
|
||||
return item.length >= 26 && typeof item[0] == "number"}
|
||||
);
|
||||
const zoneNoiseList2 = aoa2.filter(
|
||||
(item) => item.length >= 26 && typeof item[0] == "number"
|
||||
);
|
||||
|
||||
|
||||
// 解析成对象数组
|
||||
const billName = aoa[0][0];
|
||||
const billData = utils.toObjData(zoneNoiseList);
|
||||
const billName2 = aoa2[0][0];
|
||||
const billData2 = utils.toObjData(zoneNoiseList2);
|
||||
if (
|
||||
(!billData || billData.length == 0) &&
|
||||
(!billData2 || billData2.length == 0)
|
||||
) {
|
||||
hide()
|
||||
Modal.error({
|
||||
title: "导入失败",
|
||||
content: "找不到数据",
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
const tasks = [];
|
||||
if (billData.length > 0) {
|
||||
tasks.push(
|
||||
saveZoneNoiseBill({
|
||||
reportTime: new Date(reportDate).getTime(),
|
||||
billName: billName,
|
||||
regionLevel: "市级",
|
||||
zoneNoiseList: billData,
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
if (billData2.length > 0) {
|
||||
tasks.push(
|
||||
saveZoneNoiseBill({
|
||||
reportTime: new Date(reportDate2).getTime(),
|
||||
billName: billName2,
|
||||
regionLevel: "市级",
|
||||
zoneNoiseList: billData2,
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
// 上传到服务器
|
||||
|
||||
Promise.all(tasks)
|
||||
.then(() => {
|
||||
Modal.success({
|
||||
title: "导入成功",
|
||||
content: `成功导入${billData.length + billData2.length}条数据`,
|
||||
});
|
||||
this.$refs.noise && this.$refs.noise.reload();
|
||||
})
|
||||
.catch(() => {
|
||||
Modal.error({
|
||||
title: "导入失败",
|
||||
content: "数据上传出错",
|
||||
});
|
||||
})
|
||||
.finally(() => {
|
||||
hide();
|
||||
});
|
||||
} catch (error) {
|
||||
hide();
|
||||
Modal.error({
|
||||
title: "导入失败",
|
||||
content: error.message,
|
||||
});
|
||||
}
|
||||
// console.log(billData);
|
||||
};
|
||||
reader.readAsArrayBuffer(file);
|
||||
|
||||
return false;
|
||||
name: "ZoneCollectIndex",
|
||||
components: {
|
||||
NoiseBill,
|
||||
},
|
||||
importFileArea(file) {
|
||||
const hide = this.$message.loading("导入中..", 0);
|
||||
data() {
|
||||
return {
|
||||
activeKey: "noise",
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
/* 导入本地excel文件 */
|
||||
importFileCity(file) {
|
||||
const hide = this.$message.loading("导入中..", 0);
|
||||
|
||||
let reader = new FileReader();
|
||||
let reader = new FileReader();
|
||||
reader.onload = (e) => {
|
||||
try {
|
||||
let data = new Uint8Array(e.target.result);
|
||||
let workbook = XLSX.read(data, {
|
||||
type: "array",
|
||||
});
|
||||
//0.昼间数据 1.夜间数据 2.其他信息
|
||||
let sheetNames = workbook.SheetNames;
|
||||
// 解析成二维数组
|
||||
let aoa = XLSX.utils.sheet_to_json(workbook.Sheets[sheetNames[0]], {
|
||||
header: 1,
|
||||
});
|
||||
let aoa2 = XLSX.utils.sheet_to_json(workbook.Sheets[sheetNames[1]], {
|
||||
header: 1,
|
||||
});
|
||||
|
||||
reader.onload = (e) => {
|
||||
try {
|
||||
let data = new Uint8Array(e.target.result);
|
||||
let workbook = XLSX.read(data, {
|
||||
type: "array",
|
||||
});
|
||||
//0.昼间数据 1.夜间数据 2.其他信息
|
||||
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 reportDate2 = aoa2[1][0].replace(/[^\d]+/g, "-");
|
||||
|
||||
const reportDate = aoa[1][0].replace(/[^\d]+/g, "-");
|
||||
const zoneNoiseList = aoa.filter(
|
||||
(item) => {
|
||||
const zoneNoiseList = aoa.filter(
|
||||
(item) => {
|
||||
return item.length >= 26 && typeof item[0] == "number"
|
||||
}
|
||||
);
|
||||
const zoneNoiseList2 = aoa2.filter(
|
||||
(item) => item.length >= 26 && typeof item[0] == "number"
|
||||
);
|
||||
|
||||
return item.length >= 35 && item[0] != "行政区划代码"
|
||||
}
|
||||
);
|
||||
|
||||
// 解析成对象数组
|
||||
const billName = aoa[0][0];
|
||||
const billData = utils.toAreaObjData(zoneNoiseList);
|
||||
// 解析成对象数组
|
||||
const billName = file.name;
|
||||
const billData = utils.toObjData(zoneNoiseList);
|
||||
const billName2 = file.name;
|
||||
const billData2 = utils.toObjData(zoneNoiseList2);
|
||||
if (
|
||||
(!billData || billData.length == 0) &&
|
||||
(!billData2 || billData2.length == 0)
|
||||
) {
|
||||
hide()
|
||||
Modal.error({
|
||||
title: "导入失败",
|
||||
content: "找不到数据",
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
if (!billData || billData.length == 0) {
|
||||
hide();
|
||||
Modal.error({
|
||||
title: "导入失败",
|
||||
content: "找不到可用数据",
|
||||
});
|
||||
const tasks = [];
|
||||
if (billData.length > 0) {
|
||||
tasks.push(
|
||||
saveZoneNoiseBill({
|
||||
reportTime: new Date(reportDate).getTime(),
|
||||
billName: billName,
|
||||
regionLevel: "市级",
|
||||
zoneNoiseList: billData,
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
if (billData2.length > 0) {
|
||||
tasks.push(
|
||||
saveZoneNoiseBill({
|
||||
reportTime: new Date(reportDate2).getTime(),
|
||||
billName: billName2,
|
||||
regionLevel: "市级",
|
||||
zoneNoiseList: billData2,
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
if (billData.length > 0) {
|
||||
// 上传到服务器
|
||||
saveZoneNoiseBill({
|
||||
reportTime: new Date(reportDate).getTime(),
|
||||
billName: billName,
|
||||
regionLevel: "县级",
|
||||
zoneNoiseList: billData,
|
||||
})
|
||||
.then((res) => {
|
||||
if (res.data.code == 0) {
|
||||
Modal.success({
|
||||
title: "导入成功",
|
||||
content: `成功导入${
|
||||
billData.length
|
||||
}条数据`,
|
||||
});
|
||||
this.$refs.noise && this.$refs.noise.reload();
|
||||
} else {
|
||||
Modal.error({
|
||||
title: "导入失败",
|
||||
content: "数据上传出错",
|
||||
});
|
||||
// 上传到服务器
|
||||
|
||||
Promise.all(tasks)
|
||||
.then(() => {
|
||||
Modal.success({
|
||||
title: "导入成功",
|
||||
content: `成功导入${billData.length + billData2.length}条数据`,
|
||||
});
|
||||
this.$refs.noise && this.$refs.noise.reload();
|
||||
})
|
||||
.catch(() => {
|
||||
Modal.error({
|
||||
title: "导入失败",
|
||||
content: "数据上传出错",
|
||||
});
|
||||
})
|
||||
.finally(() => {
|
||||
hide();
|
||||
});
|
||||
} catch (error) {
|
||||
hide();
|
||||
Modal.error({
|
||||
title: "导入失败",
|
||||
content: error.message,
|
||||
});
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
Modal.error({
|
||||
title: "导入失败",
|
||||
content: "数据上传出错",
|
||||
});
|
||||
})
|
||||
.finally(() => {
|
||||
hide();
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
hide();
|
||||
Modal.error({
|
||||
title: "导入失败",
|
||||
content: error.message,
|
||||
});
|
||||
}
|
||||
// console.log(billData);
|
||||
};
|
||||
reader.readAsArrayBuffer(file);
|
||||
return false;
|
||||
// console.log(billData);
|
||||
};
|
||||
reader.readAsArrayBuffer(file);
|
||||
|
||||
return false;
|
||||
},
|
||||
importFileArea(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",
|
||||
});
|
||||
//0.昼间数据 1.夜间数据 2.其他信息
|
||||
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 zoneNoiseList = aoa.filter(
|
||||
(item) => {
|
||||
|
||||
return item.length >= 28 && item[0] && !item[0].toString().includes("行政区划代码")
|
||||
}
|
||||
);
|
||||
|
||||
// 解析成对象数组
|
||||
const billName = file.name;
|
||||
const billData = utils.toAreaObjData(zoneNoiseList);
|
||||
|
||||
if (!billData || billData.length == 0) {
|
||||
hide();
|
||||
Modal.error({
|
||||
title: "导入失败",
|
||||
content: "找不到可用数据",
|
||||
});
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (billData.length > 0) {
|
||||
// 上传到服务器
|
||||
saveZoneNoiseBill({
|
||||
reportTime: new Date(reportDate).getTime(),
|
||||
billName: billName,
|
||||
regionLevel: "县级",
|
||||
zoneNoiseList: billData,
|
||||
})
|
||||
.then((res) => {
|
||||
if (res.data.code == 0) {
|
||||
Modal.success({
|
||||
title: "导入成功",
|
||||
content: `成功导入${
|
||||
billData.length
|
||||
}条数据`,
|
||||
});
|
||||
this.$refs.noise && this.$refs.noise.reload();
|
||||
} 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;
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -60,6 +60,7 @@ export default {
|
||||
if (row.indexL10 < row.indexL50 || row.indexL50 < row.indexL90) {
|
||||
throw new Error(row.place + "数值有误")
|
||||
}
|
||||
// console.log(monitorTime)
|
||||
return row;
|
||||
})
|
||||
|
||||
@@ -93,12 +94,12 @@ export default {
|
||||
return excelData.map(item => {
|
||||
const monitorTime = new Date();
|
||||
monitorTime.setFullYear(item[1]);
|
||||
monitorTime.setMonth(item[14] - 1);
|
||||
monitorTime.setDate(item[15]);
|
||||
monitorTime.setHours(item[16]);
|
||||
monitorTime.setMinutes(item[17]);
|
||||
monitorTime.setMonth(item[10] - 1);
|
||||
monitorTime.setDate(item[11]);
|
||||
monitorTime.setHours(item[12]);
|
||||
monitorTime.setMinutes(item[13]);
|
||||
let quarter = 1;
|
||||
const month = item[14]
|
||||
const month = item[10]
|
||||
if (month < 4) {
|
||||
quarter = 1
|
||||
} else if (month < 7) {
|
||||
@@ -108,55 +109,49 @@ export default {
|
||||
} else {
|
||||
quarter = 4
|
||||
}
|
||||
let timeSlot = "夜";
|
||||
if (item[16] >= 6 && item[16] <= 22) {
|
||||
timeSlot = "昼"
|
||||
}
|
||||
const row = {
|
||||
const row = {
|
||||
regionCode: item[0],
|
||||
regionLevel: "县级",
|
||||
monitorYear: item[1],
|
||||
placeCode: item[2],
|
||||
place: item[3],
|
||||
placeLng: item[4],
|
||||
placeLat: item[5],
|
||||
road: item[6],
|
||||
roadLength: item[7],
|
||||
roadWidth: item[8],
|
||||
motorway: item[9],
|
||||
motorwayType: item[10],
|
||||
motorwayLevel: item[11],
|
||||
refObj: item[12],
|
||||
people: item[13],
|
||||
monitorMonth: item[14],
|
||||
monitorDay: item[15],
|
||||
monitorHour: item[16],
|
||||
monitorMinute: item[17],
|
||||
smallTrafficFlow: item[18],
|
||||
largeTrafficFlow: item[19],
|
||||
indexLeq: item[20],
|
||||
indexL10: item[21],
|
||||
indexL50: item[22],
|
||||
indexL90: item[23],
|
||||
indexLmax: item[24],
|
||||
indexLmin: item[25],
|
||||
indexSd: item[26],
|
||||
station: item[27],
|
||||
monitorInstrumentModel: item[28],
|
||||
monitorInstrumentCode: item[29],
|
||||
beforeMonitorValue: item[30],
|
||||
afterMonitorValue: item[31],
|
||||
soundPressureValue: item[32],
|
||||
soundInstrumentModel: item[33],
|
||||
soundInstrumentCode: item[34],
|
||||
remark: item[35],
|
||||
reqObj: item[6],
|
||||
gridLength: item[7],
|
||||
people: item[8],
|
||||
functionCode: item[9],
|
||||
monitorMonth: item[10],
|
||||
monitorDay: item[11],
|
||||
monitorHour: item[12],
|
||||
monitorMinute: item[13],
|
||||
sourceCode: item[14],
|
||||
indexLeq: item[15],
|
||||
indexL10: item[16],
|
||||
indexL50: item[17],
|
||||
indexL90: item[18],
|
||||
indexLmax: item[19],
|
||||
indexLmin: item[20],
|
||||
indexSd: item[21],
|
||||
station: item[22],
|
||||
monitorInstrumentModel: item[23],
|
||||
monitorInstrumentCode: item[24],
|
||||
beforeMonitorValue: item[25],
|
||||
afterMonitorValue: item[26],
|
||||
soundPressureValue: item[27],
|
||||
soundInstrumentModel: item[28],
|
||||
soundInstrumentCode: item[29],
|
||||
city: '南宁',
|
||||
timeSlot,
|
||||
regionLevel: "县级",
|
||||
monitorTime: monitorTime.getTime(),
|
||||
quarter
|
||||
|
||||
}
|
||||
if(row.indexL10 < row.indexL50 || row.indexL50 < row.indexL90){
|
||||
|
||||
if (row.monitorHour >= 6 && row.monitorHour < 22) {
|
||||
row.timeSlot = "昼"
|
||||
}else{
|
||||
row.timeSlot = "夜"
|
||||
}
|
||||
if (row.indexL10 < row.indexL50 || row.indexL50 < row.indexL90) {
|
||||
throw new Error(row.place + "数值有误")
|
||||
}
|
||||
return row;
|
||||
|
||||
@@ -113,11 +113,11 @@ import {
|
||||
updateLeqLevel,
|
||||
removeLeqLevel,
|
||||
removeBatchLeqLevel
|
||||
} from "@/api/ecology/noise/road-noise-leq-level";
|
||||
} from "@/api/ecology/noise/zone-noise-leq-level";
|
||||
import { message } from 'ant-design-vue';
|
||||
// import moment from "moment";
|
||||
export default {
|
||||
name: "RoadNoiseLeqLevel",
|
||||
name: "ZoneNoiseLeqLevel",
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<a-card :bordered="false">
|
||||
<a-modal
|
||||
v-model:visible="showEdit"
|
||||
:title="form.roadNoisePlaceId !== undefined ? '修改' : '添加'"
|
||||
:title="form.zoneNoisePlaceId !== undefined ? '修改' : '添加'"
|
||||
:confirm-loading="loading"
|
||||
:width="800"
|
||||
:body-style="{ paddingBottom: '8px' }"
|
||||
@@ -19,27 +19,22 @@
|
||||
<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="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="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>
|
||||
@@ -70,7 +65,7 @@
|
||||
<ele-pro-table
|
||||
v-model:selection="selectionList"
|
||||
ref="table"
|
||||
row-key="roadNoisePlaceId"
|
||||
row-key="zoneNoisePlaceId"
|
||||
:datasource="url"
|
||||
:columns="columns"
|
||||
:where="where"
|
||||
@@ -131,10 +126,10 @@ import {
|
||||
updatePlace,
|
||||
removePlace,
|
||||
removeBatchPlace
|
||||
} from "@/api/ecology/noise/road-noise-place";
|
||||
} from "@/api/ecology/noise/zone-noise-place";
|
||||
// import moment from "moment";
|
||||
export default {
|
||||
name: "RoadNoisePlace",
|
||||
name: "ZoneNoisePlace",
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
@@ -148,6 +143,10 @@ export default {
|
||||
title: "测点名称",
|
||||
dataIndex: "placeName",
|
||||
sorter: true,
|
||||
}, {
|
||||
title: "点位编码",
|
||||
dataIndex: "placeCode",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "测点经度",
|
||||
@@ -159,31 +158,12 @@ export default {
|
||||
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",
|
||||
@@ -241,7 +221,8 @@ export default {
|
||||
form: {},
|
||||
loading: false,
|
||||
rules: {
|
||||
placeName:[{required: true,message: '请选择测点名称'}],
|
||||
placeName:[{required: true,message: '请输入测点名称'}],
|
||||
placeCode:[{required: true,message: '请输入点位编码'}],
|
||||
placeLng: [{required: true,message: '请输入测点经度',},],
|
||||
placeLat: [{required: true,message: '请输入测点纬度',},],
|
||||
},
|
||||
@@ -275,7 +256,7 @@ export default {
|
||||
await this.$refs.form.validate();
|
||||
const hide = this.$message.loading('请求中..', 0);
|
||||
const form = this.form;
|
||||
if (form.roadNoisePlaceId) {
|
||||
if (form.zoneNoisePlaceId) {
|
||||
updatePlace(form)
|
||||
.then((res) => {
|
||||
if (res.data.code == 0) {
|
||||
@@ -314,7 +295,7 @@ export default {
|
||||
/* 删除单个 */
|
||||
remove(row) {
|
||||
const hide = this.$message.loading('请求中..', 0);
|
||||
removePlace(row.roadNoisePlaceId).then((res) => {
|
||||
removePlace(row.zoneNoisePlaceId).then((res) => {
|
||||
hide();
|
||||
if (res.data.code === 0) {
|
||||
this.$message.success(res.data.msg);
|
||||
@@ -330,7 +311,7 @@ export default {
|
||||
/* 批量删除 */
|
||||
removeBatch() {
|
||||
const hide = this.$message.loading('请求中..', 0);
|
||||
const ids = this.selectionList.map((item) => item.roadNoisePlaceId);
|
||||
const ids = this.selectionList.map((item) => item.zoneNoisePlaceId);
|
||||
removeBatchPlace(ids).then((res) => {
|
||||
if (res.data.code === 0) {
|
||||
this.$message.success(res.data.msg);
|
||||
|
||||
@@ -1,211 +1,214 @@
|
||||
<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>
|
||||
<!-- 编辑弹窗 -->
|
||||
<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 {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();
|
||||
});
|
||||
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: [],
|
||||
};
|
||||
},
|
||||
/* 刷新表格 */
|
||||
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,
|
||||
});
|
||||
mounted() {
|
||||
this.loadOptionData();
|
||||
},
|
||||
/* 重置搜索 */
|
||||
reset() {
|
||||
this.reload();
|
||||
},
|
||||
exportFile() {
|
||||
const columns = [
|
||||
{
|
||||
title: "噪声源分类",
|
||||
dataIndex: "source",
|
||||
},
|
||||
{
|
||||
title: "测点数(个)",
|
||||
dataIndex: "count",
|
||||
},
|
||||
{
|
||||
title: "声源占比(%)",
|
||||
dataIndex: "rate",
|
||||
},
|
||||
{
|
||||
title: "时段",
|
||||
dataIndex: "timeSlot",
|
||||
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",
|
||||
customRender: ({text})=>{return Number(text).toFixed(1)}
|
||||
|
||||
{
|
||||
title: "Leq",
|
||||
dataIndex: "leq",
|
||||
})
|
||||
}
|
||||
|
||||
})
|
||||
this.columns = columns;
|
||||
|
||||
this.$refs.table.reload({
|
||||
where: this.where,
|
||||
});
|
||||
},
|
||||
{
|
||||
title: "L10",
|
||||
dataIndex: "l10",
|
||||
/* 重置搜索 */
|
||||
reset() {
|
||||
this.reload();
|
||||
},
|
||||
{
|
||||
title: "L50",
|
||||
dataIndex: "l50",
|
||||
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());
|
||||
},
|
||||
{
|
||||
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>
|
||||
|
||||
|
||||
@@ -1,474 +1,530 @@
|
||||
<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>
|
||||
<!-- 编辑弹窗 -->
|
||||
<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.monitorYear" allowClear showSearch>
|
||||
<a-select-option
|
||||
v-for="(item) in yearOptions"
|
||||
:key="item.value"
|
||||
>{{ item.label }}
|
||||
</a-select-option
|
||||
>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6" :md="12" :sm="24" :xs="24">
|
||||
<a-form-item label="季度:">
|
||||
<a-select v-model:value="where.quarter" allowClear showSearch>
|
||||
<a-select-option
|
||||
v-for="(item) in quarterOptions"
|
||||
: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 {pageZoneNoiseUrl, getColumnOptions,listALlZoneNoise} 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,
|
||||
};
|
||||
});
|
||||
});
|
||||
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: [],
|
||||
yearOptions:[],
|
||||
quarterOptions:[],
|
||||
areaOptions: [],
|
||||
regionLevelOptions: [],
|
||||
// 表格搜索条件
|
||||
where: {
|
||||
checked: 1,
|
||||
},
|
||||
// 表格选中数据
|
||||
selectionList: [],
|
||||
};
|
||||
},
|
||||
/* 刷新表格 */
|
||||
reload() {
|
||||
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,
|
||||
};
|
||||
});
|
||||
});
|
||||
getColumnOptions("monitor_year").then((res) => {
|
||||
this.yearOptions = res.data.data.map((item) => {
|
||||
return {
|
||||
label: item,
|
||||
value: item,
|
||||
};
|
||||
});
|
||||
});
|
||||
getColumnOptions("quarter").then((res) => {
|
||||
this.quarterOptions = res.data.data.map((item) => {
|
||||
return {
|
||||
label: item,
|
||||
value: item,
|
||||
};
|
||||
});
|
||||
});
|
||||
},
|
||||
/* 刷新表格 */
|
||||
reload() {
|
||||
|
||||
this.$refs.table.reload({
|
||||
where: this.where,
|
||||
});
|
||||
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);
|
||||
listALlZoneNoise(this.where).then(res=>{
|
||||
res.data.data.forEach((d) => {
|
||||
const td = columns.map((item) => {
|
||||
let val = d[item.dataIndex];
|
||||
if(["indexLeq","indexL10","indexL50","indexL90","indexLmax","indexLmin","indexSd"].includes(item.dataIndex)){
|
||||
val = Number(val).toFixed(1);
|
||||
}
|
||||
return val;
|
||||
});
|
||||
|
||||
arr.push(td);
|
||||
});
|
||||
let sheet = XLSX.utils.aoa_to_sheet(arr);
|
||||
this.$util.exportSheet(XLSX, sheet, new Date().getTime().toString());
|
||||
})
|
||||
|
||||
|
||||
},
|
||||
},
|
||||
/* 重置搜索 */
|
||||
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>
|
||||
|
||||
|
||||
@@ -1,222 +1,236 @@
|
||||
<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>
|
||||
<!-- 编辑弹窗 -->
|
||||
<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 {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();
|
||||
});
|
||||
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",
|
||||
customRender: ({text}) => {
|
||||
return Number(text).toFixed(1)
|
||||
}
|
||||
},
|
||||
{
|
||||
title: "L10",
|
||||
dataIndex: "l10",
|
||||
customRender: ({text}) => {
|
||||
return Number(text).toFixed(1)
|
||||
}
|
||||
},
|
||||
{
|
||||
title: "L50",
|
||||
dataIndex: "l50",
|
||||
customRender: ({text}) => {
|
||||
return Number(text).toFixed(1)
|
||||
}
|
||||
},
|
||||
{
|
||||
title: "L90",
|
||||
dataIndex: "l90",
|
||||
customRender: ({text}) => {
|
||||
return Number(text).toFixed(1)
|
||||
}
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: "质量等级",
|
||||
dataIndex: "level",
|
||||
},
|
||||
],
|
||||
// 表格搜索条件
|
||||
where: {},
|
||||
yearOptions: [],
|
||||
// 表格选中数据
|
||||
selectionList: [],
|
||||
};
|
||||
},
|
||||
/* 刷新表格 */
|
||||
reload() {
|
||||
this.$refs.table.reload({
|
||||
where: this.where,
|
||||
});
|
||||
mounted() {
|
||||
this.loadOptionData();
|
||||
},
|
||||
/* 重置搜索 */
|
||||
reset() {
|
||||
this.reload();
|
||||
},
|
||||
exportFile() {
|
||||
const columns = [
|
||||
{
|
||||
title: "年份",
|
||||
dataIndex: "year",
|
||||
methods: {
|
||||
/**获取下来框数据 */
|
||||
loadOptionData() {
|
||||
getColumnOptions("monitor_year").then((res) => {
|
||||
this.yearOptions = res.data.data.map((item) => {
|
||||
return {
|
||||
label: item,
|
||||
value: item,
|
||||
};
|
||||
});
|
||||
this.reload();
|
||||
});
|
||||
},
|
||||
{
|
||||
title: "网格长(米)",
|
||||
dataIndex: "gridLength",
|
||||
/* 刷新表格 */
|
||||
reload() {
|
||||
this.$refs.table.reload({
|
||||
where: this.where,
|
||||
});
|
||||
},
|
||||
{
|
||||
title: "网格宽(米)",
|
||||
dataIndex: "gridWidth",
|
||||
},
|
||||
{
|
||||
title: "网格总数",
|
||||
dataIndex: "gridCount",
|
||||
},
|
||||
{
|
||||
title: "时段",
|
||||
dataIndex: "timeSlot",
|
||||
/* 重置搜索 */
|
||||
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: "Leq",
|
||||
dataIndex: "leq",
|
||||
},
|
||||
{
|
||||
title: "L10",
|
||||
dataIndex: "l10",
|
||||
},
|
||||
{
|
||||
title: "L50",
|
||||
dataIndex: "l50",
|
||||
},
|
||||
{
|
||||
title: "L90",
|
||||
dataIndex: "l90",
|
||||
},
|
||||
|
||||
{
|
||||
title: "质量等级",
|
||||
dataIndex: "level",
|
||||
},
|
||||
];
|
||||
{
|
||||
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());
|
||||
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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user