gis,酸雨

This commit is contained in:
weicw
2021-09-01 04:58:49 +08:00
parent ab71482bae
commit cb8fc96527
20 changed files with 37128 additions and 1312 deletions

3434
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -11,6 +11,7 @@
}, },
"dependencies": { "dependencies": {
"@antv/l7": "^2.5.8", "@antv/l7": "^2.5.8",
"@antv/l7-district": "^2.3.11",
"@antv/l7-maps": "^2.5.8", "@antv/l7-maps": "^2.5.8",
"@tinymce/tinymce-vue": "~4.0.4", "@tinymce/tinymce-vue": "~4.0.4",
"ant-design-vue": "~2.2.2", "ant-design-vue": "~2.2.2",

View File

@@ -1,77 +1,77 @@
import axios from 'axios'; import axios from 'axios';
// ----------------------列表----------------------- // ----------------------列表-----------------------
const pageBillUrl = '/acidRain/acidBill/page'; const pageBillUrl = '/acidRain/acidRainBill/page';
// 添加 // 添加
const saveAcidBill = function (data) { const saveAcidRainBill = function (data) {
return axios.post("/acidRain/acidBill",data) return axios.post("/acidRain/acidRainBill/batch",data)
} }
// 删除 // 删除
const removeAcidBill = function (id) { const removeAcidRainBill = function (id) {
return axios.delete(`/acidRain/acidBill/${id}`,) return axios.delete(`/acidRain/acidRainBill/${id}`,)
} }
// 批量删除 // 批量删除
const removeBatchAcidBill = function (ids) { const removeBatchAcidRainBill = function (ids) {
return axios.delete("/acidRain/acidBill/batch",{data:ids}) return axios.delete("/acidRain/acidRainBill/batch",{data:ids})
} }
// 修改 // 修改
const updateAcidBill = function (data) { const updateAcidRainBill = function (data) {
return axios.put("/acidRain/acidBill",data) return axios.put("/acidRain/acidRainBill",data)
} }
// 审核 // 审核
const verifyAcidBill = function (data) { const verifyAcidRainBill = function (data) {
return axios.put("/acidRain/acidBill/verify",data); return axios.put("/acidRain/acidRainBill/verify",data);
} }
const getAcidBill = function (id) { const getAcidRainBill = function (id) {
return axios.get(`/acidRain/acidBill/${id}`) return axios.get(`/acidRain/acidRainBill/${id}`)
} }
// -------------------------数据--------------------- // -------------------------数据---------------------
const pageAcidUrl = '/acidRain/acid/page'; const pageAcidRainUrl = '/acidRain/acidRain/page';
// 添加 // 添加
const saveAcid = function (data) { const saveAcidRain = function (data) {
return axios.post("/acidRain/acid",data) return axios.post("/acidRain/acidRain",data)
} }
// 删除 // 删除
const removeAcid = function (id) { const removeAcidRain = function (id) {
return axios.delete(`/acidRain/acid/${id}`,) return axios.delete(`/acidRain/acidRain/${id}`,)
} }
// 批量删除 // 批量删除
const removeBatchAcid = function (ids) { const removeBatchAcidRain = function (ids) {
return axios.delete("/acidRain/acid/batch",{data:ids}) return axios.delete("/acidRain/acidRain/batch",{data:ids})
} }
// 修改 // 修改
const updateAcid = function (data) { const updateAcidRain = function (data) {
return axios.put("/acidRain/acid",data) return axios.put("/acidRain/acidRain",data)
} }
// -------------------------统计--------------------- // -------------------------统计---------------------
const pageAcidStatisticUrl = '/acidRain/acid/statistic'; const pageAcidRainStatisticUrl = '/acidRain/acidRain/statistic';
const statisticSourceUrl = '/acidRain/acid/statistic/source'; const statisticSourceUrl = '/acidRain/acidRain/statistic/source';
const statisticYearUrl = '/acidRain/acid/statistic/year'; const statisticYearUrl = '/acidRain/acidRain/statistic/year';
const getHistoryyears = function () { const getHistoryyears = function () {
return axios.get("/acidRain/acid/history-year") return axios.get("/acidRain/acidRain/history-year")
} }
const getColumnOptions = function(column){ const getColumnOptions = function(column){
return axios.get("/acidRain/acid/options",{params:{column}}) return axios.get("/acidRain/acidRain/options",{params:{column}})
} }
export { export {
pageBillUrl, pageBillUrl,
saveAcidBill, saveAcidRainBill,
removeAcidBill, removeAcidRainBill,
updateAcidBill, updateAcidRainBill,
removeBatchAcidBill, removeBatchAcidRainBill,
verifyAcidBill, verifyAcidRainBill,
getAcidBill, getAcidRainBill,
pageAcidUrl, pageAcidRainUrl,
saveAcid, saveAcidRain,
removeAcid, removeAcidRain,
updateAcid, updateAcidRain,
removeBatchAcid, removeBatchAcidRain,
pageAcidStatisticUrl, pageAcidRainStatisticUrl,
getHistoryyears, getHistoryyears,
getColumnOptions, getColumnOptions,
statisticSourceUrl, statisticSourceUrl,

View File

@@ -55,6 +55,13 @@ const getHistoryyears = function () {
const getColumnOptions = function(column){ const getColumnOptions = function(column){
return axios.get("/sound/function/noise/options",{params:{column}}) return axios.get("/sound/function/noise/options",{params:{column}})
} }
const getGisBase = function(data){
return axios.get("/sound/function/noise/gis",{params:data})
}
const getGisArea = function(data){
return axios.get("/sound/function/noise/gis/area",{params:data})
}
export { export {
pageBillUrl, pageBillUrl,
saveFunctionNoiseBill, saveFunctionNoiseBill,
@@ -70,6 +77,8 @@ export {
removeBatchFunctionNoise, removeBatchFunctionNoise,
pageFunctionNoiseStatisticUrl, pageFunctionNoiseStatisticUrl,
getHistoryyears, getHistoryyears,
getColumnOptions getColumnOptions,
getGisBase,
getGisArea
} }

View File

@@ -62,6 +62,14 @@ const getHistoryyears = function () {
const getColumnOptions = function(column){ const getColumnOptions = function(column){
return axios.get("/sound/road/noise/options",{params:{column}}) return axios.get("/sound/road/noise/options",{params:{column}})
} }
const getGisBase = function(data){
return axios.get("/sound/road/noise/gis",{params:data})
}
const getGisArea = function(data){
return axios.get("/sound/road/noise/gis/area",{params:data})
}
export { export {
pageBillUrl, pageBillUrl,
saveRoadNoiseBill, saveRoadNoiseBill,
@@ -79,6 +87,8 @@ export {
getHistoryyears, getHistoryyears,
pageRoadNoiseCompare, pageRoadNoiseCompare,
getColumnOptions, getColumnOptions,
listAll listAll,
getGisBase,
getGisArea
} }

16353
src/assets/450100.js Normal file

File diff suppressed because it is too large Load Diff

16353
src/utils/450100.js Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -8,7 +8,7 @@
:showUploadList="false" :showUploadList="false"
accept=".xls,.xlsx,.csv" accept=".xls,.xlsx,.csv"
> >
<a-button>市级导入</a-button> <a-button>数据导入</a-button>
</a-upload> </a-upload>
<!-- <a-upload <!-- <a-upload
:before-upload="importFileArea" :before-upload="importFileArea"
@@ -20,8 +20,8 @@
</a-space> </a-space>
</template> </template>
<a-tabs v-model:activeKey="activeKey"> <a-tabs v-model:activeKey="activeKey">
<a-tab-pane tab="噪声信息" key="noise"> <a-tab-pane tab="降水信息" key="rain">
<noise-bill ref="noise"></noise-bill> <rain-bill ref="rain"></rain-bill>
</a-tab-pane> </a-tab-pane>
</a-tabs> </a-tabs>
</a-card> </a-card>
@@ -32,16 +32,16 @@
import XLSX from "xlsx"; import XLSX from "xlsx";
import utils from "./utils"; import utils from "./utils";
import { Modal } from "ant-design-vue"; import { Modal } from "ant-design-vue";
import NoiseBill from "./noise-bill.vue"; import RainBill from "./rain-bill.vue";
import { saveAcidBill } from "@/api/ecology/acid"; import { saveAcidRainBill } from "@/api/ecology/acid";
export default { export default {
name: "ZoneCollectIndex", name: "RainCollectIndex",
components: { components: {
NoiseBill, RainBill,
}, },
data() { data() {
return { return {
activeKey: "noise", activeKey: "rain",
}; };
}, },
methods: { methods: {
@@ -62,32 +62,31 @@ export default {
let aoa = XLSX.utils.sheet_to_json(workbook.Sheets[sheetNames[0]], { let aoa = XLSX.utils.sheet_to_json(workbook.Sheets[sheetNames[0]], {
header: 1, header: 1,
}); });
let aoa2 = XLSX.utils.sheet_to_json(workbook.Sheets[sheetNames[1]], { // let aoa2 = XLSX.utils.sheet_to_json(workbook.Sheets[sheetNames[1]], {
header: 1, // header: 1,
}); // });
const reportDate = aoa[1][0].replace(/[^\d]+/g, "-");
const reportDate2 = aoa2[1][0].replace(/[^\d]+/g, "-");
const acidList = aoa.filter( // const reportDate = aoa[2][0].replace(/[^\d]+/g, "-");
(item) => { // const reportDate2 = aoa2[1][0].replace(/[^\d]+/g, "-");
return item.length >= 26 && typeof item[0] == "number"}
); const acidList = aoa.filter((item) => {
const acidList2 = aoa2.filter( return item.length >= 23 && typeof item[0] == "number";
(item) => item.length >= 26 && typeof item[0] == "number" });
); // const acidList2 = aoa2.filter(
// (item) => item.length >= 26 && typeof item[0] == "number"
// );
// 解析成对象数组 // 解析成对象数组
const billName = aoa[0][0]; const billName = aoa[0][0] + aoa[1][0];
const billData = utils.toObjData(acidList); const billData = utils.toObjData(acidList);
const billName2 = aoa2[0][0]; // const billName2 = aoa2[0][0];
const billData2 = utils.toObjData(acidList2); // const billData2 = utils.toObjData(acidList2);
if ( if (
(!billData || billData.length == 0) && !billData ||
(!billData2 || billData2.length == 0) billData.length == 0
// (!billData2 || billData2.length == 0)
) { ) {
hide() hide();
Modal.error({ Modal.error({
title: "导入失败", title: "导入失败",
content: "找不到数据", content: "找不到数据",
@@ -98,35 +97,42 @@ export default {
const tasks = []; const tasks = [];
if (billData.length > 0) { if (billData.length > 0) {
tasks.push( tasks.push(
saveAcidBill({ saveAcidRainBill({
reportTime: new Date(reportDate).getTime(), // reportTime: new Date(reportDate).getTime(),
billName: billName, billName: billName,
regionLevel: "市级", regionLevel: "市级",
acidList: billData, acidRainList: billData,
}) })
); );
} }
if (billData2.length > 0) { // if (billData2.length > 0) {
tasks.push( // tasks.push(
saveAcidBill({ // saveAcidRainBill({
reportTime: new Date(reportDate2).getTime(), // reportTime: new Date(reportDate2).getTime(),
billName: billName2, // billName: billName2,
regionLevel: "市级", // regionLevel: "市级",
acidList: billData2, // acidList: billData2,
}) // })
); // );
} // }
// 上传到服务器 // 上传到服务器
Promise.all(tasks) Promise.all(tasks)
.then(() => { .then((res) => {
Modal.success({ if (res[0].data.code == 0) {
title: "导入成功", Modal.success({
content: `成功导入${billData.length + billData2.length}条数据`, title: "导入成功",
}); content: `成功导入${billData.length}条数据`,
this.$refs.noise && this.$refs.noise.reload(); });
this.$refs.rain && this.$refs.rain.reload();
} else {
Modal.error({
title: "导入失败",
content: "数据上传出错",
});
}
}) })
.catch(() => { .catch(() => {
Modal.error({ Modal.error({
@@ -169,12 +175,9 @@ export default {
}); });
const reportDate = aoa[1][0].replace(/[^\d]+/g, "-"); const reportDate = aoa[1][0].replace(/[^\d]+/g, "-");
const acidList = aoa.filter( const acidList = aoa.filter((item) => {
(item) => { return item.length >= 35 && item[0] != "行政区划代码";
});
return item.length >= 35 && item[0] != "行政区划代码"
}
);
// 解析成对象数组 // 解析成对象数组
const billName = aoa[0][0]; const billName = aoa[0][0];
@@ -192,7 +195,7 @@ export default {
if (billData.length > 0) { if (billData.length > 0) {
// 上传到服务器 // 上传到服务器
saveAcidBill({ saveAcidRainBill({
reportTime: new Date(reportDate).getTime(), reportTime: new Date(reportDate).getTime(),
billName: billName, billName: billName,
regionLevel: "县级", regionLevel: "县级",
@@ -202,11 +205,9 @@ export default {
if (res.data.code == 0) { if (res.data.code == 0) {
Modal.success({ Modal.success({
title: "导入成功", title: "导入成功",
content: `成功导入${ content: `成功导入${billData.length}条数据`,
billData.length
}条数据`,
}); });
this.$refs.noise && this.$refs.noise.reload(); this.$refs.rain && this.$refs.rain.reload();
} else { } else {
Modal.error({ Modal.error({
title: "导入失败", title: "导入失败",

View File

@@ -1,7 +1,7 @@
<template> <template>
<div> <div>
<!-- 表格 --> <!-- 表格 -->
<ele-pro-table v-model:selection="selectionList" ref="table" row-key="zoneNoiseBillId" :datasource="url" <ele-pro-table v-model:selection="selectionList" ref="table" row-key="acidRainBillId" :datasource="url"
:columns="columns" :where="where" :scroll="{x: 'max-content'}"> :columns="columns" :where="where" :scroll="{x: 'max-content'}">
<template #toolbar> <template #toolbar>
@@ -44,8 +44,8 @@
</template> </template>
<template #billName="{ text, record }"> <template #billName="{ text, record }">
<div class="editable-cell"> <div class="editable-cell">
<div v-if="editableData[record.zoneNoiseBillId]" class="editable-cell-input-wrapper"> <div v-if="editableData[record.acidRainBillId]" class="editable-cell-input-wrapper">
<a-input v-model:value="editableData[record.zoneNoiseBillId].billName" @pressEnter="save(record)" /> <a-input v-model:value="editableData[record.acidRainBillId].billName" @pressEnter="save(record)" />
<check-outlined class="editable-cell-icon-check" @click="save(record)" /> <check-outlined class="editable-cell-icon-check" @click="save(record)" />
</div> </div>
<div v-else class="editable-cell-text-wrapper"> <div v-else class="editable-cell-text-wrapper">
@@ -56,9 +56,9 @@
</template> </template>
<template #reportTime="{ text, record }"> <template #reportTime="{ text, record }">
<div class="editable-cell"> <div class="editable-cell">
<div v-if="editableData[record.zoneNoiseBillId]" class="editable-cell-input-wrapper"> <div v-if="editableData[record.acidRainBillId]" class="editable-cell-input-wrapper">
<a-date-picker v-model:value="editableData[record.zoneNoiseBillId].reportTime"></a-date-picker> <a-date-picker v-model:value="editableData[record.acidRainBillId].reportTime"></a-date-picker>
<!-- <a-input v-model:value="editableData[record.zoneNoiseBillId].reportTime" @pressEnter="save(record)" /> --> <!-- <a-input v-model:value="editableData[record.acidRainBillId].reportTime" @pressEnter="save(record)" /> -->
<check-outlined class="editable-cell-icon-check" @click="save(record)" /> <check-outlined class="editable-cell-icon-check" @click="save(record)" />
</div> </div>
<div v-else class="editable-cell-text-wrapper"> <div v-else class="editable-cell-text-wrapper">
@@ -106,15 +106,15 @@
import { Modal } from 'ant-design-vue'; import { Modal } from 'ant-design-vue';
import { import {
pageBillUrl, pageBillUrl,
// saveZoneNoiseBill, // saveRainBill,
removeZoneNoiseBill, removeAcidRainBill,
removeBatchZoneNoiseBill, removeBatchAcidRainBill,
updateZoneNoiseBill, updateAcidRainBill,
verifyZoneNoiseBill verifyAcidRainBill
} from "@/api/ecology/zone-sound"; } from "@/api/ecology/acid";
import moment from "moment"; import moment from "moment";
export default { export default {
name: 'ZoneCollectNoiseBill', name: 'RainCollectNoiseBill',
components: { components: {
CheckOutlined, CheckOutlined,
EditOutlined EditOutlined
@@ -144,11 +144,11 @@
}, },
}, },
{ // {
title: '区域等级', // title: '',
dataIndex: 'regionLevel', // dataIndex: 'regionLevel',
sorter: true, // sorter: true,
}, // },
{ {
title: '条目', title: '条目',
dataIndex: 'recordSize', dataIndex: 'recordSize',
@@ -160,17 +160,17 @@
// dataIndex: 'title', // dataIndex: 'title',
// sorter: true // sorter: true
// }, // },
{ // {
title: '上报时间', // title: '',
dataIndex: 'reportTime', // dataIndex: 'reportTime',
sorter: true, // sorter: true,
slots: { // slots: {
customRender: 'reportTime', // customRender: 'reportTime',
}, // },
// customRender: ({ // // customRender: ({
// text // // text
// }) => this.$util.toDateString(text) // // }) => this.$util.toDateString(text)
}, // },
{ {
title: '导入时间', title: '导入时间',
dataIndex: 'createTime', dataIndex: 'createTime',
@@ -190,7 +190,7 @@
}, },
{ {
title: '创建人', title: '创建人',
dataIndex: 'username', dataIndex: 'userName',
sorter: true, sorter: true,
}, },
@@ -245,18 +245,18 @@
}, },
detail(record) { detail(record) {
this.$router.replace({ this.$router.replace({
path: "/sound/zone/collect/noise/" + record.zoneNoiseBillId path: "/atmosphere/acid-rain/collect/rain/" + record.acidRainBillId
}) })
}, },
edit(record) { edit(record) {
this.editableData[record.zoneNoiseBillId] = _.cloneDeep(record); this.editableData[record.acidRainBillId] = _.cloneDeep(record);
this.editableData[record.zoneNoiseBillId].reportTime = moment(this.editableData[record.zoneNoiseBillId] this.editableData[record.acidRainBillId].reportTime = moment(this.editableData[record.acidRainBillId]
.reportTime) .reportTime)
}, },
verify(record,checked) { verify(record,checked) {
const hide = this.$message.loading('请求中..', 0); const hide = this.$message.loading('请求中..', 0);
verifyZoneNoiseBill({ verifyAcidRainBill({
zoneNoiseBillId: record.zoneNoiseBillId, acidRainBillId: record.acidRainBillId,
checked checked
}).then(res => { }).then(res => {
if (res.data.code == 0) { if (res.data.code == 0) {
@@ -280,19 +280,19 @@
save(record) { save(record) {
let { let {
zoneNoiseBillId, acidRainBillId,
billName, billName,
reportTime reportTime
} = this.editableData[record.zoneNoiseBillId]; } = this.editableData[record.acidRainBillId];
if (!zoneNoiseBillId || !reportTime) { if (!acidRainBillId || !reportTime) {
this.$message.error('请填写完整信息再提交') this.$message.error('请填写完整信息再提交')
return return
} }
const hide = this.$message.loading('请求中..', 0); const hide = this.$message.loading('请求中..', 0);
reportTime = reportTime.format("x") reportTime = reportTime.format("x")
reportTime = Number(reportTime) reportTime = Number(reportTime)
updateZoneNoiseBill({ updateAcidRainBill({
zoneNoiseBillId, acidRainBillId,
billName, billName,
reportTime reportTime
}).then(res => { }).then(res => {
@@ -307,7 +307,7 @@
console.log(e); console.log(e);
this.$message.error(e.message); this.$message.error(e.message);
}).finally(() => { }).finally(() => {
delete this.editableData[record.zoneNoiseBillId] delete this.editableData[record.acidRainBillId]
hide() hide()
}) })
@@ -315,7 +315,7 @@
/* 删除单个 */ /* 删除单个 */
remove(row) { remove(row) {
const hide = this.$message.loading('请求中..', 0); const hide = this.$message.loading('请求中..', 0);
removeZoneNoiseBill(row.zoneNoiseBillId).then(res => { removeAcidRainBill(row.acidRainBillId).then(res => {
if (res.data.code === 0) { if (res.data.code === 0) {
this.$message.success(res.data.msg); this.$message.success(res.data.msg);
this.reload(); this.reload();
@@ -327,9 +327,9 @@
}).finally(() => hide()); }).finally(() => hide());
}, },
removeBatch() { removeBatch() {
const ids = this.selectionList.map(item => item.zoneNoiseBillId); const ids = this.selectionList.map(item => item.acidRainBillId);
const hide = this.$message.loading('请求中..', 0); const hide = this.$message.loading('请求中..', 0);
removeBatchZoneNoiseBill(ids).then(res => { removeBatchAcidRainBill(ids).then(res => {
if (res.data.code === 0) { if (res.data.code === 0) {
this.$message.success(res.data.msg); this.$message.success(res.data.msg);
this.reload(); this.reload();

View File

@@ -42,7 +42,7 @@
</a-form> </a-form>
<a-modal <a-modal
v-model:visible="showEdit" v-model:visible="showEdit"
:title="form.zoneNoiseId !== undefined ? '修改记录' : '添加记录'" :title="form.acidRainId !== undefined ? '修改记录' : '添加记录'"
:confirm-loading="loading" :confirm-loading="loading"
:width="1000" :width="1000"
:body-style="{ paddingBottom: '8px' }" :body-style="{ paddingBottom: '8px' }"
@@ -81,176 +81,6 @@
/> />
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :md="12" :sm="24">
<a-form-item label="所属城区" name="area">
<a-input
v-model:value="form.area"
placeholder="请输入城区"
allow-clear
/>
</a-form-item>
</a-col>
<a-col :md="12" :sm="24">
<a-form-item label="网格长" name="zoneLength">
<a-input
v-model:value="form.gridLength"
placeholder="请输入网格长(米)"
allow-clear
/>
</a-form-item>
</a-col>
<a-col :md="12" :sm="24">
<a-form-item label="网格宽" name="zoneWidth">
<a-input
v-model:value="form.gridWidth"
placeholder="请输入网格宽(米)"
allow-clear
/>
</a-form-item>
</a-col>
<a-col :md="12" :sm="24">
<a-form-item label="LeqdB(A)" name="indexLeq">
<a-input
type="number"
v-model:value="form.indexLeq"
placeholder="请输入LeqdB(A)"
allow-clear
/>
</a-form-item>
</a-col>
<a-col :md="12" :sm="24">
<a-form-item label="SDdB(A)" name="indexSd">
<a-input
type="number"
v-model:value="form.indexSd"
placeholder="请输入大SDdB(A)"
allow-clear
/>
</a-form-item>
</a-col>
<a-col :md="12" :sm="24">
<a-form-item label="L10dB(A)" name="indexL10">
<a-input
type="number"
v-model:value="form.indexL10"
placeholder="请输入L10dB(A)"
allow-clear
/>
</a-form-item>
</a-col>
<a-col :md="12" :sm="24">
<a-form-item label="L50dB(A)" name="indexL50">
<a-input
type="number"
v-model:value="form.indexL50"
placeholder="请输入L50dB(A)"
allow-clear
/>
</a-form-item>
</a-col>
<a-col :md="12" :sm="24">
<a-form-item label="L90dB(A)" name="indexL90">
<a-input
type="number"
v-model:value="form.indexL90"
placeholder="请输入L90dB(A)"
allow-clear
/>
</a-form-item>
</a-col>
<a-col :md="12" :sm="24">
<a-form-item label="LmindB(A)" name="indexLmin">
<a-input
type="number"
v-model:value="form.indexLmin"
placeholder="请输入LmindB(A)"
allow-clear
/>
</a-form-item>
</a-col>
<a-col :md="12" :sm="24">
<a-form-item label="LmaxdB(A)" name="indexLmax">
<a-input
type="number"
v-model:value="form.indexLmax"
placeholder="请输入LmaxdB(A)"
allow-clear
/>
</a-form-item>
</a-col>
<a-col :md="12" :sm="24">
<a-form-item label="监测站名" name="station">
<a-input
v-model:value="form.station"
placeholder="请输入监测站名"
allow-clear
/>
</a-form-item>
</a-col>
<a-col :md="12" :sm="24">
<a-form-item label="监测仪器型号" name="monitorInstrumentModel">
<a-input
v-model:value="form.monitorInstrumentModel"
placeholder="请输入监测仪器型号"
allow-clear
/>
</a-form-item>
</a-col>
<a-col :md="12" :sm="24">
<a-form-item label="监测仪器编号" name="monitorInstrumentCode">
<a-input
v-model:value="form.monitorInstrumentCode"
placeholder="请输入监测仪器编号"
allow-clear
/>
</a-form-item>
</a-col>
<a-col :md="12" :sm="24">
<a-form-item label="监测前校准值" name="beforeMonitorValue">
<a-input
v-model:value="form.beforeMonitorValue"
placeholder="请输入监测前校准值"
allow-clear
/>
</a-form-item>
</a-col>
<a-col :md="12" :sm="24">
<a-form-item label="监测后校准值" name="afterMonitorValue">
<a-input
v-model:value="form.afterMonitorValue"
placeholder="请输入监测后校准值"
allow-clear
/>
</a-form-item>
</a-col>
<a-col :md="12" :sm="24">
<a-form-item label="声校准器测量声压值" name="soundPressureValue">
<a-input
v-model:value="form.soundPressureValue"
placeholder="请输入声校准器测量声压值"
allow-clear
/>
</a-form-item>
</a-col>
<a-col :md="12" :sm="24">
<a-form-item label="声校准仪器型号" name="soundInstrumentModel">
<a-input
v-model:value="form.soundInstrumentModel"
placeholder="请输入声校准仪器型号"
allow-clear
/>
</a-form-item>
</a-col>
<a-col :md="12" :sm="24">
<a-form-item label="声校准仪器编号" name="soundInstrumentCode">
<a-input
v-model:value="form.soundInstrumentCode"
placeholder="请输入声校准仪器编号"
allow-clear
/>
</a-form-item>
</a-col>
<a-col :md="12" :sm="24"> <a-col :md="12" :sm="24">
<a-form-item label="备注" name="remark"> <a-form-item label="备注" name="remark">
<a-input <a-input
@@ -267,7 +97,7 @@
<ele-pro-table <ele-pro-table
v-model:selection="selectionList" v-model:selection="selectionList"
ref="table" ref="table"
row-key="zoneNoiseId" row-key="acidRainId"
:datasource="url" :datasource="url"
:columns="columns" :columns="columns"
:where="where" :where="where"
@@ -294,13 +124,8 @@
</a-space> </a-space>
</template> </template>
<template #Leq="{ text,record }"> <template #Address="{ record }">
<a-tag v-if="(record.timeSlot == '昼' && text <= 68) || (record.timeSlot == '夜' && text <= 58)" color="green">{{text}}</a-tag> {{record.area?record.area:record.county?record.county:record.city}}
<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> </template>
<template #action="{ record }"> <template #action="{ record }">
@@ -333,14 +158,14 @@
<script> <script>
import _ from "lodash"; import _ from "lodash";
import { import {
pageZoneNoiseUrl, pageAcidRainUrl,
saveZoneNoise, saveAcidRain,
removeZoneNoise, removeAcidRain,
removeBatchZoneNoise, removeBatchAcidRain,
updateZoneNoise, updateAcidRain,
getZoneNoiseBill, getAcidRainBill,
getColumnOptions, getColumnOptions,
} from "@/api/ecology/zone-sound"; } from "@/api/ecology/acid";
import locale from "ant-design-vue/es/date-picker/locale/zh_CN"; import locale from "ant-design-vue/es/date-picker/locale/zh_CN";
import moment from "moment"; import moment from "moment";
// import utils from "./utils"; // import utils from "./utils";
@@ -354,147 +179,112 @@ export default {
locale, locale,
bill: {}, bill: {},
// //
url: pageZoneNoiseUrl, url: pageAcidRainUrl,
selection: [], selection: [],
// //
columns: [ columns: [
{ {
title: "监测日期", title: "采样开始时间",
dataIndex: "monitorTime", dataIndex: "monitorStartTime",
sorter: true, sorter: true,
customRender: ({text})=> moment(text,"YYYY/MM/DD HH:mm:ss").format("YYYY-MM-DD HH:mm") 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",
sorter: true,
}, },
{ {
title: "测点名称", title: "市(县,区)",
slots: {customRender: "Address"},
},
{
title: "采样点",
dataIndex: "place", dataIndex: "place",
sorter: true, sorter: true,
}, },
{ {
title: "所属城区", title: "点位类型",
dataIndex: "area", dataIndex: "placeType",
sorter: true,
},
{
title: "网格长(米)",
dataIndex: "gridLength",
sorter: true,
},
{
title: "网格宽(米)",
dataIndex: "gridWidth",
sorter: true, sorter: true,
}, },
{ {
title: "网格点号", title: "降水类型",
dataIndex: "gridNo", dataIndex: "precipitationType",
sorter: true, sorter: true,
}, },
{ {
title: "主要声源", title: "降水量",
dataIndex: "source", dataIndex: "precipitation",
sorter: true, sorter: true,
}, },
{ {
title: "时段", title: "pH",
dataIndex: "timeSlot", dataIndex: "ph",
sorter: true, sorter: true,
}, },
// { {
// title: '', title: "电导率",
// dataIndex: 'monitorMonth', dataIndex: "conductivity",
// 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, sorter: true,
}, },
{ {
title: "SDdB(A)", title: "SO42",
dataIndex: "indexSd", dataIndex: "so42",
sorter: true, sorter: true,
}, },
{ {
title: "L10dB(A)", title: "NO3",
dataIndex: "indexL10", dataIndex: "no3",
sorter: true, sorter: true,
}, },
{ {
title: "L50dB(A)", title: "F",
dataIndex: "indexL50", dataIndex: "f",
sorter: true, sorter: true,
}, },
{ {
title: "L90dB(A)", title: "CL",
dataIndex: "indexL90", dataIndex: "cl",
sorter: true, sorter: true,
}, },
{ {
title: "LmindB(A)", title: "NH4",
dataIndex: "indexLmin", dataIndex: "nh4",
sorter: true, sorter: true,
}, },
{ {
title: "LmaxdB(A)", title: "Ca2",
dataIndex: "indexLmax", dataIndex: "ca2",
sorter: true, sorter: true,
}, },
{ {
title: "监测站名", title: "Mg2",
dataIndex: "station", dataIndex: "mg2",
sorter: true, sorter: true,
}, },
{ {
title: "监测仪器型号", title: "Na",
dataIndex: "monitorInstrumentModel", dataIndex: "na",
sorter: true, sorter: true,
}, },
{ {
title: "监测仪器编号", title: "K",
dataIndex: "monitorInstrumentCode", dataIndex: "k",
sorter: true, sorter: true,
}, },
{ {
title: "监测前校准值", title: "系统编码",
dataIndex: "beforeMonitorValue", dataIndex: "systemCode",
sorter: true,
},
{
title: "声校准器测量声压值",
dataIndex: "soundPressureValue",
sorter: true,
},
{
title: "声校准仪器型号",
dataIndex: "soundInstrumentModel",
sorter: true,
},
{
title: "声校准仪器编号",
dataIndex: "soundInstrumentCode",
sorter: true,
},
{
title: "区域等级",
dataIndex: "regionLevel",
sorter: true, sorter: true,
}, },
{ {
title: "备注", title: "备注",
dataIndex: "remark", dataIndex: "remark",
@@ -517,11 +307,11 @@ export default {
}, },
], ],
// //
zoneNoiseBillId: billId, acidRainBillId: billId,
palceOptions: [], palceOptions: [],
areaOptions: [], areaOptions: [],
where: { where: {
zoneNoiseBillId: billId, acidRainBillId: billId,
}, },
// //
selectionList: [], selectionList: [],
@@ -535,7 +325,7 @@ export default {
}, },
mounted() { mounted() {
const { billId } = this.$route.params; const { billId } = this.$route.params;
getZoneNoiseBill(billId).then((res) => { getAcidRainBill(billId).then((res) => {
this.bill = res.data.data; this.bill = res.data.data;
if (res.data.data.checked == 1) { if (res.data.data.checked == 1) {
this.columns.splice(this.columns.length - 1, 1); this.columns.splice(this.columns.length - 1, 1);
@@ -574,7 +364,7 @@ export default {
/* 重置搜索 */ /* 重置搜索 */
reset() { reset() {
this.where = { this.where = {
zoneNoiseBillId: this.zoneNoiseBillId, acidRainBillId: this.acidRainBillId,
}; };
this.reload(); this.reload();
}, },
@@ -610,8 +400,8 @@ export default {
form.monitorHour = date.getHours(); form.monitorHour = date.getHours();
form.monitorMinute = date.getMinutes(); form.monitorMinute = date.getMinutes();
delete form["monitorDate"]; delete form["monitorDate"];
if (form.zoneNoiseId) { if (form.acidRainId) {
updateZoneNoise(form) updateAcidRain(form)
.then((res) => { .then((res) => {
if (res.data.code == 0) { if (res.data.code == 0) {
this.showEdit = false; this.showEdit = false;
@@ -629,8 +419,8 @@ export default {
hide(); hide();
}); });
} else { } else {
form.zoneNoiseBillId = this.zoneNoiseBillId; form.acidRainBillId = this.acidRainBillId;
saveZoneNoise(form) saveAcidRain(form)
.then((res) => { .then((res) => {
if (res.data.code == 0) { if (res.data.code == 0) {
this.showEdit = false; this.showEdit = false;
@@ -651,7 +441,7 @@ export default {
/* 删除单个 */ /* 删除单个 */
remove(row) { remove(row) {
const hide = this.$message.loading("请求中..", 0); const hide = this.$message.loading("请求中..", 0);
removeZoneNoise(row.zoneNoiseId) removeAcidRain(row.acidRainId)
.then((res) => { .then((res) => {
if (res.data.code === 0) { if (res.data.code === 0) {
this.$message.success(res.data.msg); this.$message.success(res.data.msg);
@@ -666,9 +456,9 @@ export default {
.finally(() => hide()); .finally(() => hide());
}, },
removeBatch() { removeBatch() {
const ids = this.selectionList.map((item) => item.zoneNoiseId); const ids = this.selectionList.map((item) => item.acidRainId);
const hide = this.$message.loading("请求中..", 0); const hide = this.$message.loading("请求中..", 0);
removeBatchZoneNoise(ids) removeBatchAcidRain(ids)
.then((res) => { .then((res) => {
if (res.data.code === 0) { if (res.data.code === 0) {
this.$message.success(res.data.msg); this.$message.success(res.data.msg);

View File

@@ -1,14 +1,21 @@
export default { export default {
toObjData(excelData) { toObjData(excelData) {
return excelData.map(item => { return excelData.map(item => {
const monitorTime = new Date(); const monitorStartTime = new Date();
monitorTime.setFullYear(item[0]); monitorStartTime.setFullYear(item[4]);
monitorTime.setMonth(item[7] - 1); monitorStartTime.setMonth(item[5] - 1);
monitorTime.setDate(item[8]); monitorStartTime.setDate(item[6]);
monitorTime.setHours(item[9]); monitorStartTime.setHours(item[7]);
monitorTime.setMinutes(item[10]); monitorStartTime.setMinutes(item[8]);
const monitorEndTime = new Date();
monitorEndTime.setFullYear(item[9]);
monitorEndTime.setMonth(item[10] - 1);
monitorEndTime.setDate(item[11]);
monitorEndTime.setHours(item[12]);
monitorEndTime.setMinutes(item[13]);
let quarter = 1; let quarter = 1;
const month = item[7] const month = item[10]
if (month < 4) { if (month < 4) {
quarter = 1 quarter = 1
} else if (month < 7) { } else if (month < 7) {
@@ -18,48 +25,34 @@ export default {
} else { } else {
quarter = 4 quarter = 4
} }
console.log(item);
const row = { const row = {
regionCode: "450100", regionCode: item[0],
monitorYear: item[0], city: item[1].includes("市")?item[1]:"南宁市",
gridLength: item[1], area: item[1].includes("区")?item[1]:"",
gridWidth: item[2], county: item[1].includes("县")?item[1]:"",
place: item[3], place: item[2],
gridNo: item[4], placeType: item[3],
area: item[5], precipitationType: item[14],
source: item[6], precipitation: item[15],
monitorMonth: item[7], ph: item[16],
monitorDay: item[8], conductivity: item[17],
monitorHour: item[9], so42: item[18],
monitorMinute: item[10], no3: item[19],
indexLeq: item[11], f: Number(item[20])?Number(item[20]):null,
indexSd: item[12], cl: item[21],
indexL10: item[13], nh4: item[22],
indexL50: item[14], ca2: item[23],
indexL90: item[15], mg2: item[24],
indexLmax: item[16], na: item[25],
indexLmin: item[17], k: Number(item[26])?Number(item[26]):null,
station: item[18], systemCode: item[27],
monitorInstrumentModel: item[19],
monitorInstrumentCode: item[20],
beforeMonitorValue: item[21],
afterMonitorValue: item[22],
soundPressureValue: item[23],
soundInstrumentModel: item[24],
soundInstrumentCode: item[25],
city: '南宁',
regionLevel: "市级", regionLevel: "市级",
monitorTime: monitorTime.getTime(), monitorStartTime: monitorStartTime.getTime(),
monitorEndTime: monitorEndTime.getTime(),
monitorTime: monitorEndTime.getTime(),
quarter quarter
} }
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; return row;
}) })
@@ -91,12 +84,12 @@ export default {
// 解析县级数据 // 解析县级数据
toAreaObjData(excelData) { toAreaObjData(excelData) {
return excelData.map(item => { return excelData.map(item => {
const monitorTime = new Date(); const monitorStartTime = new Date();
monitorTime.setFullYear(item[1]); monitorStartTime.setFullYear(item[1]);
monitorTime.setMonth(item[14] - 1); monitorStartTime.setMonth(item[14] - 1);
monitorTime.setDate(item[15]); monitorStartTime.setDate(item[15]);
monitorTime.setHours(item[16]); monitorStartTime.setHours(item[16]);
monitorTime.setMinutes(item[17]); monitorStartTime.setMinutes(item[17]);
let quarter = 1; let quarter = 1;
const month = item[14] const month = item[14]
if (month < 4) { if (month < 4) {
@@ -152,7 +145,7 @@ export default {
remark: item[35], remark: item[35],
city: '南宁', city: '南宁',
timeSlot, timeSlot,
monitorTime: monitorTime.getTime(), monitorStartTime: monitorStartTime.getTime(),
quarter quarter
} }

View File

@@ -57,20 +57,15 @@
<ele-pro-table <ele-pro-table
v-model:selection="selectionList" v-model:selection="selectionList"
ref="table" ref="table"
row-key="zoneNoiseId" row-key="acidRainId"
:datasource="url" :datasource="url"
:columns="columns" :columns="columns"
:where="where" :where="where"
:scroll="{ x: 'max-content' }" :scroll="{ x: 'max-content' }"
@done="(d) => (data = d.data)" @done="(d) => (data = d.data)"
> >
<template #Leq="{ text,record }"> <template #Address="{ record }">
<a-tag v-if="(record.timeSlot == '昼' && text <= 68) || (record.timeSlot == '夜' && text <= 58)" color="green">{{text}}</a-tag> {{record.area?record.area:record.county?record.county:record.city}}
<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> </template>
</ele-pro-table> </ele-pro-table>
</a-card> </a-card>
@@ -81,7 +76,7 @@
<script> <script>
// import _ from "lodash"; // import _ from "lodash";
import XLSX from "xlsx"; import XLSX from "xlsx";
import { pageZoneNoiseUrl, getColumnOptions } from "@/api/ecology/zone-sound"; import { pageAcidRainUrl, getColumnOptions } from "@/api/ecology/acid";
import locale from "ant-design-vue/es/date-picker/locale/zh_CN"; import locale from "ant-design-vue/es/date-picker/locale/zh_CN";
import moment from "moment"; import moment from "moment";
// import utils from "./utils"; // import utils from "./utils";
@@ -94,147 +89,112 @@ export default {
locale, locale,
bill: {}, bill: {},
// 表格数据接口 // 表格数据接口
url: pageZoneNoiseUrl, url: pageAcidRainUrl,
selection: [], selection: [],
// 表格列配置 // 表格列配置
columns: [ columns: [
{ {
title: "监测日期", title: "采样开始时间",
dataIndex: "monitorTime", dataIndex: "monitorStartTime",
sorter: true, sorter: true,
customRender: ({text})=> moment(text,"YYYY/MM/DD HH:mm:ss").format("YYYY-MM-DD HH:mm") 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",
sorter: true,
}, },
{ {
title: "测点名称", title: "市(县,区)",
slots: {customRender: "Address"},
},
{
title: "采样点",
dataIndex: "place", dataIndex: "place",
sorter: true, sorter: true,
}, },
{ {
title: "所属城区", title: "点位类型",
dataIndex: "area", dataIndex: "placeType",
sorter: true,
},
{
title: "网格长(米)",
dataIndex: "gridLength",
sorter: true,
},
{
title: "网格宽(米)",
dataIndex: "gridWidth",
sorter: true, sorter: true,
}, },
{ {
title: "网格点号", title: "降水类型",
dataIndex: "gridNo", dataIndex: "precipitationType",
sorter: true, sorter: true,
}, },
{ {
title: "主要声源", title: "降水量",
dataIndex: "source", dataIndex: "precipitation",
sorter: true, sorter: true,
}, },
{ {
title: "时段", title: "pH",
dataIndex: "timeSlot", dataIndex: "ph",
sorter: true, sorter: true,
}, },
// { {
// title: '月', title: "电导率",
// dataIndex: 'monitorMonth', dataIndex: "conductivity",
// 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, sorter: true,
}, },
{ {
title: "SDdB(A)", title: "SO42",
dataIndex: "indexSd", dataIndex: "so42",
sorter: true, sorter: true,
}, },
{ {
title: "L10dB(A)", title: "NO3",
dataIndex: "indexL10", dataIndex: "no3",
sorter: true, sorter: true,
}, },
{ {
title: "L50dB(A)", title: "F",
dataIndex: "indexL50", dataIndex: "f",
sorter: true, sorter: true,
}, },
{ {
title: "L90dB(A)", title: "CL",
dataIndex: "indexL90", dataIndex: "cl",
sorter: true, sorter: true,
}, },
{ {
title: "LmindB(A)", title: "NH4",
dataIndex: "indexLmin", dataIndex: "nh4",
sorter: true, sorter: true,
}, },
{ {
title: "LmaxdB(A)", title: "Ca2",
dataIndex: "indexLmax", dataIndex: "ca2",
sorter: true, sorter: true,
}, },
{ {
title: "监测站名", title: "Mg2",
dataIndex: "station", dataIndex: "mg2",
sorter: true, sorter: true,
}, },
{ {
title: "监测仪器型号", title: "Na",
dataIndex: "monitorInstrumentModel", dataIndex: "na",
sorter: true, sorter: true,
}, },
{ {
title: "监测仪器编号", title: "K",
dataIndex: "monitorInstrumentCode", dataIndex: "k",
sorter: true, sorter: true,
}, },
{ {
title: "监测前校准值", title: "系统编码",
dataIndex: "beforeMonitorValue", dataIndex: "systemCode",
sorter: true,
},
{
title: "声校准器测量声压值",
dataIndex: "soundPressureValue",
sorter: true,
},
{
title: "声校准仪器型号",
dataIndex: "soundInstrumentModel",
sorter: true,
},
{
title: "声校准仪器编号",
dataIndex: "soundInstrumentCode",
sorter: true,
},
{
title: "区域等级",
dataIndex: "regionLevel",
sorter: true, sorter: true,
}, },
{ {
title: "备注", title: "备注",
dataIndex: "remark", dataIndex: "remark",
@@ -244,7 +204,7 @@ export default {
title: "创建人", title: "创建人",
dataIndex: "username", dataIndex: "username",
sorter: true, sorter: true,
}, }
], ],
palceOptions: [], palceOptions: [],
areaOptions: [], areaOptions: [],
@@ -305,157 +265,106 @@ export default {
}, },
exportFile() { exportFile() {
const columns = [ const columns = [
{
title: "采样开始时间",
dataIndex: "monitorStartTime",
sorter: true,
customRender: ({text})=> moment(text,"YYYY/MM/DD HH:mm:ss").format("YYYY-MM-DD HH:mm")
},
{ {
title: "行政区划代码", title: "采样结束时间",
dataIndex: "monitorEndTime",
sorter: true,
customRender: ({text})=> moment(text,"YYYY/MM/DD HH:mm:ss").format("YYYY-MM-DD HH:mm")
},
{
title: "行政代码",
dataIndex: "regionCode", dataIndex: "regionCode",
sorter: true, sorter: true,
}, },
{ {
title: "监测年度", title: "市(县,区)",
dataIndex: "monitorYear", dataIndex: "address",
sorter: true, slots: {customRender: "Address"},
}, },
{ {
title: "点位编码", title: "采样点",
dataIndex: "placeCode",
sorter: true,
},
{
title: "测点名称",
dataIndex: "place", dataIndex: "place",
sorter: true, sorter: true,
}, },
{ {
title: "测点经度", title: "点位类型",
dataIndex: "placeLng", dataIndex: "placeType",
sorter: true,
},
{
title: "测点纬度",
dataIndex: "placeLat",
sorter: true,
},
{
title: "测点参照物",
dataIndex: "refObj",
sorter: true, sorter: true,
}, },
{ {
title: "网格边长", title: "降水类型",
dataIndex: "gridLength", dataIndex: "precipitationType",
sorter: true,
},
{
title: "网格覆盖人口(万)",
dataIndex: "people",
sorter: true, sorter: true,
}, },
{ {
title: "功能区代码", title: "降水量",
dataIndex: "functionCode", dataIndex: "precipitation",
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, sorter: true,
}, },
{ {
title: "最小值", title: "pH",
dataIndex: "indexLmin", dataIndex: "ph",
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, sorter: true,
}, },
{ {
title: "备注", title: "电导率",
dataIndex: "remark", dataIndex: "conductivity",
sorter: true,
},
{
title: "SO42",
dataIndex: "so42",
sorter: true,
},
{
title: "NO3",
dataIndex: "no3",
sorter: true,
},
{
title: "F",
dataIndex: "f",
sorter: true,
},
{
title: "CL",
dataIndex: "cl",
sorter: true,
},
{
title: "NH4",
dataIndex: "nh4",
sorter: true,
},
{
title: "Ca2",
dataIndex: "ca2",
sorter: true,
},
{
title: "Mg2",
dataIndex: "mg2",
sorter: true,
},
{
title: "Na",
dataIndex: "na",
sorter: true,
},
{
title: "K",
dataIndex: "k",
sorter: true,
},
{
title: "系统编码",
dataIndex: "systemCode",
sorter: true, sorter: true,
}, },
]; ];
@@ -463,7 +372,12 @@ export default {
const th = columns.map((item) => item.title); const th = columns.map((item) => item.title);
arr.push(th); arr.push(th);
this.data.forEach((d) => { this.data.forEach((d) => {
const td = columns.map((item) => d[item.dataIndex]); const td = columns.map((item) => {
if(item.dataIndex == "address"){
return d.area?d.area:d.county?d.county:d.city
}
return d[item.dataIndex];
});
arr.push(td); arr.push(td);
}); });
let sheet = XLSX.utils.aoa_to_sheet(arr); let sheet = XLSX.utils.aoa_to_sheet(arr);

View File

@@ -36,7 +36,7 @@
import YearStatistic from "./year.vue"; import YearStatistic from "./year.vue";
export default { export default {
name: 'StatisticSoundZone', name: 'StatisticAcidRain',
components: { components: {
BaseStatistic, BaseStatistic,
SourceStatistic, SourceStatistic,

View File

@@ -190,7 +190,7 @@
}, },
{ {
title: '创建人', title: '创建人',
dataIndex: 'username', dataIndex: 'userName',
sorter: true, sorter: true,
}, },

View File

@@ -52,8 +52,8 @@
ref="form" ref="form"
:model="form" :model="form"
:rules="rules" :rules="rules"
:label-col="{ md: { span: 6 }, sm: { span: 24 } }" :label-col="{ md: { span: 8 }, sm: { span: 24 } }"
:wrapper-col="{ md: { span: 18 }, sm: { span: 24 } }" :wrapper-col="{ md: { span: 16 }, sm: { span: 24 } }"
> >
<a-row> <a-row>
<a-col :md="12" :sm="24"> <a-col :md="12" :sm="24">
@@ -82,171 +82,91 @@
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :md="12" :sm="24"> <a-col :md="12" :sm="24">
<a-form-item label="所属城区" name="area"> <a-form-item label="SO2" name="so2">
<a-input <a-input
v-model:value="form.area" v-model:value="form.so2"
placeholder="请输入城区" placeholder="请输入二氧化硫浓度/(μg/m3)"
allow-clear allow-clear
/> />
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :md="12" :sm="24"> <a-col :md="12" :sm="24">
<a-form-item label="网格长" name="airLength"> <a-form-item label="NO2" name="no2">
<a-input <a-input
v-model:value="form.gridLength" v-model:value="form.no2"
placeholder="请输入网格长(米)" placeholder="请输入二氧化氮浓度/(μg/m3)"
allow-clear allow-clear
/> />
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :md="12" :sm="24"> <a-col :md="12" :sm="24">
<a-form-item label="网格宽" name="airWidth"> <a-form-item label="PM10" name="pm10">
<a-input <a-input
v-model:value="form.gridWidth" v-model:value="form.pm10"
placeholder="请输入网格宽(米)" placeholder="请输入可吸入颗粒物浓度/(μg/m3)"
allow-clear
/>
</a-form-item>
</a-col>
<a-col :md="12" :sm="24">
<a-form-item label="LeqdB(A)" name="indexLeq">
<a-input
type="number"
v-model:value="form.indexLeq"
placeholder="请输入LeqdB(A)"
allow-clear allow-clear
/> />
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :md="12" :sm="24"> <a-col :md="12" :sm="24">
<a-form-item label="SDdB(A)" name="indexSd"> <a-form-item label="CO" name="co">
<a-input <a-input
type="number" v-model:value="form.co"
v-model:value="form.indexSd" placeholder="请输入一氧化碳 浓度/(mg/m3)"
placeholder="请输入大SDdB(A)"
allow-clear allow-clear
/> />
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :md="12" :sm="24"> <a-col :md="12" :sm="24">
<a-form-item label="L10dB(A)" name="indexL10"> <a-form-item label="O3" name="o3">
<a-input <a-input
type="number" v-model:value="form.o3"
v-model:value="form.indexL10" placeholder="请输入臭氧O3最大8小时滑动平均浓度/(μg/m3)"
placeholder="请输入L10dB(A)"
allow-clear allow-clear
/> />
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :md="12" :sm="24"> <a-col :md="12" :sm="24">
<a-form-item label="L50dB(A)" name="indexL50"> <a-form-item label="PM2.5" name="pm25">
<a-input <a-input
type="number" v-model:value="form.pm25"
v-model:value="form.indexL50" placeholder="请输入细颗粒物浓度/(μg/m3)"
placeholder="请输入L50dB(A)"
allow-clear allow-clear
/> />
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :md="12" :sm="24"> <a-col :md="12" :sm="24">
<a-form-item label="L90dB(A)" name="indexL90"> <a-form-item label="空气质量指数AQI" name="aqi">
<a-input <a-input
type="number" v-model:value="form.aqi"
v-model:value="form.indexL90" placeholder="请输入空气质量指数AQI"
placeholder="请输入L90dB(A)"
allow-clear allow-clear
/> />
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :md="12" :sm="24"> <a-col :md="12" :sm="24">
<a-form-item label="LmindB(A)" name="indexLmin"> <a-form-item label="首要污染物" name="primaryPollutant">
<a-input <a-input
type="number" v-model:value="form.primaryPollutant"
v-model:value="form.indexLmin" placeholder="请输入首要污染物"
placeholder="请输入LmindB(A)"
allow-clear allow-clear
/> />
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :md="12" :sm="24"> <a-col :md="12" :sm="24">
<a-form-item label="LmaxdB(A)" name="indexLmax"> <a-form-item label="空气质量指数级别" name="aqiLevel">
<a-input <a-input
type="number" v-model:value="form.aqiLevel"
v-model:value="form.indexLmax" placeholder="请输入空气质量指数级别"
placeholder="请输入LmaxdB(A)"
allow-clear allow-clear
/> />
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :md="12" :sm="24"> <a-col :md="12" :sm="24">
<a-form-item label="监测站名" name="station"> <a-form-item label="空气质量状况" name="airQualityStatus">
<a-input <a-input
v-model:value="form.station" v-model:value="form.airQualityStatus"
placeholder="请输入监测站名" placeholder="请输入空气质量状况"
allow-clear
/>
</a-form-item>
</a-col>
<a-col :md="12" :sm="24">
<a-form-item label="监测仪器型号" name="monitorInstrumentModel">
<a-input
v-model:value="form.monitorInstrumentModel"
placeholder="请输入监测仪器型号"
allow-clear
/>
</a-form-item>
</a-col>
<a-col :md="12" :sm="24">
<a-form-item label="监测仪器编号" name="monitorInstrumentCode">
<a-input
v-model:value="form.monitorInstrumentCode"
placeholder="请输入监测仪器编号"
allow-clear
/>
</a-form-item>
</a-col>
<a-col :md="12" :sm="24">
<a-form-item label="监测前校准值" name="beforeMonitorValue">
<a-input
v-model:value="form.beforeMonitorValue"
placeholder="请输入监测前校准值"
allow-clear
/>
</a-form-item>
</a-col>
<a-col :md="12" :sm="24">
<a-form-item label="监测后校准值" name="afterMonitorValue">
<a-input
v-model:value="form.afterMonitorValue"
placeholder="请输入监测后校准值"
allow-clear
/>
</a-form-item>
</a-col>
<a-col :md="12" :sm="24">
<a-form-item label="声校准器测量声压值" name="soundPressureValue">
<a-input
v-model:value="form.soundPressureValue"
placeholder="请输入声校准器测量声压值"
allow-clear
/>
</a-form-item>
</a-col>
<a-col :md="12" :sm="24">
<a-form-item label="声校准仪器型号" name="soundInstrumentModel">
<a-input
v-model:value="form.soundInstrumentModel"
placeholder="请输入声校准仪器型号"
allow-clear
/>
</a-form-item>
</a-col>
<a-col :md="12" :sm="24">
<a-form-item label="声校准仪器编号" name="soundInstrumentCode">
<a-input
v-model:value="form.soundInstrumentCode"
placeholder="请输入声校准仪器编号"
allow-clear allow-clear
/> />
</a-form-item> </a-form-item>
@@ -267,7 +187,7 @@
<ele-pro-table <ele-pro-table
v-model:selection="selectionList" v-model:selection="selectionList"
ref="table" ref="table"
row-key="airId" row-key="ambientAirId"
:datasource="url" :datasource="url"
:columns="columns" :columns="columns"
:where="where" :where="where"
@@ -293,16 +213,6 @@
</a-popconfirm> </a-popconfirm>
</a-space> </a-space>
</template> </template>
<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>
<template #action="{ record }"> <template #action="{ record }">
<a-space> <a-space>
<a-button <a-button
@@ -362,140 +272,69 @@ export default {
title: "监测日期", title: "监测日期",
dataIndex: "monitorTime", dataIndex: "monitorTime",
sorter: true, sorter: true,
customRender: ({text})=> moment(text,"YYYY/MM/DD HH:mm:ss").format("YYYY-MM-DD HH:mm") customRender: ({text})=> moment(text).format("YYYY-MM-DD HH:mm")
},
{
title: "城市",
dataIndex: "city",
sorter: true,
}, },
{ {
title: "测点名称", title: "测点名称",
dataIndex: "place", dataIndex: "place",
sorter: true, sorter: true,
}, },
{ {
title: "所属城区", title: "SO2/(μg/m3)",
dataIndex: "area", dataIndex: "so2",
sorter: true,
},
{
title: "网格长(米)",
dataIndex: "gridLength",
sorter: true,
},
{
title: "网格宽(米)",
dataIndex: "gridWidth",
sorter: true, sorter: true,
}, },
{ {
title: "网格点号", title: "NO2/(μg/m3)",
dataIndex: "gridNo", dataIndex: "no2",
sorter: true, sorter: true,
}, },
{ {
title: "主要声源", title: "PM10/(μg/m3)",
dataIndex: "source", dataIndex: "pm10",
sorter: true, sorter: true,
}, },
{ {
title: "时段", title: "CO/(mg/m3)",
dataIndex: "timeSlot", dataIndex: "co",
sorter: true, sorter: true,
}, },
// { {
// title: '月', title: "臭氧O3最大8小时滑动平均浓度/(μg/m3)",
// dataIndex: 'monitorMonth', dataIndex: "o3",
// 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, sorter: true,
}, },
{ {
title: "SDdB(A)", title: "PM2.5",
dataIndex: "indexSd", dataIndex: "pm25",
sorter: true, sorter: true,
}, },
{ {
title: "L10dB(A)", title: "空气质量指数AQI",
dataIndex: "indexL10", dataIndex: "aqi",
sorter: true, sorter: true,
}, },
{ {
title: "L50dB(A)", title: "首要污染物",
dataIndex: "indexL50", dataIndex: "primaryPollutant",
sorter: true, sorter: true,
}, },
{ {
title: "L90dB(A)", title: "空气质量指数级别",
dataIndex: "indexL90", dataIndex: "aqiLevel",
sorter: true, sorter: true,
}, },
{ {
title: "LmindB(A)", title: "空气质量状况",
dataIndex: "indexLmin", dataIndex: "airQualityStatus",
sorter: true, 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: "备注", title: "备注",
dataIndex: "remark", dataIndex: "remark",
sorter: true, sorter: true,

View File

@@ -57,21 +57,14 @@
<ele-pro-table <ele-pro-table
v-model:selection="selectionList" v-model:selection="selectionList"
ref="table" ref="table"
row-key="zoneNoiseId" row-key="airId"
:datasource="url" :datasource="url"
:columns="columns" :columns="columns"
:where="where" :where="where"
:scroll="{ x: 'max-content' }" :scroll="{ x: 'max-content' }"
@done="(d) => (data = d.data)" @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> </ele-pro-table>
</a-card> </a-card>
</div> </div>
@@ -81,12 +74,12 @@
<script> <script>
// import _ from "lodash"; // import _ from "lodash";
import XLSX from "xlsx"; import XLSX from "xlsx";
import { pageZoneNoiseUrl, getColumnOptions } from "@/api/ecology/zone-sound"; import { pageAirUrl, getColumnOptions } from "@/api/ecology/air";
import locale from "ant-design-vue/es/date-picker/locale/zh_CN"; import locale from "ant-design-vue/es/date-picker/locale/zh_CN";
import moment from "moment"; import moment from "moment";
// import utils from "./utils"; // import utils from "./utils";
export default { export default {
name: "StatisticSoundZoneBase", name: "StatisticAirBase",
components: {}, components: {},
data() { data() {
return { return {
@@ -94,7 +87,7 @@ export default {
locale, locale,
bill: {}, bill: {},
// 表格数据接口 // 表格数据接口
url: pageZoneNoiseUrl, url: pageAirUrl,
selection: [], selection: [],
// 表格列配置 // 表格列配置
columns: [ columns: [
@@ -102,140 +95,69 @@ export default {
title: "监测日期", title: "监测日期",
dataIndex: "monitorTime", dataIndex: "monitorTime",
sorter: true, sorter: true,
customRender: ({text})=> moment(text,"YYYY/MM/DD HH:mm:ss").format("YYYY-MM-DD HH:mm") customRender: ({text})=> moment(text).format("YYYY-MM-DD HH:mm")
},
{
title: "城市",
dataIndex: "city",
sorter: true,
}, },
{ {
title: "测点名称", title: "测点名称",
dataIndex: "place", dataIndex: "place",
sorter: true, sorter: true,
}, },
{ {
title: "所属城区", title: "SO2/(μg/m3)",
dataIndex: "area", dataIndex: "so2",
sorter: true,
},
{
title: "网格长(米)",
dataIndex: "gridLength",
sorter: true,
},
{
title: "网格宽(米)",
dataIndex: "gridWidth",
sorter: true, sorter: true,
}, },
{ {
title: "网格点号", title: "NO2/(μg/m3)",
dataIndex: "gridNo", dataIndex: "no2",
sorter: true, sorter: true,
}, },
{ {
title: "主要声源", title: "PM10/(μg/m3)",
dataIndex: "source", dataIndex: "pm10",
sorter: true, sorter: true,
}, },
{ {
title: "时段", title: "CO/(mg/m3)",
dataIndex: "timeSlot", dataIndex: "co",
sorter: true, sorter: true,
}, },
// { {
// title: '月', title: "臭氧O3最大8小时滑动平均浓度/(μg/m3)",
// dataIndex: 'monitorMonth', dataIndex: "o3",
// 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, sorter: true,
}, },
{ {
title: "SDdB(A)", title: "PM2.5",
dataIndex: "indexSd", dataIndex: "pm25",
sorter: true, sorter: true,
}, },
{ {
title: "L10dB(A)", title: "空气质量指数AQI",
dataIndex: "indexL10", dataIndex: "aqi",
sorter: true, sorter: true,
}, },
{ {
title: "L50dB(A)", title: "首要污染物",
dataIndex: "indexL50", dataIndex: "primaryPollutant",
sorter: true, sorter: true,
}, },
{ {
title: "L90dB(A)", title: "空气质量指数级别",
dataIndex: "indexL90", dataIndex: "aqiLevel",
sorter: true, sorter: true,
}, },
{ {
title: "LmindB(A)", title: "空气质量状况",
dataIndex: "indexLmin", dataIndex: "airQualityStatus",
sorter: true, 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: "备注", title: "备注",
dataIndex: "remark", dataIndex: "remark",
sorter: true, sorter: true,
@@ -244,7 +166,7 @@ export default {
title: "创建人", title: "创建人",
dataIndex: "username", dataIndex: "username",
sorter: true, sorter: true,
}, }
], ],
palceOptions: [], palceOptions: [],
areaOptions: [], areaOptions: [],
@@ -305,19 +227,15 @@ export default {
}, },
exportFile() { exportFile() {
const columns = [ const columns = [
{ {
title: "行政区划代码", title: "监测日期",
dataIndex: "regionCode", dataIndex: "monitorTime",
sorter: true, sorter: true,
customRender: ({text})=> moment(text).format("YYYY-MM-DD HH:mm")
}, },
{ {
title: "监测年度", title: "城市",
dataIndex: "monitorYear", dataIndex: "city",
sorter: true,
},
{
title: "点位编码",
dataIndex: "placeCode",
sorter: true, sorter: true,
}, },
{ {
@@ -325,132 +243,54 @@ export default {
dataIndex: "place", dataIndex: "place",
sorter: true, sorter: true,
}, },
{ {
title: "测点经度", title: "SO2/(μg/m3)",
dataIndex: "placeLng", dataIndex: "so2",
sorter: true,
},
{
title: "测点纬度",
dataIndex: "placeLat",
sorter: true,
},
{
title: "测点参照物",
dataIndex: "refObj",
sorter: true, sorter: true,
}, },
{ {
title: "网格边长", title: "NO2/(μg/m3)",
dataIndex: "gridLength", dataIndex: "no2",
sorter: true,
},
{
title: "网格覆盖人口(万)",
dataIndex: "people",
sorter: true, sorter: true,
}, },
{ {
title: "功能区代码", title: "PM10/(μg/m3)",
dataIndex: "functionCode", dataIndex: "pm10",
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, sorter: true,
}, },
{ {
title: "最小值", title: "CO/(mg/m3)",
dataIndex: "indexLmin", dataIndex: "co",
sorter: true, sorter: true,
}, },
{ {
title: "标准差(SD)", title: "臭氧O3最大8小时滑动平均浓度/(μg/m3)",
dataIndex: "indexSd", dataIndex: "o3",
sorter: true, sorter: true,
}, },
{ {
title: "监测站名", title: "PM2.5",
dataIndex: "station", dataIndex: "pm25",
sorter: true, sorter: true,
}, },
{ {
title: "监测仪器型号", title: "空气质量指数AQI",
dataIndex: "monitorInstrumentModel", dataIndex: "aqi",
sorter: true, sorter: true,
}, },
{ {
title: "监测仪器编号", title: "首要污染物",
dataIndex: "monitorInstrumentCode", dataIndex: "primaryPollutant",
sorter: true, sorter: true,
}, },
{ {
title: "监测前校准值", title: "空气质量指数级别",
dataIndex: "beforeMonitorValue", dataIndex: "aqiLevel",
sorter: true, sorter: true,
}, },
{ {
title: "声校准器测量声压值", title: "空气质量状况",
dataIndex: "soundPressureValue", dataIndex: "airQualityStatus",
sorter: true,
},
{
title: "声校准仪器型号",
dataIndex: "soundInstrumentModel",
sorter: true,
},
{
title: "声校准仪器编号",
dataIndex: "soundInstrumentCode",
sorter: true,
},
{
title: "区域等级",
dataIndex: "regionLevel",
sorter: true, sorter: true,
}, },
{ {
@@ -458,6 +298,11 @@ export default {
dataIndex: "remark", dataIndex: "remark",
sorter: true, sorter: true,
}, },
{
title: "创建人",
dataIndex: "username",
sorter: true,
},
]; ];
const arr = []; const arr = [];
const th = columns.map((item) => item.title); const th = columns.map((item) => item.title);

View File

@@ -66,14 +66,14 @@
</a-button> </a-button>
</a-form-item> </a-form-item>
<div class="ele-text-center" style="padding-bottom: 32px;"> <div class="ele-text-center" style="padding-bottom: 32px;">
<qq-outlined class="login-oauth-icon" style="background: #3492ed;"/> <!-- <qq-outlined class="login-oauth-icon" style="background: #3492ed;"/>
<wechat-outlined class="login-oauth-icon" style="background: #4daf29;"/> <wechat-outlined class="login-oauth-icon" style="background: #4daf29;"/>
<weibo-outlined class="login-oauth-icon" style="background: #CF1900;"/> <weibo-outlined class="login-oauth-icon" style="background: #CF1900;"/> -->
</div> </div>
</a-form> </a-form>
<div class="login-copyright">copyright © 2021 eleadmin.com all rights reserved.</div> <!-- <div class="login-copyright">copyright © 2021 eleadmin.com all rights reserved.</div> -->
<!-- 多语言切换 --> <!-- 多语言切换 -->
<div style="position: absolute;right: 30px;top: 20px;z-index: 999;"> <!-- <div style="position: absolute;right: 30px;top: 20px;z-index: 999;">
<a-dropdown placement="bottomLeft" :overlay-style="{minWidth: '120px'}"> <a-dropdown placement="bottomLeft" :overlay-style="{minWidth: '120px'}">
<global-outlined style="font-size: 18px;color: #fff;"/> <global-outlined style="font-size: 18px;color: #fff;"/>
<template #overlay> <template #overlay>
@@ -84,15 +84,15 @@
</a-menu> </a-menu>
</template> </template>
</a-dropdown> </a-dropdown>
</div> </div> -->
<!-- 实际项目去掉这段 --> <!-- 实际项目去掉这段 -->
<div style="position: absolute;left: 30px;top: 20px;z-index: 999;"> <!-- <div style="position: absolute;left: 30px;top: 20px;z-index: 999;">
<a-radio-group v-model:value="direction" size="small"> <a-radio-group v-model:value="direction" size="small">
<a-radio-button :value="2">居左</a-radio-button> <a-radio-button :value="2">居左</a-radio-button>
<a-radio-button :value="0">居中</a-radio-button> <a-radio-button :value="0">居中</a-radio-button>
<a-radio-button :value="1">居右</a-radio-button> <a-radio-button :value="1">居右</a-radio-button>
</a-radio-group> </a-radio-group>
</div> </div> -->
</div> </div>
</template> </template>
@@ -101,10 +101,10 @@ import {
UserOutlined, UserOutlined,
LockOutlined, LockOutlined,
SafetyCertificateOutlined, SafetyCertificateOutlined,
QqOutlined, // QqOutlined,
WechatOutlined, // WechatOutlined,
WeiboOutlined, // WeiboOutlined,
GlobalOutlined // GlobalOutlined
} from '@ant-design/icons-vue'; } from '@ant-design/icons-vue';
import setting from '@/config/setting'; import setting from '@/config/setting';
@@ -114,10 +114,10 @@ export default {
UserOutlined, UserOutlined,
LockOutlined, LockOutlined,
SafetyCertificateOutlined, SafetyCertificateOutlined,
QqOutlined, // QqOutlined,
WechatOutlined, // WechatOutlined,
WeiboOutlined, // WeiboOutlined,
GlobalOutlined // GlobalOutlined
}, },
data() { data() {
return { return {

View File

@@ -0,0 +1,223 @@
<template>
<div class="ele-body">
<a-card class="ele-card" :bordered="false">
<a-space>
<a-select @change="whereChange" v-model:value="where.monitorYear">
<a-select-option v-for="item in yearOptions" :key="item.value">{{
item.label
}}</a-select-option>
</a-select>
<a-radio-group @change="whereChange" v-model:value="where.type">
<a-radio-button value="place"> 点位 </a-radio-button>
<a-radio-button value="area"> 城区 </a-radio-button>
</a-radio-group>
<a-radio-group @change="whereChange" v-model:value="where.timeSlot">
<a-radio-button value="昼"></a-radio-button>
<a-radio-button value="夜"></a-radio-button>
</a-radio-group>
<!-- <a-button @click="exportMap">导出</a-button> -->
</a-space>
</a-card>
<div id="map"></div>
</div>
</template>
<script>
// import axios from "axios";
import { Scene, PointLayer, Popup } from "@antv/l7";
// import { DrawControl } from '@antv/l7-draw';
import { CityLayer } from "@antv/l7-district";
import { GaodeMap } from "@antv/l7-maps";
import {
getGisBase,
getGisArea,
getColumnOptions,
} from "@/api/ecology/function-sound";
let scene = null;
let pointLayer = null;
let cityLayer = null;
export default {
data() {
return {
yearOptions: [],
where: {
timeSlot: "昼",
type: "area",
monitorYear: "选择年份",
},
};
},
mounted() {
scene = new Scene({
id: "map",
map: new GaodeMap({
style: "light",
center: [108.33, 22.84],
// pitch: 48.62562,
// rotation: -0.76,
zoom: 12,
}),
});
scene.on("loaded", () => {
this.initData();
});
// const control = new DrawControl(scene, {
// });
},
methods: {
initData() {
getColumnOptions("monitor_year").then((res) => {
if (res.data.code == 0) {
this.yearOptions = res.data.data.map((item) => {
return {
label: item,
value: item,
};
});
this.where.monitorYear = res.data.data[res.data.data.length - 1];
this.whereChange();
}
});
},
setPlaceData() {},
whereChange() {
if (this.where.type == "place") {
getGisBase(this.where).then((res) => {
if (res.data.code == 0) {
if(cityLayer){
cityLayer.destroy()
scene.removeLayer(cityLayer)
}
pointLayer = new PointLayer({})
.source(res.data.data, {
parser: {
type: "json",
x: "lng",
y: "lat",
},
})
.shape("cylinder")
.size("leq", function (level) {
return [4, 4, level];
})
.active(true)
.color("leq", (leq) => {
const { timeSlot } = this.where;
const color =
timeSlot == "昼"
? leq > 70
? "#f5222d"
: "#13c2c2"
: leq > 65
? "#f5222d"
: "#13c2c2";
return color;
})
.style({
opacity: 1,
});
pointLayer.on("mousemove", (e) => {
const popup = new Popup({
offsets: [0, 0],
closeButton: false,
})
.setLnglat(e.lngLat)
.setHTML(
`<span>${e.feature.place}: ${e.feature.leq}dB(A)</span>`
);
scene.addPopup(popup);
});
pointLayer.setData(res.data.data);
scene.addLayer(pointLayer);
scene.setZoomAndCenter(12, [108.33, 22.84]);
scene.setPitch(48);
scene.render()
}
});
} else {
getGisArea(this.where).then((res) => {
if (res.data.code == 0) {
if(pointLayer){
pointLayer.destroy()
scene.removeLayer(pointLayer)
}
cityLayer = new CityLayer(scene, {
data: res.data.data,
joinBy: ["adcode", "regionCode"],
adcode: ["450000", "450100"],
depth: 3,
visible: true,
label: {
field: "NAME_CHN",
textAllowOverlap: false,
},
fill: {
color: {
field: "leq",
values: (leq) => {
if(!leq){
return
}
const { timeSlot } = this.where;
const color =
timeSlot == "昼"
? leq > 70
? "#f50"
: "#2db7f5"
: leq > 65
? "#f50"
: "#2db7f5";
return color;
},
},
},
popup: {
enable: true,
triggerEvent: "mousemove",
Html: (props) => {
return `<span>${props.NAME_CHN}:</span><span>${props.leq + "dB(A)" || "无"}</span>`;
},
},
});
scene.setPitch(0);
// scene.setZoomAndCenter(12, [108.33, 22.84]);
}
});
}
},
getAreaData() {},
exportMap(){
console.log("exportMap");
scene.exportMap("png");
}
},
};
</script>
<style scoped>
::-webkit-scrollbar {
display: none;
}
html,
body {
overflow: hidden;
margin: 0;
}
.ele-body {
position: relative;
height: 100%;
padding: 16px 0;
}
.ele-card {
z-index: 10;
margin: 0 16px;
display: inline-block;
}
#map {
position: absolute;
top: 0;
bottom: 0;
width: 100%;
}
</style>

View File

@@ -1,64 +1,200 @@
<template> <template>
<div> <div class="ele-body">
<a-card class="ele-card" :bordered="false">
<a-space>
<a-select @change="whereChange" v-model:value="where.monitorYear">
<a-select-option v-for="item in yearOptions" :key="item.value">{{
item.label
}}</a-select-option>
</a-select>
<a-radio-group @change="whereChange" v-model:value="where.type">
<a-radio-button value="place"> 点位 </a-radio-button>
<a-radio-button value="area"> 城区 </a-radio-button>
</a-radio-group>
<a-radio-group @change="whereChange" v-model:value="where.timeSlot">
<a-radio-button value="昼"></a-radio-button>
<a-radio-button value="夜"></a-radio-button>
</a-radio-group>
<!-- <a-button @click="exportMap">导出</a-button> -->
</a-space>
</a-card>
<div id="map"></div> <div id="map"></div>
</div> </div>
</template> </template>
<script> <script>
import { Scene, PointLayer } from '@antv/l7'; // import axios from "axios";
import { GaodeMap } from '@antv/l7-maps'; import { Scene, PointLayer, Popup } from "@antv/l7";
// import { DrawControl } from '@antv/l7-draw';
import { CityLayer } from "@antv/l7-district";
import { GaodeMap } from "@antv/l7-maps";
import {
getGisBase,
getGisArea,
getColumnOptions,
} from "@/api/ecology/road-sound";
let scene = null;
let pointLayer = null;
let cityLayer = null;
export default { export default {
data() { data() {
return {}; return {
yearOptions: [],
where: {
timeSlot: "昼",
type: "area",
monitorYear: "选择年份",
},
};
}, },
mounted() { mounted() {
const scene = new Scene({ scene = new Scene({
id: 'map', id: "map",
map: new GaodeMap({ map: new GaodeMap({
pitch: 0, style: "light",
style: 'light', center: [108.33, 22.84],
center: [ 121.435159, 31.256971 ], // pitch: 48.62562,
zoom: 14.89, // rotation: -0.76,
minZoom: 10 zoom: 12,
}) }),
}); });
fetch(
'https://gw.alipayobjects.com/os/basement_prod/893d1d5f-11d9-45f3-8322-ee9140d288ae.json' scene.on("loaded", () => {
) this.initData();
.then(res => res.json()) });
.then(data => {
const pointLayer = new PointLayer({}) // const control = new DrawControl(scene, {
.source(data, { // });
parser: { },
type: 'json', methods: {
x: 'longitude', initData() {
y: 'latitude' getColumnOptions("monitor_year").then((res) => {
if (res.data.code == 0) {
this.yearOptions = res.data.data.map((item) => {
return {
label: item,
value: item,
};
});
this.where.monitorYear = res.data.data[res.data.data.length - 1];
this.whereChange();
} }
})
.shape('name', [
'circle',
'triangle',
'square',
'pentagon',
'hexagon',
'octogon',
'hexagram',
'rhombus',
'vesica'
])
.size('unit_price', [ 10, 25 ])
.color('name', [ '#5B8FF9', '#5CCEA1', '#5D7092', '#F6BD16', '#E86452' ])
.style({
opacity: 0.3,
strokeWidth: 2
}); });
},
scene.addLayer(pointLayer); setPlaceData() {},
}); whereChange() {
if (this.where.type == "place") {
} getGisBase(this.where).then((res) => {
if (res.data.code == 0) {
if(cityLayer){
cityLayer.destroy()
scene.removeLayer(cityLayer)
}
pointLayer = new PointLayer({})
.source(res.data.data, {
parser: {
type: "json",
x: "lng",
y: "lat",
},
})
.shape("cylinder")
.size("leq", function (level) {
return [4, 4, level];
})
.active(true)
.color("leq", (leq) => {
const { timeSlot } = this.where;
const color =
timeSlot == "昼"
? leq > 70
? "#f5222d"
: "#13c2c2"
: leq > 65
? "#f5222d"
: "#13c2c2";
return color;
})
.style({
opacity: 1,
});
pointLayer.on("mousemove", (e) => {
const popup = new Popup({
offsets: [0, 0],
closeButton: false,
})
.setLnglat(e.lngLat)
.setHTML(
`<span>${e.feature.place}: ${e.feature.leq}dB(A)</span>`
);
scene.addPopup(popup);
});
pointLayer.setData(res.data.data);
scene.addLayer(pointLayer);
scene.setZoomAndCenter(12, [108.33, 22.84]);
scene.setPitch(48);
scene.render()
}
});
} else {
getGisArea(this.where).then((res) => {
if (res.data.code == 0) {
if(pointLayer){
pointLayer.destroy()
scene.removeLayer(pointLayer)
}
cityLayer = new CityLayer(scene, {
data: res.data.data,
joinBy: ["adcode", "regionCode"],
adcode: ["450000", "450100"],
depth: 3,
visible: true,
label: {
field: "NAME_CHN",
textAllowOverlap: false,
},
fill: {
color: {
field: "leq",
values: (leq) => {
if(!leq){
return
}
const { timeSlot } = this.where;
const color =
timeSlot == "昼"
? leq > 70
? "#f50"
: "#2db7f5"
: leq > 65
? "#f50"
: "#2db7f5";
return color;
},
},
},
popup: {
enable: true,
triggerEvent: "mousemove",
Html: (props) => {
return `<span>${props.NAME_CHN}:</span><span>${props.leq + "dB(A)" || "无"}</span>`;
},
},
});
scene.setPitch(0);
// scene.setZoomAndCenter(12, [108.33, 22.84]);
}
});
}
},
getAreaData() {},
exportMap(){
console.log("exportMap");
scene.exportMap("png");
}
},
}; };
</script> </script>
<style> <style scoped>
::-webkit-scrollbar { ::-webkit-scrollbar {
display: none; display: none;
} }
@@ -68,7 +204,16 @@ body {
overflow: hidden; overflow: hidden;
margin: 0; margin: 0;
} }
.ele-body {
position: relative;
height: 100%;
padding: 16px 0;
}
.ele-card {
z-index: 10;
margin: 0 16px;
display: inline-block;
}
#map { #map {
position: absolute; position: absolute;
top: 0; top: 0;