字典,统计

This commit is contained in:
weicw
2021-09-15 18:38:16 +08:00
parent c18e732ef4
commit 9c1f1c1b8c
68 changed files with 3856 additions and 779 deletions

View File

@@ -0,0 +1,32 @@
import axios from 'axios';
const baseUri = "/sound/function/functionType";
const listAllUrl = baseUri + "";
// 添加
const saveFunctionType = function (data) {
return axios.post("/sound/function/functionType",data)
}
// 删除
const removeFunctionType = function (id) {
return axios.delete(`/sound/function/functionType/${id}`,)
}
// 批量删除
const removeBatchFunctionType = function (ids) {
return axios.delete("/sound/function/functionType/batch",{data:ids})
}
// 修改
const updateFunctionType = function (data) {
return axios.put("/sound/function/functionType",data)
}
export {
listAllUrl,
saveFunctionType,
updateFunctionType,
removeBatchFunctionType,
removeFunctionType
}

View File

@@ -0,0 +1,32 @@
import axios from 'axios';
const baseUri = "/sound/function/noiseLeqLevel";
const listAllUrl = baseUri + "";
// 添加
const saveLeqLevel = function (data) {
return axios.post("/sound/function/noiseLeqLevel",data)
}
// 删除
const removeLeqLevel = function (id) {
return axios.delete(`/sound/function/noiseLeqLevel/${id}`,)
}
// 批量删除
const removeBatchLeqLevel = function (ids) {
return axios.delete("/sound/function/noiseLeqLevel/batch",{data:ids})
}
// 修改
const updateLeqLevel = function (data) {
return axios.put("/sound/function/noiseLeqLevel",data)
}
export {
listAllUrl,
saveLeqLevel,
updateLeqLevel,
removeBatchLeqLevel,
removeLeqLevel
}

View File

@@ -0,0 +1,32 @@
import axios from 'axios';
const baseUri = "/sound/function/place";
const listAllUrl = baseUri + "";
// 添加
const savePlace = function (data) {
return axios.post("/sound/function/place",data)
}
// 删除
const removePlace = function (id) {
return axios.delete(`/sound/function/place/${id}`,)
}
// 批量删除
const removeBatchPlace = function (ids) {
return axios.delete("/sound/function/place/batch",{data:ids})
}
// 修改
const updatePlace = function (data) {
return axios.put("/sound/function/place",data)
}
export {
listAllUrl,
savePlace,
updatePlace,
removeBatchPlace,
removePlace
}

View File

@@ -0,0 +1,32 @@
import axios from 'axios';
const baseUri = "/sound/road/noiseLeqLevel";
const listAllUrl = baseUri + "";
// 添加
const saveLeqLevel = function (data) {
return axios.post("/sound/road/noiseLeqLevel",data)
}
// 删除
const removeLeqLevel = function (id) {
return axios.delete(`/sound/road/noiseLeqLevel/${id}`,)
}
// 批量删除
const removeBatchLeqLevel = function (ids) {
return axios.delete("/sound/road/noiseLeqLevel/batch",{data:ids})
}
// 修改
const updateLeqLevel = function (data) {
return axios.put("/sound/road/noiseLeqLevel",data)
}
export {
listAllUrl,
saveLeqLevel,
updateLeqLevel,
removeBatchLeqLevel,
removeLeqLevel
}

View File

@@ -0,0 +1,32 @@
import axios from 'axios';
const baseUri = "/sound/road/place";
const listAllUrl = baseUri + "";
// 添加
const savePlace = function (data) {
return axios.post("/sound/road/place",data)
}
// 删除
const removePlace = function (id) {
return axios.delete(`/sound/road/place/${id}`,)
}
// 批量删除
const removeBatchPlace = function (ids) {
return axios.delete("/sound/road/place/batch",{data:ids})
}
// 修改
const updatePlace = function (data) {
return axios.put("/sound/road/place",data)
}
export {
listAllUrl,
savePlace,
updatePlace,
removeBatchPlace,
removePlace
}

View File

@@ -56,6 +56,7 @@ const updateRoadNoise = function (data) {
// -------------------------统计--------------------- // -------------------------统计---------------------
const pageRoadNoiseStatisticUrl = '/sound/road/noise/statistic'; const pageRoadNoiseStatisticUrl = '/sound/road/noise/statistic';
const pageRoadNoiseCompare = '/sound/road/noise/statistic/compare'; const pageRoadNoiseCompare = '/sound/road/noise/statistic/compare';
const roadNoiseYearEnd = '/sound/road/noise/statistic/yearEnd';
const getHistoryyears = function () { const getHistoryyears = function () {
return axios.get("/sound/road/noise/history-year") return axios.get("/sound/road/noise/history-year")
} }
@@ -89,6 +90,7 @@ export {
getColumnOptions, getColumnOptions,
listAll, listAll,
getGisBase, getGisBase,
getGisArea getGisArea,
roadNoiseYearEnd
} }

View File

@@ -0,0 +1,37 @@
import axios from "axios";
// const baseUri = "/api/waterFunctionArea/surfaceWaterEvaluationStandard";
// 分页
const pageSurfaceWaterStandardUrl = '/waterFunctionArea/surfaceWaterEvaluationStandard/page';
const pageSurfaceWaterStandardAllUrl = '/waterFunctionArea/surfaceWaterEvaluationStandard';
// 全部
const listAllSurfaceWaterStandard = function (){
return axios .get("/waterFunctionArea/surfaceWaterEvaluationStandard")
}
// 添加
const saveSurfaceWaterStandard = function (data) {
return axios.post("/waterFunctionArea/surfaceWaterEvaluationStandard",data)
}
// 删除
const removeSurfaceWaterStandard = function (id) {
return axios.delete(`/waterFunctionArea/surfaceWaterEvaluationStandard/${id}`,)
}
// 批量删除
const removeBatchSurfaceWaterStandard = function (ids) {
return axios.delete("/waterFunctionArea/surfaceWaterEvaluationStandard/batch",{data:ids})
}
// 修改
const updateSurfaceWaterStandard = function (data) {
return axios.put("/waterFunctionArea/surfaceWaterEvaluationStandard",data)
}
export {
pageSurfaceWaterStandardUrl,
updateSurfaceWaterStandard,
removeBatchSurfaceWaterStandard,
removeSurfaceWaterStandard,
listAllSurfaceWaterStandard,
saveSurfaceWaterStandard,
pageSurfaceWaterStandardAllUrl
}

View File

@@ -52,7 +52,7 @@
<script> <script>
// import _ from "lodash"; // import _ from "lodash";
import XLSX from "xlsx"; import XLSX from "xlsx";
import { pageZoneNoiseStatisticUrl, getColumnOptions } from "@/api/ecology/zone-sound"; import { pageZoneNoiseStatisticUrl, getColumnOptions } from "@/api/ecology/noise/zone-sound";
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 utils from "./utils"; // import utils from "./utils";
export default { export default {

View File

@@ -52,7 +52,7 @@
<script> <script>
// import _ from "lodash"; // import _ from "lodash";
import XLSX from "xlsx"; import XLSX from "xlsx";
import { statisticSourceUrl, getColumnOptions } from "@/api/ecology/zone-sound"; import { statisticSourceUrl, getColumnOptions } from "@/api/ecology/noise/zone-sound";
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 utils from "./utils"; // import utils from "./utils";
export default { export default {

View File

@@ -65,7 +65,7 @@
<script> <script>
// import _ from "lodash"; // import _ from "lodash";
import XLSX from "xlsx"; import XLSX from "xlsx";
import { statisticYearUrl, getColumnOptions } from "@/api/ecology/zone-sound"; import { statisticYearUrl, getColumnOptions } from "@/api/ecology/noise/zone-sound";
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 utils from "./utils"; // import utils from "./utils";
export default { export default {

View File

@@ -33,7 +33,7 @@ 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 NoiseBill from "./noise-bill.vue";
import { saveFunctionNoiseBill } from "@/api/ecology/function-sound"; import { saveFunctionNoiseBill } from "@/api/ecology/noise/function-sound";
export default { export default {
name: "FunctionCollectIndex", name: "FunctionCollectIndex",
components: { components: {

View File

@@ -112,7 +112,7 @@
removeBatchFunctionNoiseBill, removeBatchFunctionNoiseBill,
updateFunctionNoiseBill, updateFunctionNoiseBill,
verifyFunctionNoiseBill verifyFunctionNoiseBill
} from "@/api/ecology/function-sound"; } from "@/api/ecology/noise/function-sound";
import moment from "moment"; import moment from "moment";
export default { export default {
name: 'FunctionCollectNoiseBill', name: 'FunctionCollectNoiseBill',

View File

@@ -391,7 +391,7 @@ import {
updateFunctionNoise, updateFunctionNoise,
getFunctionNoiseBill, getFunctionNoiseBill,
getColumnOptions, getColumnOptions,
} from "@/api/ecology/function-sound"; } from "@/api/ecology/noise/function-sound";
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";

View File

@@ -0,0 +1,297 @@
<template>
<div class="ele-body">
<a-card :bordered="false">
<a-modal
v-model:visible="showEdit"
:title="form.id !== undefined ? '修改' : '添加'"
:confirm-loading="loading"
:width="500"
:body-style="{ paddingBottom: '8px' }"
@ok="save"
>
<a-form
ref="form"
:model="form"
:rules="rules"
:label-col="{ md: { span: 6 }, sm: { span: 24 } }"
:wrapper-col="{ md: { span: 18 }, sm: { span: 24 } }"
>
<a-form-item label="功能区类别" name="functionType">
<a-input
v-model:value="form.functionType"
placeholder="请输入功能区类别"
allow-clear
/>
</a-form-item>
<a-form-item label="功能区代码" name="functionCode">
<a-input
v-model:value="form.functionCode"
placeholder="请输入功能区代码"
allow-clear
/>
</a-form-item>
<a-form-item label="父级功能区类别" name="ParentFunctionType">
<a-input
v-model:value="form.ParentFunctionType"
placeholder="请输入父级功能区类别"
allow-clear
/>
</a-form-item>
<a-form-item label="昼间限值" name="maxLd">
<a-input-number :step="1" :precision="0" v-model:value="form.maxLd" />
</a-form-item>
<a-form-item label="夜间限值" name="maxLn">
<a-input-number :step="1" :precision="0" v-model:value="form.maxLn" />
</a-form-item>
<a-form-item label="排序" name="sortNumber">
<a-input-number :step="1" :precision="0" v-model:value="form.sortNumber" />
</a-form-item>
</a-form>
</a-modal>
<!-- 表格 -->
<ele-pro-table
v-model:selection="selectionList"
ref="table"
row-key="id"
:datasource="url"
:columns="columns"
:where="where"
:scroll="{ x: 'max-content' }"
>
<template #toolbar>
<a-space>
<a-button @click="openEdit" type="primary">新增</a-button>
<a-popconfirm
:disabled="selectionList.length == 0"
:title="`确认删除${selectionList.length}条数据吗?`"
ok-text="Yes"
cancel-text="No"
@confirm="removeBatch"
>
<a-button
:disabled="selectionList.length == 0"
type="primary"
ghost
danger
>删除
</a-button>
</a-popconfirm>
</a-space>
</template>
<template #action="{ record }">
<a-space>
<a-button
@click="openEdit(record)"
type="primary"
shape="round"
size="small"
>修改</a-button
>
<a-popconfirm
:title="`确认删除这条数据吗?`"
ok-text="Yes"
cancel-text="No"
@confirm="remove(record)"
>
<a-button type="primary" danger shape="round" size="small"
>删除</a-button
>
</a-popconfirm>
</a-space>
</template>
</ele-pro-table>
</a-card>
</div>
<!-- 编辑弹窗 -->
</template>
<script>
// import _ from "lodash";
import {
listAllUrl,
saveFunctionType,
updateFunctionType,
removeFunctionType,
removeBatchFunctionType
} from "@/api/ecology/noise/function-noise-function-type";
// import moment from "moment";
export default {
name: "FunctionNoiseFunctionType",
components: {},
data() {
return {
data: [],
// 表格数据接口
url: listAllUrl,
selection: [],
// 表格列配置
columns: [
{
title: "功能区类别",
dataIndex: "functionType",
},
{
title: "功能区代码",
dataIndex: "functionCode",
},
{
title: "父级功能区类别",
dataIndex: "parentFunctionType",
},
{
title: "昼间限值",
dataIndex: "maxLd",
customRender: ({text})=>{
return text!=undefined? text.toFixed(0):undefined
}
},
{
title: "夜间限值",
dataIndex: "maxLn",
customRender: ({text})=>{
return text!=undefined? text.toFixed(0):undefined
}
},
{
title: "排序",
dataIndex: "sortNumber",
},
{
title: "操作",
key: "action",
width: 150,
align: "center",
fixed: "right",
slots: {
customRender: "action",
},
},
],
// 表格搜索条件
where: {},
// 表格选中数据
selectionList: [],
// 是否显示编辑弹窗
showEdit: false,
// 表单数据
form: {},
loading: false,
rules: {
functionType:[{required: true,message: '请输入功能区类别'}],
functionCode:[{required: true,message: '请输入功能区代码'}],
maxLd: [{required: true,message: '请输入昼间限值',},],
maxLn: [{required: true,message: '请输入夜间限值',},],
// evaluate: [{required: true,message: '请输入评价',},],
sortNumber: [{required: true,message: '请输入排序',},],
},
};
},
mounted() {
},
methods: {
minLeqChange(e){
console.log(e)
},
/* 刷新表格 */
reload() {
this.$refs.table.reload({
where: this.where,
});
},
/* 重置搜索 */
reset() {
this.where = {};
this.reload();
},
/* 打开编辑弹窗 */
openEdit(row) {
// cloneRecord.mi
this.form = Object.assign({}, row);
this.showEdit = true;
this.$nextTick(() => {
this.$refs.form.clearValidate(); // 清除表单验证信息
});
},
async save() {
await this.$refs.form.validate();
const hide = this.$message.loading('请求中..', 0);
const form = this.form;
if (form.id) {
updateFunctionType(form)
.then((res) => {
if (res.data.code == 0) {
this.showEdit = false;
this.$message.success(res.data.msg);
this.reload();
} else {
this.$message.error(res.data.msg);
}
})
.catch((error) => {
this.$message.error(error.message);
})
.finally(() => {
hide();
});
} else {
saveFunctionType(form)
.then((res) => {
if (res.data.code == 0) {
this.showEdit = false;
this.$message.success(res.data.msg);
this.reload();
} else {
this.$message.error(res.data.msg);
}
})
.catch((error) => {
this.$message.error(error.message);
})
.finally(() => {
hide();
});
}
},
/* 删除单个 */
remove(row) {
const hide = this.$message.loading('请求中..', 0);
removeFunctionType(row.id).then((res) => {
hide();
if (res.data.code === 0) {
this.$message.success(res.data.msg);
this.reload();
} else {
this.$message.error(res.data.msg);
}
}).catch(e => {
hide();
this.$message.error(e.message);
})
},
/* 批量删除 */
removeBatch() {
const hide = this.$message.loading('请求中..', 0);
const ids = this.selectionList.map((item) => item.id);
removeBatchFunctionType(ids).then((res) => {
if (res.data.code === 0) {
this.$message.success(res.data.msg);
this.reload();
} else {
this.$message.error(res.data.msg);
}
}).catch(e => {
this.$message.error(e.message);
}).finally(() => {
hide();
})
}
},
};
</script>
<style scoped lang="less">
</style>

View File

@@ -0,0 +1,46 @@
<template>
<div class="ele-body">
<a-card :bordered="false">
<a-tabs v-model:activeKey="activeKey">
<a-tab-pane key="place" tab="点位信息">
<place></place>
</a-tab-pane>
<a-tab-pane key="leqLevel" tab="功能区类别信息">
<function-type></function-type>
</a-tab-pane>
</a-tabs>
</a-card>
</div>
</template>
<script>
/**
*
*
*
*/
import FunctionType from "./function-type"
import Place from "./place"
export default {
name: 'FunctionNoiseDictIndex',
components: {
FunctionType,
Place
},
data() {
return {
activeKey: 'place'
};
},
methods: {}
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,349 @@
<template>
<div class="ele-body">
<a-card :bordered="false">
<a-modal
v-model:visible="showEdit"
:title="form.roadNoisePlaceId !== undefined ? '修改' : '添加'"
:confirm-loading="loading"
:width="800"
:body-style="{ paddingBottom: '8px' }"
@ok="save"
>
<a-form
ref="form"
:model="form"
:rules="rules"
:label-col="{ md: { span: 6 }, sm: { span: 24 } }"
:wrapper-col="{ md: { span: 18 }, sm: { span: 24 } }"
>
<a-form-item label="测点名称" name="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="placeHeight">
<a-input v-model:value="form.placeHeight" placeholder="请输入测点高度" allow-clear />
</a-form-item>
<a-form-item label="功能区类型" name="functionType">
<a-input v-model:value="form.functionType" placeholder="请输入功能区类型" allow-clear />
</a-form-item>
<a-form-item label="功能区代码" name="functionCode">
<a-input v-model:value="form.functionCode" placeholder="请输入功能区代码" allow-clear />
</a-form-item>
<a-form-item label="测点经度" name="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="refObj">
<a-input v-model:value="form.refObj" placeholder="请输入测点参照物" allow-clear />
</a-form-item>
<a-form-item label="监测站名" name="station">
<a-input v-model:value="form.station" placeholder="请输入监测站名" allow-clear />
</a-form-item>
<a-form-item label="监测仪器型号" name="monitorInstrumentModel">
<a-input v-model:value="form.monitorInstrumentModel" placeholder="请输入测监测仪器型号" allow-clear />
</a-form-item>
<a-form-item label="监测仪器编号" name="monitorInstrumentCode">
<a-input v-model:value="form.monitorInstrumentCode" placeholder="请输入监测仪器编号" allow-clear />
</a-form-item>
<a-form-item label="监测前校准值" name="beforeMonitorValue">
<a-input v-model:value="form.beforeMonitorValue" placeholder="请输入监测前校准值" allow-clear />
</a-form-item>
<a-form-item label="监测后校准值" name="afterMonitorValue">
<a-input v-model:value="form.afterMonitorValue" placeholder="请输入监测后校准值" allow-clear />
</a-form-item>
<a-form-item label="声校准器测量声压值" name="soundPressureValue">
<a-input v-model:value="form.soundPressureValue" placeholder="请输入声校准器测量声压值" allow-clear />
</a-form-item>
<a-form-item label="声校准仪器型号" name="soundInstrumentModel">
<a-input v-model:value="form.soundInstrumentModel" placeholder="请输入声校准仪器型号" allow-clear />
</a-form-item>
<a-form-item label="声校准仪器编号" name="soundInstrumentCode">
<a-input v-model:value="form.soundInstrumentCode" placeholder="请输入声校准仪器编号" allow-clear />
</a-form-item>
</a-form>
</a-modal>
<!-- 表格 -->
<ele-pro-table
v-model:selection="selectionList"
ref="table"
row-key="functionNoisePlaceId"
:datasource="url"
:columns="columns"
:where="where"
:scroll="{ x: 'max-content' }"
>
<template #toolbar>
<a-space>
<a-button @click="openEdit" type="primary">新增</a-button>
<a-popconfirm
:disabled="selectionList.length == 0"
:title="`确认删除${selectionList.length}条数据吗?`"
ok-text="Yes"
cancel-text="No"
@confirm="removeBatch"
>
<a-button
:disabled="selectionList.length == 0"
type="primary"
ghost
danger
>删除
</a-button>
</a-popconfirm>
</a-space>
</template>
<template #action="{ record }">
<a-space>
<a-button
@click="openEdit(record)"
type="primary"
shape="round"
size="small"
>修改</a-button
>
<a-popconfirm
:title="`确认删除这条数据吗?`"
ok-text="Yes"
cancel-text="No"
@confirm="remove(record)"
>
<a-button type="primary" danger shape="round" size="small"
>删除</a-button
>
</a-popconfirm>
</a-space>
</template>
</ele-pro-table>
</a-card>
</div>
<!-- 编辑弹窗 -->
</template>
<script>
// import _ from "lodash";
import {
listAllUrl,
savePlace,
updatePlace,
removePlace,
removeBatchPlace
} from "@/api/ecology/noise/function-noise-place";
// import moment from "moment";
export default {
name: "FunctionNoisePlace",
components: {},
data() {
return {
data: [],
// 表格数据接口
url: listAllUrl,
selection: [],
// 表格列配置
columns: [
{
title: "测点名称",
dataIndex: "placeName",
sorter: true,
},
{
title: "点位编码",
dataIndex: "placeCode",
sorter: true,
},
{
title: "功能区类别",
dataIndex: "functionType",
sorter: true,
},
{
title: "功能区代码",
dataIndex: "functionCode",
sorter: true,
},
{
title: "测点经度",
dataIndex: "placeLng",
sorter: true,
},
{
title: "测点纬度",
dataIndex: "placeLat",
sorter: true,
},
{
title: "测点参照物",
dataIndex: "refObj",
sorter: true,
},
{
title: "监测站名",
dataIndex: "station",
sorter: true,
},
{
title: "监测仪器型号",
dataIndex: "monitorInstrumentModel",
sorter: true,
},
{
title: "监测仪器编号",
dataIndex: "monitorInstrumentCode",
sorter: true,
},
{
title: "监测前校准值",
dataIndex: "beforeMonitorValue",
sorter: true,
},
{
title: "声校准器测量声压值",
dataIndex: "soundPressureValue",
sorter: true,
},
{
title: "声校准仪器型号",
dataIndex: "soundInstrumentModel",
sorter: true,
},
{
title: "声校准仪器编号",
dataIndex: "soundInstrumentCode",
sorter: true,
},
{
title: "操作",
key: "action",
width: 150,
align: "center",
fixed: "right",
slots: {
customRender: "action",
},
},
],
// 表格搜索条件
where: {},
// 表格选中数据
selectionList: [],
// 是否显示编辑弹窗
showEdit: false,
// 表单数据
form: {},
loading: false,
rules: {
placeName:[{required: true,message: '请选择测点名称'}],
placeLng: [{required: true,message: '请输入测点经度',},],
placeLat: [{required: true,message: '请输入测点纬度',},],
},
};
},
mounted() {
},
methods: {
/* 刷新表格 */
reload() {
this.$refs.table.reload({
where: this.where,
});
},
/* 重置搜索 */
reset() {
this.where = {};
this.reload();
},
/* 打开编辑弹窗 */
openEdit(row) {
// cloneRecord.mi
this.form = Object.assign({}, row);
this.showEdit = true;
this.$nextTick(() => {
this.$refs.form.clearValidate(); // 清除表单验证信息
});
},
async save() {
await this.$refs.form.validate();
const hide = this.$message.loading('请求中..', 0);
const form = this.form;
if (form.functionNoisePlaceId) {
updatePlace(form)
.then((res) => {
if (res.data.code == 0) {
this.showEdit = false;
this.$message.success(res.data.msg);
this.reload();
} else {
this.$message.error(res.data.msg);
}
})
.catch((error) => {
this.$message.error(error.message);
})
.finally(() => {
hide();
});
} else {
savePlace(form)
.then((res) => {
if (res.data.code == 0) {
this.showEdit = false;
this.$message.success(res.data.msg);
this.reload();
} else {
this.$message.error(res.data.msg);
}
})
.catch((error) => {
this.$message.error(error.message);
})
.finally(() => {
hide();
});
}
},
/* 删除单个 */
remove(row) {
const hide = this.$message.loading('请求中..', 0);
removePlace(row.functionNoisePlaceId).then((res) => {
hide();
if (res.data.code === 0) {
this.$message.success(res.data.msg);
this.reload();
} else {
this.$message.error(res.data.msg);
}
}).catch(e => {
hide();
this.$message.error(e.message);
})
},
/* 批量删除 */
removeBatch() {
const hide = this.$message.loading('请求中..', 0);
const ids = this.selectionList.map((item) => item.functionNoisePlaceId);
removeBatchPlace(ids).then((res) => {
if (res.data.code === 0) {
this.$message.success(res.data.msg);
this.reload();
} else {
this.$message.error(res.data.msg);
}
}).catch(e => {
this.$message.error(e.message);
}).finally(() => {
hide();
})
}
},
};
</script>
<style scoped lang="less">
</style>

View File

@@ -63,7 +63,7 @@ import XLSX from "xlsx";
import { import {
pageFunctionNoiseStatisticUrl, pageFunctionNoiseStatisticUrl,
getColumnOptions, getColumnOptions,
} from "@/api/ecology/function-sound"; } from "@/api/ecology/noise/function-sound";
const columns = [ const columns = [
{ {
title: "功能区类别", title: "功能区类别",

View File

@@ -91,7 +91,7 @@
<script> <script>
// import _ from "lodash"; // import _ from "lodash";
import XLSX from "xlsx"; import XLSX from "xlsx";
import { pageFunctionNoiseUrl, getColumnOptions } from "@/api/ecology/function-sound"; import { pageFunctionNoiseUrl, getColumnOptions } from "@/api/ecology/noise/function-sound";
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";

View File

@@ -106,7 +106,7 @@ import XLSX from "xlsx";
import { import {
pageFunctionNoiseCompare, pageFunctionNoiseCompare,
getHistoryyears, getHistoryyears,
} from "@/api/ecology/function-sound"; } from "@/api/ecology/noise/function-sound";
export default { export default {
name: "StatisticSoundFunctionCompare", name: "StatisticSoundFunctionCompare",
components: {}, components: {},

View File

@@ -63,7 +63,7 @@ import XLSX from "xlsx";
import { import {
pageFunctionNoiseStatisticUrl, pageFunctionNoiseStatisticUrl,
getColumnOptions, getColumnOptions,
} from "@/api/ecology/function-sound"; } from "@/api/ecology/noise/function-sound";
const columns = [ const columns = [
{ {
title: "功能区类别", title: "功能区类别",

View File

@@ -47,7 +47,7 @@ import XLSX from "xlsx";
import { import {
pageFunctionNoiseCompare, pageFunctionNoiseCompare,
getHistoryyears, getHistoryyears,
} from "@/api/ecology/function-sound"; } from "@/api/ecology/noise/function-sound";
export default { export default {
name: "StatisticSoundFunctionCompare", name: "StatisticSoundFunctionCompare",
components: {}, components: {},

View File

@@ -1,263 +1,264 @@
<template> <template>
<div class="ele-body"> <div class="ele-body">
<a-card style="width: 100%" :bordered="false"> <a-card style="width: 100%" :bordered="false">
<template #title> <template #title>
<a-space> <a-space>
<a-upload <a-upload
:before-upload="importFileCity" :before-upload="importFileCity"
: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"
: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-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="noise">
<noise-bill ref="noise"></noise-bill> <noise-bill ref="noise"></noise-bill>
</a-tab-pane> </a-tab-pane>
</a-tabs> </a-tabs>
</a-card> </a-card>
</div> </div>
</template> </template>
<script> <script>
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 NoiseBill from "./noise-bill.vue";
import { saveRoadNoiseBill } from "@/api/ecology/road-sound"; import {saveRoadNoiseBill} from "@/api/ecology/noise/road-sound";
export default { export default {
name: "RoadCollectIndex", name: "RoadCollectIndex",
components: { components: {
NoiseBill, 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,
});
let aoa3 = XLSX.utils.sheet_to_json(workbook.Sheets[sheetNames[2]], {
header: 1,
});
const reportDate = aoa[1][0].replace(/[^\d]+/g, "-");
const reportDate2 = aoa2[1][0].replace(/[^\d]+/g, "-");
const roadNoiseList = aoa.filter(
(item) => {
console.log(item.length)
return item.length >= 21 && typeof item[0] == "number"}
);
const roadNoiseList2 = aoa2.filter(
(item) => item.length >= 21 && typeof item[0] == "number"
);
const roadNoiseList3 = aoa3.filter(
(item) => item.length >= 16 && typeof item[1] == "number"
);
// 解析成对象数组
const billName = aoa[0][0];
const billData = utils.toObjData(roadNoiseList);
const billName2 = aoa2[0][0];
const billData2 = utils.toObjData(roadNoiseList2);
// 其他信息
const billData3 = utils.toPlaceData(roadNoiseList3);
if (
(!billData || billData.length == 0) &&
(!billData2 || billData2.length == 0)
) {
hide()
Modal.error({
title: "导入失败",
content: "找不到数据",
});
return;
}
const tasks = [];
if (billData.length > 0) {
billData.forEach((item) => {
Object.assign(
item,
billData3.find((b3Item) => b3Item.place == item.place)
);
});
tasks.push(
saveRoadNoiseBill({
reportTime: new Date(reportDate).getTime(),
billName: billName,
regionLevel: "市级",
roadNoiseList: billData,
})
);
}
if (billData2.length > 0) {
billData.forEach((item) => {
Object.assign(
item,
billData3.find((b3Item) => b3Item.place == item.place)
);
});
tasks.push(
saveRoadNoiseBill({
reportTime: new Date(reportDate2).getTime(),
billName: billName2,
regionLevel: "市级",
roadNoiseList: billData2,
})
);
}
// 上传到服务器
Promise.all(tasks)
.then(() => {
Modal.success({
title: "导入成功",
content: `成功导入${billData.length + billData2.length}条数据`,
});
this.$refs.noise && this.$refs.noise.reload();
this.$refs.place && this.$refs.place.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;
}, },
importFileArea(file) { data() {
const hide = this.$message.loading("导入中..", 0); 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,
});
let aoa3 = XLSX.utils.sheet_to_json(workbook.Sheets[sheetNames[2]], {
header: 1,
});
const reportDate = aoa[1][0].replace(/[^\d]+/g, "-");
const reportDate2 = aoa2[1][0].replace(/[^\d]+/g, "-");
reader.onload = (e) => { const roadNoiseList = aoa.filter(
try { (item) => {
let data = new Uint8Array(e.target.result); console.log(item.length)
let workbook = XLSX.read(data, { return item.length >= 21 && typeof item[0] == "number"
type: "array", }
}); );
//0.昼间数据 1.夜间数据 2.其他信息 const roadNoiseList2 = aoa2.filter(
let sheetNames = workbook.SheetNames; (item) => item.length >= 21 && typeof item[0] == "number"
// 解析成二维数组 );
let aoa = XLSX.utils.sheet_to_json(workbook.Sheets[sheetNames[0]], { const roadNoiseList3 = aoa3.filter(
header: 1, (item) => item.length >= 16 && typeof item[1] == "number"
}); );
const reportDate = aoa[1][0].replace(/[^\d]+/g, "-"); // 解析成对象数组
const roadNoiseList = aoa.filter( const billName = aoa[0][0];
(item) => { const billData = utils.toObjData(roadNoiseList);
const billName2 = aoa2[0][0];
const billData2 = utils.toObjData(roadNoiseList2);
// 其他信息
const billData3 = utils.toPlaceData(roadNoiseList3);
if (
(!billData || billData.length == 0) &&
(!billData2 || billData2.length == 0)
) {
hide()
Modal.error({
title: "导入失败",
content: "找不到数据",
});
return;
}
return item.length >= 35 && item[0] != "行政区划代码" const tasks = [];
} if (billData.length > 0) {
); billData.forEach((item) => {
Object.assign(
item,
billData3.find((b3Item) => b3Item.place == item.place)
);
});
tasks.push(
saveRoadNoiseBill({
reportTime: new Date(reportDate).getTime(),
billName: billName,
regionLevel: "市级",
roadNoiseList: billData,
})
);
}
// 解析成对象数组 if (billData2.length > 0) {
const billName = aoa[0][0]; billData.forEach((item) => {
const billData = utils.toAreaObjData(roadNoiseList); Object.assign(
item,
billData3.find((b3Item) => b3Item.place == item.place)
);
});
tasks.push(
saveRoadNoiseBill({
reportTime: new Date(reportDate2).getTime(),
billName: billName2,
regionLevel: "市级",
roadNoiseList: billData2,
})
);
}
if (!billData || billData.length == 0) { // 上传到服务器
hide();
Modal.error({
title: "导入失败",
content: "找不到可用数据",
});
return; Promise.all(tasks)
} .then(() => {
Modal.success({
if (billData.length > 0) { title: "导入成功",
// 上传到服务器 content: `成功导入${billData.length + billData2.length}条数据`,
saveRoadNoiseBill({ });
reportTime: new Date(reportDate).getTime(), this.$refs.noise && this.$refs.noise.reload();
billName: billName, this.$refs.place && this.$refs.place.reload();
regionLevel: "县级", })
roadNoiseList: billData, .catch(() => {
}) Modal.error({
.then((res) => { title: "导入失败",
if (res.data.code == 0) { content: "数据上传出错",
Modal.success({ });
title: "导入成功", })
content: `成功导入${ .finally(() => {
billData.length hide();
}条数据`, });
}); } catch (error) {
this.$refs.noise && this.$refs.noise.reload(); hide();
} else { Modal.error({
Modal.error({ title: "导入失败",
title: "导入失败", content: error.message,
content: "数据上传出错", });
});
} }
}) // console.log(billData);
.catch(() => { };
Modal.error({ reader.readAsArrayBuffer(file);
title: "导入失败",
content: "数据上传出错", return false;
}); },
}) importFileArea(file) {
.finally(() => { const hide = this.$message.loading("导入中..", 0);
hide();
}); let reader = new FileReader();
}
} catch (error) { reader.onload = (e) => {
hide(); try {
Modal.error({ let data = new Uint8Array(e.target.result);
title: "导入失败", let workbook = XLSX.read(data, {
content: error.message, type: "array",
}); });
} //0.昼间数据 1.夜间数据 2.其他信息
// console.log(billData); let sheetNames = workbook.SheetNames;
}; // 解析成二维数组
reader.readAsArrayBuffer(file); let aoa = XLSX.utils.sheet_to_json(workbook.Sheets[sheetNames[0]], {
return false; header: 1,
});
// const reportDate = aoa[1][0].replace(/[^\d]+/g, "-");
const roadNoiseList = aoa.filter(
(item) => {
return item.length >= 35 && item[0] && !item[0].toString().includes("行政区划代码")
// return item.length >= 35 && item[0] != "行政区划代码"
}
);
// 解析成对象数组
const billName = aoa[0][0];
const billData = utils.toAreaObjData(roadNoiseList);
if (!billData || billData.length == 0) {
hide();
Modal.error({
title: "导入失败",
content: "找不到可用数据",
});
return;
}
if (billData.length > 0) {
// 上传到服务器
saveRoadNoiseBill({
// reportTime: new Date(reportDate).getTime(),
billName: billName,
regionLevel: "县级",
roadNoiseList: 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> </script>

View File

@@ -111,7 +111,7 @@
removeBatchRoadNoiseBill, removeBatchRoadNoiseBill,
updateRoadNoiseBill, updateRoadNoiseBill,
verifyRoadNoiseBill verifyRoadNoiseBill
} from "@/api/ecology/road-sound"; } from "@/api/ecology/noise/road-sound";
import moment from "moment"; import moment from "moment";
export default { export default {
name: 'RoadCollectNoiseBill', name: 'RoadCollectNoiseBill',

View File

@@ -465,7 +465,7 @@ import {
updateRoadNoise, updateRoadNoise,
getRoadNoiseBill, getRoadNoiseBill,
getColumnOptions, getColumnOptions,
} from "@/api/ecology/road-sound"; } from "@/api/ecology/noise/road-sound";
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";
@@ -487,6 +487,9 @@ export default {
title: "监测日期", title: "监测日期",
dataIndex: "monitorTime", dataIndex: "monitorTime",
sorter: true, sorter: true,
customRender: ({text})=>{
return moment(text).format("Y-M-D H:m")
}
}, },
{ {
title: "测点名称", title: "测点名称",

View File

@@ -0,0 +1,46 @@
<template>
<div class="ele-body">
<a-card :bordered="false">
<a-tabs v-model:activeKey="activeKey">
<a-tab-pane key="place" tab="点位信息">
<place></place>
</a-tab-pane>
<a-tab-pane key="leqLevel" tab="Leq等级">
<leq-level></leq-level>
</a-tab-pane>
</a-tabs>
</a-card>
</div>
</template>
<script>
/**
*
*
*
*/
import LeqLevel from "./leq-level"
import Place from "./place"
export default {
name: 'RoadNoiseDictIndex',
components: {
LeqLevel,
Place
},
data() {
return {
activeKey: 'place'
};
},
methods: {}
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,302 @@
<template>
<div class="ele-body">
<a-card :bordered="false">
<a-modal
v-model:visible="showEdit"
:title="form.id !== undefined ? '修改' : '添加'"
:confirm-loading="loading"
:width="500"
:body-style="{ paddingBottom: '8px' }"
@ok="save"
>
<a-form
ref="form"
:model="form"
:rules="rules"
:label-col="{ md: { span: 6 }, sm: { span: 24 } }"
:wrapper-col="{ md: { span: 18 }, sm: { span: 24 } }"
>
<a-form-item label="最小值" name="minLeq">
<a-input-number @change="minLeqChange" :step=".1" :precision="1" v-model:value="form.minLeq" />
</a-form-item>
<a-form-item label="最大值" name="maxLeq">
<a-input-number :step=".1" :precision="1" v-model:value="form.maxLeq" />
</a-form-item>
<a-form-item label="时段" name="timeSlot">
<a-select v-model:value="form.timeSlot">
<a-select-option value="昼"></a-select-option>
<a-select-option value="夜"></a-select-option>
</a-select>
</a-form-item>
<a-form-item label="等级" name="level">
<a-input
v-model:value="form.level"
placeholder="请输入等级"
allow-clear
/>
</a-form-item>
<a-form-item label="评价" name="evaluate">
<a-input
v-model:value="form.evaluate"
placeholder="请输入评价"
allow-clear
/>
</a-form-item>
<a-form-item label="排序" name="sortNumber">
<a-input-number :step="1" :precision="0" v-model:value="form.sortNumber" />
</a-form-item>
</a-form>
</a-modal>
<!-- 表格 -->
<ele-pro-table
v-model:selection="selectionList"
ref="table"
row-key="id"
:datasource="url"
:columns="columns"
:where="where"
:scroll="{ x: 'max-content' }"
>
<template #toolbar>
<a-space>
<a-button @click="openEdit" type="primary">新增</a-button>
<a-popconfirm
:disabled="selectionList.length == 0"
:title="`确认删除${selectionList.length}条数据吗?`"
ok-text="Yes"
cancel-text="No"
@confirm="removeBatch"
>
<a-button
:disabled="selectionList.length == 0"
type="primary"
ghost
danger
>删除
</a-button>
</a-popconfirm>
</a-space>
</template>
<template #action="{ record }">
<a-space>
<a-button
@click="openEdit(record)"
type="primary"
shape="round"
size="small"
>修改</a-button
>
<a-popconfirm
:title="`确认删除这条数据吗?`"
ok-text="Yes"
cancel-text="No"
@confirm="remove(record)"
>
<a-button type="primary" danger shape="round" size="small"
>删除</a-button
>
</a-popconfirm>
</a-space>
</template>
</ele-pro-table>
</a-card>
</div>
<!-- 编辑弹窗 -->
</template>
<script>
// import _ from "lodash";
import {
listAllUrl,
saveLeqLevel,
updateLeqLevel,
removeLeqLevel,
removeBatchLeqLevel
} from "@/api/ecology/noise/road-noise-leq-level";
import { message } from 'ant-design-vue';
// import moment from "moment";
export default {
name: "RoadNoiseLeqLevel",
components: {},
data() {
return {
data: [],
// 表格数据接口
url: listAllUrl,
selection: [],
// 表格列配置
columns: [
{
title: "时段",
dataIndex: "timeSlot",
},
{
title: "等级",
dataIndex: "level",
},
{
title: "最小值",
dataIndex: "minLeq",
customRender: ({text})=>{
return text!=undefined? text.toFixed(1):undefined
}
},
{
title: "最大值",
dataIndex: "maxLeq",
customRender: ({text})=>{
return text!=undefined? text.toFixed(1):undefined
}
},
{
title: "评价",
dataIndex: "evaluate",
},
{
title: "排序",
dataIndex: "sortNumber",
},
{
title: "操作",
key: "action",
width: 150,
align: "center",
fixed: "right",
slots: {
customRender: "action",
},
},
],
// 表格搜索条件
where: {},
// 表格选中数据
selectionList: [],
// 是否显示编辑弹窗
showEdit: false,
// 表单数据
form: {},
loading: false,
rules: {
timeSlot:[{required: true,message: '请选择时段'}],
// minLeq: [{required: true,message: '请输入最小值',},],
// maxLeq: [{required: true,message: '请输入最大值',},],
level: [{required: true,message: '请输入等级',},],
// evaluate: [{required: true,message: '请输入评价',},],
sortNumber: [{required: true,message: '请输入排序',},],
},
};
},
mounted() {
},
methods: {
minLeqChange(e){
console.log(e)
},
/* 刷新表格 */
reload() {
this.$refs.table.reload({
where: this.where,
});
},
/* 重置搜索 */
reset() {
this.where = {};
this.reload();
},
/* 打开编辑弹窗 */
openEdit(row) {
// cloneRecord.mi
this.form = Object.assign({}, row);
this.showEdit = true;
this.$nextTick(() => {
this.$refs.form.clearValidate(); // 清除表单验证信息
});
},
async save() {
await this.$refs.form.validate();
const {minLeq,maxLeq } = this.form;
if(minLeq == undefined && maxLeq == undefined ){
message.error("最小值和最大值请至少填写一项!")
return;
}
const hide = this.$message.loading('请求中..', 0);
const form = this.form;
if (form.id) {
updateLeqLevel(form)
.then((res) => {
if (res.data.code == 0) {
this.showEdit = false;
this.$message.success(res.data.msg);
this.reload();
} else {
this.$message.error(res.data.msg);
}
})
.catch((error) => {
this.$message.error(error.message);
})
.finally(() => {
hide();
});
} else {
saveLeqLevel(form)
.then((res) => {
if (res.data.code == 0) {
this.showEdit = false;
this.$message.success(res.data.msg);
this.reload();
} else {
this.$message.error(res.data.msg);
}
})
.catch((error) => {
this.$message.error(error.message);
})
.finally(() => {
hide();
});
}
},
/* 删除单个 */
remove(row) {
const hide = this.$message.loading('请求中..', 0);
removeLeqLevel(row.id).then((res) => {
hide();
if (res.data.code === 0) {
this.$message.success(res.data.msg);
this.reload();
} else {
this.$message.error(res.data.msg);
}
}).catch(e => {
hide();
this.$message.error(e.message);
})
},
/* 批量删除 */
removeBatch() {
const hide = this.$message.loading('请求中..', 0);
const ids = this.selectionList.map((item) => item.id);
removeBatchLeqLevel(ids).then((res) => {
if (res.data.code === 0) {
this.$message.success(res.data.msg);
this.reload();
} else {
this.$message.error(res.data.msg);
}
}).catch(e => {
this.$message.error(e.message);
}).finally(() => {
hide();
})
}
},
};
</script>
<style scoped lang="less">
</style>

View File

@@ -0,0 +1,353 @@
<template>
<div class="ele-body">
<a-card :bordered="false">
<a-modal
v-model:visible="showEdit"
:title="form.roadNoisePlaceId !== undefined ? '修改' : '添加'"
:confirm-loading="loading"
:width="800"
:body-style="{ paddingBottom: '8px' }"
@ok="save"
>
<a-form
ref="form"
:model="form"
:rules="rules"
:label-col="{ md: { span: 6 }, sm: { span: 24 } }"
:wrapper-col="{ md: { span: 18 }, sm: { span: 24 } }"
>
<a-form-item label="测点名称" name="placeName">
<a-input v-model:value="form.placeName" placeholder="请输入测点名称" allow-clear />
</a-form-item>
<a-form-item label="测点经度" name="placeLng">
<a-input v-model:value="form.placeLng" placeholder="请输入测点经度" allow-clear />
</a-form-item>
<a-form-item label="测点纬度" name="placeLat">
<a-input v-model:value="form.placeLat" placeholder="请输入测点纬度" allow-clear />
</a-form-item>
<a-form-item label="机动车车道数" name="motorway">
<a-input type="number" v-model:value="form.motorway" placeholder="请输入机动车车道数" allow-clear />
</a-form-item>
<a-form-item label="车道类别" name="motorwayType">
<a-input v-model:value="form.motorwayType" placeholder="请输入车道类别" allow-clear />
</a-form-item>
<a-form-item label="道路等级" name="motorwayLevel">
<a-input v-model:value="form.motorwayLevel" placeholder="请输入道路等级" allow-clear />
</a-form-item>
<a-form-item label="测点参照物" name="refObj">
<a-input v-model:value="form.refObj" placeholder="请输入测点参照物" allow-clear />
</a-form-item>
<a-form-item label="道路覆盖人口(万人)" name="people">
<a-input v-model:value="form.people" placeholder="请输入道路覆盖人口(万人)" allow-clear />
</a-form-item>
<a-form-item label="监测站名" name="station">
<a-input v-model:value="form.station" placeholder="请输入监测站名" allow-clear />
</a-form-item>
<a-form-item label="监测仪器型号" name="monitorInstrumentModel">
<a-input v-model:value="form.monitorInstrumentModel" placeholder="请输入测监测仪器型号" allow-clear />
</a-form-item>
<a-form-item label="监测仪器编号" name="monitorInstrumentCode">
<a-input v-model:value="form.monitorInstrumentCode" placeholder="请输入监测仪器编号" allow-clear />
</a-form-item>
<a-form-item label="监测前校准值" name="beforeMonitorValue">
<a-input v-model:value="form.beforeMonitorValue" placeholder="请输入监测前校准值" allow-clear />
</a-form-item>
<a-form-item label="监测后校准值" name="afterMonitorValue">
<a-input v-model:value="form.afterMonitorValue" placeholder="请输入监测后校准值" allow-clear />
</a-form-item>
<a-form-item label="声校准器测量声压值" name="soundPressureValue">
<a-input v-model:value="form.soundPressureValue" placeholder="请输入声校准器测量声压值" allow-clear />
</a-form-item>
<a-form-item label="声校准仪器型号" name="soundInstrumentModel">
<a-input v-model:value="form.soundInstrumentModel" placeholder="请输入声校准仪器型号" allow-clear />
</a-form-item>
<a-form-item label="声校准仪器编号" name="soundInstrumentCode">
<a-input v-model:value="form.soundInstrumentCode" placeholder="请输入声校准仪器编号" allow-clear />
</a-form-item>
</a-form>
</a-modal>
<!-- 表格 -->
<ele-pro-table
v-model:selection="selectionList"
ref="table"
row-key="roadNoisePlaceId"
:datasource="url"
:columns="columns"
:where="where"
:scroll="{ x: 'max-content' }"
>
<template #toolbar>
<a-space>
<a-button @click="openEdit" type="primary">新增</a-button>
<a-popconfirm
:disabled="selectionList.length == 0"
:title="`确认删除${selectionList.length}条数据吗?`"
ok-text="Yes"
cancel-text="No"
@confirm="removeBatch"
>
<a-button
:disabled="selectionList.length == 0"
type="primary"
ghost
danger
>删除
</a-button>
</a-popconfirm>
</a-space>
</template>
<template #action="{ record }">
<a-space>
<a-button
@click="openEdit(record)"
type="primary"
shape="round"
size="small"
>修改</a-button
>
<a-popconfirm
:title="`确认删除这条数据吗?`"
ok-text="Yes"
cancel-text="No"
@confirm="remove(record)"
>
<a-button type="primary" danger shape="round" size="small"
>删除</a-button
>
</a-popconfirm>
</a-space>
</template>
</ele-pro-table>
</a-card>
</div>
<!-- 编辑弹窗 -->
</template>
<script>
// import _ from "lodash";
import {
listAllUrl,
savePlace,
updatePlace,
removePlace,
removeBatchPlace
} from "@/api/ecology/noise/road-noise-place";
// import moment from "moment";
export default {
name: "RoadNoisePlace",
components: {},
data() {
return {
data: [],
// 表格数据接口
url: listAllUrl,
selection: [],
// 表格列配置
columns: [
{
title: "测点名称",
dataIndex: "placeName",
sorter: true,
},
{
title: "测点经度",
dataIndex: "placeLng",
sorter: true,
},
{
title: "测点纬度",
dataIndex: "placeLat",
sorter: true,
},
{
title: "机动车车道数",
dataIndex: "motorway",
sorter: true,
},
{
title: "车道类别",
dataIndex: "motorwayType",
sorter: true,
},
{
title: "道路等级",
dataIndex: "motorwayLevel",
sorter: true,
},
{
title: "测点参照物",
dataIndex: "refObj",
sorter: true,
},
{
title: "道路覆盖人口(万人)",
dataIndex: "people",
sorter: true,
},
{
title: "监测站名",
dataIndex: "station",
sorter: true,
},
{
title: "监测仪器型号",
dataIndex: "monitorInstrumentModel",
sorter: true,
},
{
title: "监测仪器编号",
dataIndex: "monitorInstrumentCode",
sorter: true,
},
{
title: "监测前校准值",
dataIndex: "beforeMonitorValue",
sorter: true,
},
{
title: "声校准器测量声压值",
dataIndex: "soundPressureValue",
sorter: true,
},
{
title: "声校准仪器型号",
dataIndex: "soundInstrumentModel",
sorter: true,
},
{
title: "声校准仪器编号",
dataIndex: "soundInstrumentCode",
sorter: true,
},
{
title: "操作",
key: "action",
width: 150,
align: "center",
fixed: "right",
slots: {
customRender: "action",
},
},
],
// 表格搜索条件
where: {},
// 表格选中数据
selectionList: [],
// 是否显示编辑弹窗
showEdit: false,
// 表单数据
form: {},
loading: false,
rules: {
placeName:[{required: true,message: '请选择测点名称'}],
placeLng: [{required: true,message: '请输入测点经度',},],
placeLat: [{required: true,message: '请输入测点纬度',},],
},
};
},
mounted() {
},
methods: {
/* 刷新表格 */
reload() {
this.$refs.table.reload({
where: this.where,
});
},
/* 重置搜索 */
reset() {
this.where = {};
this.reload();
},
/* 打开编辑弹窗 */
openEdit(row) {
// cloneRecord.mi
this.form = Object.assign({}, row);
this.showEdit = true;
this.$nextTick(() => {
this.$refs.form.clearValidate(); // 清除表单验证信息
});
},
async save() {
await this.$refs.form.validate();
const hide = this.$message.loading('请求中..', 0);
const form = this.form;
if (form.roadNoisePlaceId) {
updatePlace(form)
.then((res) => {
if (res.data.code == 0) {
this.showEdit = false;
this.$message.success(res.data.msg);
this.reload();
} else {
this.$message.error(res.data.msg);
}
})
.catch((error) => {
this.$message.error(error.message);
})
.finally(() => {
hide();
});
} else {
savePlace(form)
.then((res) => {
if (res.data.code == 0) {
this.showEdit = false;
this.$message.success(res.data.msg);
this.reload();
} else {
this.$message.error(res.data.msg);
}
})
.catch((error) => {
this.$message.error(error.message);
})
.finally(() => {
hide();
});
}
},
/* 删除单个 */
remove(row) {
const hide = this.$message.loading('请求中..', 0);
removePlace(row.roadNoisePlaceId).then((res) => {
hide();
if (res.data.code === 0) {
this.$message.success(res.data.msg);
this.reload();
} else {
this.$message.error(res.data.msg);
}
}).catch(e => {
hide();
this.$message.error(e.message);
})
},
/* 批量删除 */
removeBatch() {
const hide = this.$message.loading('请求中..', 0);
const ids = this.selectionList.map((item) => item.roadNoisePlaceId);
removeBatchPlace(ids).then((res) => {
if (res.data.code === 0) {
this.$message.success(res.data.msg);
this.reload();
} else {
this.$message.error(res.data.msg);
}
}).catch(e => {
this.$message.error(e.message);
}).finally(() => {
hide();
})
}
},
};
</script>
<style scoped lang="less">
</style>

View File

@@ -96,7 +96,7 @@
<script> <script>
import _ from "lodash"; import _ from "lodash";
import XLSX from "xlsx"; import XLSX from "xlsx";
import { pageRoadNoiseStatisticUrl } from "@/api/ecology/road-sound"; import { pageRoadNoiseStatisticUrl } from "@/api/ecology/noise/road-sound";
const columns = [ const columns = [
{ {
title: "城区", title: "城区",

View File

@@ -5,7 +5,9 @@
<a-form <a-form
:model="where" :model="where"
:label-col="{ md: { span: 6 }, sm: { span: 24 } }" :label-col="{ md: { span: 6 }, sm: { span: 24 } }"
:wrapper-col="{ md: { span: 18 }, sm: { span: 24 } }" :wrapper-col="{ md: { span: 18, }, sm: { span: 24 } }"
labelAlign="left"
layout="vertical"
> >
<a-row> <a-row>
<a-col :lg="6" :md="12" :sm="24" :xs="24"> <a-col :lg="6" :md="12" :sm="24" :xs="24">
@@ -19,6 +21,28 @@
</a-select> </a-select>
</a-form-item> </a-form-item>
</a-col> </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.timeSlot" allowClear showSearch>
<a-select-option
v-for="(item) in timeSlotOptions"
: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-col :lg="6" :md="12" :sm="24" :xs="24">
<a-form-item label="测点名称:"> <a-form-item label="测点名称:">
<a-select v-model:value="where.place" allowClear showSearch> <a-select v-model:value="where.place" allowClear showSearch>
@@ -52,8 +76,12 @@
</a-select> </a-select>
</a-form-item> </a-form-item>
</a-col> </a-col>
</a-row>
<a-row>
<a-col :lg="6" :md="12" :sm="24" :xs="24"> <a-col :lg="6" :md="12" :sm="24" :xs="24">
<a-form-item class="ele-text-right" :wrapper-col="{ span: 24 }"> <a-form-item class="ele-text-left" :wrapper-col="{ span: 24 }">
<a-space> <a-space>
<a-button type="primary" @click="reload">查询</a-button> <a-button type="primary" @click="reload">查询</a-button>
<a-button @click="reset">重置</a-button> <a-button @click="reset">重置</a-button>
@@ -91,7 +119,7 @@
<script> <script>
// import _ from "lodash"; // import _ from "lodash";
import XLSX from "xlsx"; import XLSX from "xlsx";
import { pageRoadNoiseUrl, getColumnOptions } from "@/api/ecology/road-sound"; import { pageRoadNoiseUrl, getColumnOptions,listAll } from "@/api/ecology/noise/road-sound";
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";
@@ -107,6 +135,7 @@ export default {
url: pageRoadNoiseUrl, url: pageRoadNoiseUrl,
selection: [], selection: [],
// 表格列配置 // 表格列配置
yearOptions:[],
columns: [ columns: [
{ {
title: "监测日期", title: "监测日期",
@@ -304,6 +333,7 @@ export default {
palceOptions: [], palceOptions: [],
areaOptions: [], areaOptions: [],
roadOptions: [], roadOptions: [],
timeSlotOptions:[],
regionLevelOptions: [], regionLevelOptions: [],
// 表格搜索条件 // 表格搜索条件
where: { where: {
@@ -351,6 +381,23 @@ export default {
}; };
}); });
}); });
getColumnOptions("monitor_year").then((res) => {
this.yearOptions = res.data.data.map((item) => {
return {
label: item,
value: item,
};
});
});
getColumnOptions("time_slot").then((res) => {
this.timeSlotOptions = res.data.data.map((item) => {
return {
label: item,
value: item,
};
});
});
}, },
/* 刷新表格 */ /* 刷新表格 */
reload() { reload() {
@@ -555,12 +602,17 @@ export default {
const arr = []; const arr = [];
const th = columns.map((item) => item.title); const th = columns.map((item) => item.title);
arr.push(th); arr.push(th);
this.data.forEach((d) => { listAll(this.where).then(res=>{
const td = columns.map((item) => d[item.dataIndex]); if(res.data.code == 0){
arr.push(td); res.data.data.forEach((d) => {
}); const td = columns.map((item) => d[item.dataIndex]);
let sheet = XLSX.utils.aoa_to_sheet(arr); arr.push(td);
this.$util.exportSheet(XLSX, sheet, new Date().getTime().toString()); });
let sheet = XLSX.utils.aoa_to_sheet(arr);
this.$util.exportSheet(XLSX, sheet, new Date().getTime().toString());
}
})
}, },
}, },
}; };

View File

@@ -1,506 +1,265 @@
<template> <template>
<div class=""> <div class="">
<a-form :model="where" :rules="whereRules" :labelCol="{ offset: 1 }"> <a-form labelAlign="left"
<a-row> layout="vertical" :model="where" :rules="whereRules"
<!-- <a-col :lg="6" :md="12" :sm="24" :xs="24"> :label-col="{ md: { span: 6 }, sm: { span: 24 } }"
<a-form-item label="统计模块:"> :wrapper-col="{ md: { span: 18, }, sm: { span: 24 } }"
<a-select >
:options="groupModelOptions" <a-row>
v-model:value="where.groupModel" <a-col :lg="6" :md="12" :sm="24" :xs="24">
placeholder="统计模块" <a-form-item name="timeRange" label="时间范围:">
> <a-range-picker
</a-select> @panelChange="timeRangePanelChange"
</a-form-item> v-model:value="timeRange"
</a-col> --> format="YYYY"
<!-- <a-col :lg="6" :md="12" :sm="24" :xs="24"> :mode="['year', 'year']"
<a-form-item label="时间细度:"> />
<a-select </a-form-item>
:options="groupTimeLengthOptions" </a-col>
v-model:value="where.groupTimeLength" <a-col :lg="6" :md="12" :sm="24" :xs="24">
placeholder="" <a-form-item label="昼夜:">
> <a-select
</a-select> :options="timeSlotOptions"
</a-form-item> v-model:value="where.timeSlot"
</a-col> --> placeholder="昼夜"
<a-col :lg="6" :md="12" :sm="24" :xs="24"> >
<a-form-item name="timeRange" label="时间范围:"> </a-select>
<a-range-picker </a-form-item>
@panelChange="timeRangePanelChange" </a-col>
v-model:value="timeRange"
format="YYYY"
:mode="['year', 'year']"
/>
</a-form-item>
</a-col>
<a-col :lg="6" :md="12" :sm="24" :xs="24">
<a-form-item label="昼夜:">
<a-select
:options="timeSlotOptions"
v-model:value="where.timeSlot"
placeholder="昼夜"
>
</a-select>
</a-form-item>
</a-col>
<a-col :lg="12" :md="12" :sm="24" :xs="24"> <a-col :lg="24" :md="24" :sm="24" :xs="24">
<a-form-item label="类型:"> <a-form-item class="ele-text-left" :wrapper-col="{ span: 24 }">
<a-select <a-space>
v-model:value="where.valueType" <a-button type="primary" @click="reload">查询</a-button>
:options="valueTypeOptions" <a-button @click="reset">重置</a-button>
mode="multiple" <a-button @click="exportFile">导出Excel</a-button>
placeholder="至少选择一项" </a-space>
> </a-form-item>
</a-select> </a-col>
</a-form-item> </a-row>
</a-col> </a-form>
<!-- <a-col :lg="6" :md="12" :sm="24" :xs="24"> <ele-pro-table
<a-form-item label="时间范围:"> v-if="hisYears.length > 0"
<a-range-picker @change="reportTimeScopeChange" :mode="['year','year']" separator="~" v-model:value="where.reportTimeScope" ><a-range-picker> ref="table"
<template #renderExtraFooter> row-key="id"
extra footer :datasource="url"
</template> :columns="columns"
</a-range-picker> :where="where"
</a-form-item> :needPage="false"
</a-col> --> :initLoad="false"
:scroll="{ x: 'max-content' }"
:method="'POST'"
@done="(d) => (data = d.data)"
>
<template #toolbar>
<!-- 搜索表单 -->
<a-col :lg="12" :md="12" :sm="24" :xs="24"> <!-- <a-space>
<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-if="hisYears.length > 0"
ref="table"
row-key="id"
:datasource="url"
:columns="columns"
:where="where"
:needPage="false"
:initLoad="false"
:scroll="{ x: 'max-content' }"
:method="'POST'"
@done="(d) => (data = d.data)"
>
<template #toolbar>
<!-- 搜索表单 -->
<!-- <a-space> </a-space> -->
</template>
</a-space> --> </ele-pro-table>
</template> </div>
</ele-pro-table>
</div>
</template> </template>
<script> <script>
// import _ from "lodash"; // import _ from "lodash";
import { ref } from "vue";
import XLSX from "xlsx"; import XLSX from "xlsx";
import { import {
pageRoadNoiseCompare, pageRoadNoiseCompare,
getHistoryyears, getHistoryyears,
} from "@/api/ecology/road-sound"; } from "@/api/ecology/noise/road-sound";
export default { export default {
name: "StatisticSoundRoadCompare", name: "StatisticSoundRoadCompare",
components: {}, components: {},
data() { data() {
const groupModelOptions = [
{ label: "测点", value: "place" },
{ label: "城区", value: "area" },
{ label: "市", value: "city" },
];
const groupTimeLengthOptions = [
{
label: "年",
value: "monitor_year",
},
{
label: "季度",
value: "quarter",
},
];
// const valueTypeOptions = ['Leq','SD','L10','L50','L90','Lmin','Lmax']; const groupTimeLengthOptions = [
const valueTypeOptions = [ {
{ label: "年",
label: "Leq", value: "monitor_year",
value: "index_Leq", },
}, {
{ label: "季度",
label: "SD", value: "quarter",
value: "index_SD", },
}, ];
{ const whereRules = {};
label: "L10", return {
value: "index_L10", url: pageRoadNoiseCompare,
}, data: [],
{ where: {
label: "L50", groupModel: "area",
value: "index_L50", groupTimeLength: "monitor_year",
}, reportTimeScope: [],
{ valueType: ["index_Leq"],
label: "L90", timeSlot: "",
value: "index_L90", timeRange: [],
}, regionLevel: "市级"
{ },
label: "Lmin", timeRange: [],
value: "index_Lmin", whereRules,
}, hisYears: [],
{ timeScope: [],
label: "Lmax", columns: [{title: "年", dataIndex: "year"}],
value: "index_Lmax", groupTimeLengthOptions,
}, timeSlotOptions: [
]; {
value: "昼",
label: "昼",
},
{
value: "夜",
label: "夜",
},
],
};
},
mounted() {
getHistoryyears().then((res) => {
this.hisYears = res.data.data;
this.$nextTick(() => {
this.reload();
});
});
},
methods: {
/* 刷新表格 */
reload() {
if (this.where.valueType.length == 0) {
this.$message.error("请至少选择一个类型");
return;
}
const whereRules = {}; // 结束时间必须大于开始时间
return { if (this.where.timeRange && this.where.timeRange.length == 2) {
url: pageRoadNoiseCompare, if (this.where.timeRange[0] > this.where.timeRange[1]) {
data: [], this.$message.error("结束时间必须大于起始时间");
where: { return;
groupModel: "area", }
groupTimeLength: "monitor_year", this.where.startYear = this.where.timeRange[0];
reportTimeScope: [], this.where.endYear = this.where.timeRange[1];
valueType: ["index_Leq"], }
timeRange: [], this.stableDone();
regionLevel: "市级" this.$refs.table.reload({
}, where: this.where,
timeRange: [], });
whereRules,
hisYears: [],
timeScope: [],
columns: [{ title: "年", dataIndex: "year" }],
groupModelOptions,
groupTimeLengthOptions,
valueTypeOptions: ref(valueTypeOptions),
timeSlotOptions: [
{
value: "昼",
label: "昼",
}, },
{ /* 重置搜索 */
value: "夜", reset() {
label: "夜", this.where = {
groupModel: "area",
groupTimeLength: "monitor_year",
reportTimeScope: [],
valueType: ["index_Leq"],
timeRange: [],
timeSlot: "昼",
regionLevel: "市级"
};
this.this.timeScope = [];
this.reload();
}, },
], reportTimeScopeChange(d, dstr) {
}; console.log(d, dstr);
}, },
mounted() { timeRangePanelChange(val) {
getHistoryyears().then((res) => { val[0] && (this.where.timeRange[0] = val[0].year());
this.hisYears = res.data.data; val[1] && (this.where.timeRange[1] = val[1].year());
this.$nextTick(() => { this.timeRange = val;
this.reload(); },
}); // 数据加载完成
}); stableDone() {
}, const columns = [];
methods: { if (this.where.groupModel == "area") {
/* 刷新表格 */ columns.push({
reload() { title: "城区",
if (this.where.valueType.length == 0) { dataIndex: "area",
this.$message.error("请至少选择一个类型"); sorter: true,
return; });
} } else if (this.where.groupModel == "place") {
columns.push({
// 结束时间必须大于开始时间 title: "测点",
if (this.where.timeRange && this.where.timeRange.length == 2) { dataIndex: "area",
if (this.where.timeRange[0] > this.where.timeRange[1]) { sorter: true,
this.$message.error("结束时间必须大于起始时间"); });
return; } else if (this.where.groupModel == "city") {
} columns.push({
this.where.startYear = this.where.timeRange[0]; title: "城市",
this.where.endYear = this.where.timeRange[1]; dataIndex: "area",
} sorter: true,
this.stableDone(); });
this.$refs.table.reload({
where: this.where,
});
},
/* 重置搜索 */
reset() {
this.where = {
groupModel: "area",
groupTimeLength: "monitor_year",
reportTimeScope: [],
valueType: ["index_Leq"],
timeRange: [],
regionLevel: "市级"
};
this.this.timeScope = [];
this.reload();
},
reportTimeScopeChange(d, dstr) {
console.log(d, dstr);
},
timeRangePanelChange(val) {
val[0] && (this.where.timeRange[0] = val[0].year());
val[1] && (this.where.timeRange[1] = val[1].year());
this.timeRange = val;
},
// 数据加载完成
stableDone() {
const columns = [];
if (this.where.groupModel == "area") {
columns.push({
title: "城区",
dataIndex: "area",
sorter: true,
});
} else if (this.where.groupModel == "place") {
columns.push({
title: "测点",
dataIndex: "area",
sorter: true,
});
} else if (this.where.groupModel == "city") {
columns.push({
title: "城市",
dataIndex: "area",
sorter: true,
});
}
this.hisYears.forEach((item) => {
if (
(!this.where.timeRange[0] || this.where.timeRange[0] <= item) &&
(!this.where.timeRange[1] || this.where.timeRange[1] >= item)
) {
if (this.where.groupTimeLength == "quarter") {
columns.push({
title: item + "年第一季度Leq",
dataIndex: item + "1" + "Leq",
customRender: ({ text }) =>text? Number(text).toFixed(1):"",
});
columns.push({
title: item + "年第二季度Leq",
dataIndex: item + "2" + "Leq",
customRender: ({ text }) =>text? Number(text).toFixed(1):"",
});
columns.push({
title: item + "年第三季度Leq",
dataIndex: item + "3" + "Leq",
customRender: ({ text }) =>text? Number(text).toFixed(1):"",
});
columns.push({
title: item + "年第四季度Leq",
dataIndex: item + "4" + "Leq",
customRender: ({ text }) =>text? Number(text).toFixed(1):"",
});
columns.push({
title: item + "年第一季度SD",
dataIndex: item + "1" + "Sd",
customRender: ({ text }) =>text? Number(text).toFixed(1):"",
});
columns.push({
title: item + "年第二季度SD",
dataIndex: item + "2" + "Sd",
customRender: ({ text }) =>text? Number(text).toFixed(1):"",
});
columns.push({
title: item + "年第三季度SD",
dataIndex: item + "3" + "Sd",
customRender: ({ text }) =>text? Number(text).toFixed(1):"",
});
columns.push({
title: item + "年第四季度SD",
dataIndex: item + "4" + "Sd",
customRender: ({ text }) =>text? Number(text).toFixed(1):"",
});
columns.push({
title: item + "年第一季度L10",
dataIndex: item + "1" + "L10",
customRender: ({ text }) =>text? Number(text).toFixed(1):"",
});
columns.push({
title: item + "年第二季度L10",
dataIndex: item + "2" + "L10",
customRender: ({ text }) =>text? Number(text).toFixed(1):"",
});
columns.push({
title: item + "年第三季度L10",
dataIndex: item + "3" + "L10",
customRender: ({ text }) =>text? Number(text).toFixed(1):"",
});
columns.push({
title: item + "年第四季度L10",
dataIndex: item + "4" + "L10",
customRender: ({ text }) =>text? Number(text).toFixed(1):"",
});
columns.push({
title: item + "年第一季度L50",
dataIndex: item + "1" + "L50",
customRender: ({ text }) =>text? Number(text).toFixed(1):"",
});
columns.push({
title: item + "年第二季度L50",
dataIndex: item + "2" + "L50",
customRender: ({ text }) =>text? Number(text).toFixed(1):"",
});
columns.push({
title: item + "年第三季度L50",
dataIndex: item + "3" + "L50",
customRender: ({ text }) =>text? Number(text).toFixed(1):"",
});
columns.push({
title: item + "年第四季度L50",
dataIndex: item + "4" + "L50",
customRender: ({ text }) =>text? Number(text).toFixed(1):"",
});
columns.push({
title: item + "年第一季度L90",
dataIndex: item + "1" + "L90",
customRender: ({ text }) =>text? Number(text).toFixed(1):"",
});
columns.push({
title: item + "年第二季度L90",
dataIndex: item + "2" + "L90",
customRender: ({ text }) =>text? Number(text).toFixed(1):"",
});
columns.push({
title: item + "年第三季度L90",
dataIndex: item + "3" + "L90",
customRender: ({ text }) =>text? Number(text).toFixed(1):"",
});
columns.push({
title: item + "年第四季度L90",
dataIndex: item + "4" + "L90",
customRender: ({ text }) =>text? Number(text).toFixed(1):"",
});
columns.push({
title: item + "年第一季度Lmin",
dataIndex: item + "1" + "Lmin",
customRender: ({ text }) =>text? Number(text).toFixed(1):"",
});
columns.push({
title: item + "年第二季度Lmin",
dataIndex: item + "2" + "Lmin",
customRender: ({ text }) =>text? Number(text).toFixed(1):"",
});
columns.push({
title: item + "年第三季度Lmin",
dataIndex: item + "3" + "Lmin",
customRender: ({ text }) =>text? Number(text).toFixed(1):"",
});
columns.push({
title: item + "年第四季度Lmin",
dataIndex: item + "4" + "Lmin",
customRender: ({ text }) =>text? Number(text).toFixed(1):"",
});
columns.push({
title: item + "年第一季度Lmax",
dataIndex: item + "1" + "Lmax",
customRender: ({ text }) =>text? Number(text).toFixed(1):"",
});
columns.push({
title: item + "年第二季度Lmax",
dataIndex: item + "2" + "Lmax",
customRender: ({ text }) =>text? Number(text).toFixed(1):"",
});
columns.push({
title: item + "年第三季度Lmax",
dataIndex: item + "3" + "Lmax",
customRender: ({ text }) =>text? Number(text).toFixed(1):"",
});
columns.push({
title: item + "年第四季度Lmax",
dataIndex: item + "4" + "Lmax",
customRender: ({ text }) =>text? Number(text).toFixed(1):"",
});
} else {
if (this.where.valueType.includes("index_Leq")) {
columns.push({
title: item + "年Leq",
dataIndex: item + "Leq",
customRender: ({ text }) => {
const val = text ? Number(text).toFixed(1) : "";
return val;
},
});
}
if (this.where.valueType.includes("index_SD")) {
columns.push({
title: item + "年SD",
dataIndex: item + "Sd",
customRender: ({ text }) => {
const val = text ? Number(text).toFixed(1) : "";
return val;
},
});
}
if (this.where.valueType.includes("index_L10")) {
columns.push({
title: item + "年L10",
dataIndex: item + "L10",
customRender: ({ text }) => {
const val = text ? Number(text).toFixed(1) : "";
return val;
},
});
} }
if (this.where.valueType.includes("index_L50")) { this.hisYears.forEach((item) => {
columns.push({ if (
title: item + "年L50", (!this.where.timeRange[0] || this.where.timeRange[0] <= item) &&
dataIndex: item + "L50", (!this.where.timeRange[1] || this.where.timeRange[1] >= item)
customRender: ({ text }) => { ) {
const val = text ? Number(text).toFixed(1) : ""; if (this.where.valueType.includes("index_Leq")) {
return val; columns.push({
}, title: item + "年",
}); align:"center",
} children: [
if (this.where.valueType.includes("index_L90")) { {
columns.push({ title:"Leq",
title: item + "年L90", dataIndex: item + "Leq",
dataIndex: item + "L90", align:"center",
customRender: ({ text }) => { customRender: ({text}) => {
const val = text ? Number(text).toFixed(1) : ""; const val = text ? Number(text).toFixed(1) : "";
return val; return val;
}, },
}); },
} {
if (this.where.valueType.includes("index_Lmin")) { title:"等级",
columns.push({ align:"center",
title: item + "年Lmin", dataIndex: item + "LeqLevel",
dataIndex: item + "Lmin", }
customRender: ({ text }) => { ]
const val = text ? Number(text).toFixed(1) : ""; });
return val;
}, }
}); }
} });
if (this.where.valueType.includes("index_Lmax")) { //
columns.push({ this.columns = columns;
title: item + "年Lmax", },
dataIndex: item + "Lmax", exportFile() {
customRender: ({ text }) => { const arr = [];
const val = text ? Number(text).toFixed(1) : ""; const th1 = [];
return val; const th2 = [];
}, const merges = []; // 合并
}); const columnsTemp = []; // 树形结构整理成list
} this.columns.forEach((item,index)=>{
} if(item.children){
} item.children.forEach(citem=>{
}); th1.push(item.title)
// th2.push(citem.title)
this.columns = columns; columnsTemp.push(citem)
})
merges.push({s: {r: 0, c: th1.length-2}, e: {r: 0, c: th1.length-1}})
}else{
th1.push(item.title)
th2.push("")
columnsTemp.push(item)
merges.push({s: {r: 0, c: index}, e: {r: 1, c: index}})
}
})
arr.push(th1,th2);
this.data.forEach((d) => {
const td = columnsTemp.map((item) => {
if (typeof d[item.dataIndex] == "number") {
return d[item.dataIndex].toFixed(1);
}
return d[item.dataIndex];
});
arr.push(td);
});
let sheet = XLSX.utils.aoa_to_sheet(arr);
sheet['!merges'] = merges;
this.$util.exportSheet(XLSX, sheet, new Date().getTime().toString());
},
}, },
exportFile() {
const arr = [];
const th = this.columns.map((item) => item.title);
arr.push(th);
this.data.forEach((d) => {
const td = this.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> </script>

View File

@@ -14,6 +14,9 @@
<a-tab-pane key="year-compare" tab="同比"> <a-tab-pane key="year-compare" tab="同比">
<compare></compare> <compare></compare>
</a-tab-pane> </a-tab-pane>
<a-tab-pane key="year-end" tab="年终统计">
<year-end></year-end>
</a-tab-pane>
</a-tabs> </a-tabs>
</a-card> </a-card>
</div> </div>
@@ -29,12 +32,13 @@
// import QuarterStatistic from "./quarter.vue"; // import QuarterStatistic from "./quarter.vue";
import Compare from "./compare.vue" import Compare from "./compare.vue"
import AverageStatistic from "./average.vue" import AverageStatistic from "./average.vue"
import YearEnd from "./year-end"
export default { export default {
name: 'StatisticSoundRoad', name: 'StatisticSoundRoad',
components: { components: {
BaseStatistic, BaseStatistic,
// QuarterStatistic, YearEnd,
Compare, Compare,
AverageStatistic AverageStatistic
}, },

View File

@@ -0,0 +1,146 @@
<template>
<div class="">
<ele-pro-table
ref="table"
row-key="id"
:datasource="url"
:columns="columns"
:where="where"
:needPage="false"
@done="(d) => (data = d.data)"
:scroll="{ x: 'max-content' }"
>
<template #toolbar>
<!-- 搜索表单 -->
<a-form :model="where" layout="inline" :labelCol="{ offset: 1 }">
<a-row>
<a-col :lg="6" :md="12" :sm="24" :xs="24">
<a-form-item label="昼夜:">
<a-select
:options="timeSlotOptions"
v-model:value="where.timeSlot"
placeholder="昼夜"
>
</a-select>
</a-form-item>
</a-col>
<a-col :lg="4" :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>
<!-- <a-space>
</a-space> -->
</template>
</ele-pro-table>
</div>
</template>
<script>
import XLSX from "xlsx";
import { roadNoiseYearEnd } from "@/api/ecology/noise/road-sound";
const columns = [
{title: "年份",dataIndex: "year",},
{title: "路段总长度(米)",dataIndex: "roadLengthTotal",},
{title: "监测点数",dataIndex: "placeTotal",},
{title: "平均路长(米)",dataIndex: "roadLengthAvg",},
{title: "平均路宽(米)",dataIndex: "roadWidthAvg",},
{title: "车流量(辆/20分钟)",dataIndex: "trafficFlow",},
{title: "超70分贝路段长度占总路长比例(%)",dataIndex: "badProportion",},
{title: "Leq(分贝)",dataIndex: "leq",},
];
export default {
name: "StatisticSoundRoadYearEnd",
components: {},
data() {
return {
url: roadNoiseYearEnd,
data: [],
where: {
timeSlot: "昼"
},
timeScope: [],
columns,
modelOptions: [
{
value: "place",
label: "测点",
},
{
value: "road",
label: "路段",
},
{
value: "area",
label: "城区",
},
{
value: "city",
label: "市",
},
],
timeSlotOptions: [
{
value: "昼",
label: "昼",
},
{
value: "夜",
label: "夜",
},
],
};
},
methods: {
/* 刷新表格 */
reload() {
},
/* 重置搜索 */
reset() {
this.where = {
model: "area",
timeSlot: "昼",
};
this.this.timeScope = [];
this.reload();
},
exportFile() {
let array = [
["测点", "路段", "城区", "路长", "路宽", "平均Leq", "平均SD"],
];
this.data.forEach((d) => {
array.push([
d.place,
d.road,
d.area,
d.roadLength,
d.roadWidth,
d.avgLeq,
d.avgSD,
]);
});
let sheet = XLSX.utils.aoa_to_sheet(array);
// sheet['!merges'] = [
// {s: {r: 0, c: 1}, e: {r: 0, c: 5}}, // 合并第0行第1列到第0行第5列
// {s: {r: 0, c: 0}, e: {r: 1, c: 0}}, // 合并第0行第0列到第1行第0列
// {s: {r: 0, c: 6}, e: {r: 1, c: 6}} // 合并第0行第6列到第1行第6列
// ];
this.$util.exportSheet(XLSX, sheet, "道路交通噪声统计表");
},
},
};
</script>
<style scoped>
</style>

View File

@@ -33,7 +33,7 @@ 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 NoiseBill from "./noise-bill.vue";
import { saveZoneNoiseBill } from "@/api/ecology/zone-sound"; import { saveZoneNoiseBill } from "@/api/ecology/noise/zone-sound";
export default { export default {
name: "ZoneCollectIndex", name: "ZoneCollectIndex",
components: { components: {

View File

@@ -111,7 +111,7 @@
removeBatchZoneNoiseBill, removeBatchZoneNoiseBill,
updateZoneNoiseBill, updateZoneNoiseBill,
verifyZoneNoiseBill verifyZoneNoiseBill
} from "@/api/ecology/zone-sound"; } from "@/api/ecology/noise/zone-sound";
import moment from "moment"; import moment from "moment";
export default { export default {
name: 'ZoneCollectNoiseBill', name: 'ZoneCollectNoiseBill',

View File

@@ -340,7 +340,7 @@ import {
updateZoneNoise, updateZoneNoise,
getZoneNoiseBill, getZoneNoiseBill,
getColumnOptions, getColumnOptions,
} from "@/api/ecology/zone-sound"; } from "@/api/ecology/noise/zone-sound";
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";

View File

@@ -0,0 +1,46 @@
<template>
<div class="ele-body">
<a-card :bordered="false">
<a-tabs v-model:activeKey="activeKey">
<a-tab-pane key="place" tab="点位信息">
<place></place>
</a-tab-pane>
<a-tab-pane key="leqLevel" tab="Leq等级">
<leq-level></leq-level>
</a-tab-pane>
</a-tabs>
</a-card>
</div>
</template>
<script>
/**
*
*
*
*/
import LeqLevel from "./leq-level"
import Place from "./place"
export default {
name: 'ZoneNoiseDictIndex',
components: {
LeqLevel,
Place
},
data() {
return {
activeKey: 'place'
};
},
methods: {}
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,302 @@
<template>
<div class="ele-body">
<a-card :bordered="false">
<a-modal
v-model:visible="showEdit"
:title="form.id !== undefined ? '修改' : '添加'"
:confirm-loading="loading"
:width="500"
:body-style="{ paddingBottom: '8px' }"
@ok="save"
>
<a-form
ref="form"
:model="form"
:rules="rules"
:label-col="{ md: { span: 6 }, sm: { span: 24 } }"
:wrapper-col="{ md: { span: 18 }, sm: { span: 24 } }"
>
<a-form-item label="最小值" name="minLeq">
<a-input-number @change="minLeqChange" :step=".1" :precision="1" v-model:value="form.minLeq" />
</a-form-item>
<a-form-item label="最大值" name="maxLeq">
<a-input-number :step=".1" :precision="1" v-model:value="form.maxLeq" />
</a-form-item>
<a-form-item label="时段" name="timeSlot">
<a-select v-model:value="form.timeSlot">
<a-select-option value="昼"></a-select-option>
<a-select-option value="夜"></a-select-option>
</a-select>
</a-form-item>
<a-form-item label="等级" name="level">
<a-input
v-model:value="form.level"
placeholder="请输入等级"
allow-clear
/>
</a-form-item>
<a-form-item label="评价" name="evaluate">
<a-input
v-model:value="form.evaluate"
placeholder="请输入评价"
allow-clear
/>
</a-form-item>
<a-form-item label="排序" name="sortNumber">
<a-input-number :step="1" :precision="0" v-model:value="form.sortNumber" />
</a-form-item>
</a-form>
</a-modal>
<!-- 表格 -->
<ele-pro-table
v-model:selection="selectionList"
ref="table"
row-key="id"
:datasource="url"
:columns="columns"
:where="where"
:scroll="{ x: 'max-content' }"
>
<template #toolbar>
<a-space>
<a-button @click="openEdit" type="primary">新增</a-button>
<a-popconfirm
:disabled="selectionList.length == 0"
:title="`确认删除${selectionList.length}条数据吗?`"
ok-text="Yes"
cancel-text="No"
@confirm="removeBatch"
>
<a-button
:disabled="selectionList.length == 0"
type="primary"
ghost
danger
>删除
</a-button>
</a-popconfirm>
</a-space>
</template>
<template #action="{ record }">
<a-space>
<a-button
@click="openEdit(record)"
type="primary"
shape="round"
size="small"
>修改</a-button
>
<a-popconfirm
:title="`确认删除这条数据吗?`"
ok-text="Yes"
cancel-text="No"
@confirm="remove(record)"
>
<a-button type="primary" danger shape="round" size="small"
>删除</a-button
>
</a-popconfirm>
</a-space>
</template>
</ele-pro-table>
</a-card>
</div>
<!-- 编辑弹窗 -->
</template>
<script>
// import _ from "lodash";
import {
listAllUrl,
saveLeqLevel,
updateLeqLevel,
removeLeqLevel,
removeBatchLeqLevel
} from "@/api/ecology/noise/road-noise-leq-level";
import { message } from 'ant-design-vue';
// import moment from "moment";
export default {
name: "RoadNoiseLeqLevel",
components: {},
data() {
return {
data: [],
// 表格数据接口
url: listAllUrl,
selection: [],
// 表格列配置
columns: [
{
title: "时段",
dataIndex: "timeSlot",
},
{
title: "等级",
dataIndex: "level",
},
{
title: "最小值",
dataIndex: "minLeq",
customRender: ({text})=>{
return text!=undefined? text.toFixed(1):undefined
}
},
{
title: "最大值",
dataIndex: "maxLeq",
customRender: ({text})=>{
return text!=undefined? text.toFixed(1):undefined
}
},
{
title: "评价",
dataIndex: "evaluate",
},
{
title: "排序",
dataIndex: "sortNumber",
},
{
title: "操作",
key: "action",
width: 150,
align: "center",
fixed: "right",
slots: {
customRender: "action",
},
},
],
// 表格搜索条件
where: {},
// 表格选中数据
selectionList: [],
// 是否显示编辑弹窗
showEdit: false,
// 表单数据
form: {},
loading: false,
rules: {
timeSlot:[{required: true,message: '请选择时段'}],
// minLeq: [{required: true,message: '请输入最小值',},],
// maxLeq: [{required: true,message: '请输入最大值',},],
level: [{required: true,message: '请输入等级',},],
// evaluate: [{required: true,message: '请输入评价',},],
sortNumber: [{required: true,message: '请输入排序',},],
},
};
},
mounted() {
},
methods: {
minLeqChange(e){
console.log(e)
},
/* 刷新表格 */
reload() {
this.$refs.table.reload({
where: this.where,
});
},
/* 重置搜索 */
reset() {
this.where = {};
this.reload();
},
/* 打开编辑弹窗 */
openEdit(row) {
// cloneRecord.mi
this.form = Object.assign({}, row);
this.showEdit = true;
this.$nextTick(() => {
this.$refs.form.clearValidate(); // 清除表单验证信息
});
},
async save() {
await this.$refs.form.validate();
const {minLeq,maxLeq } = this.form;
if(minLeq == undefined && maxLeq == undefined ){
message.error("最小值和最大值请至少填写一项!")
return;
}
const hide = this.$message.loading('请求中..', 0);
const form = this.form;
if (form.id) {
updateLeqLevel(form)
.then((res) => {
if (res.data.code == 0) {
this.showEdit = false;
this.$message.success(res.data.msg);
this.reload();
} else {
this.$message.error(res.data.msg);
}
})
.catch((error) => {
this.$message.error(error.message);
})
.finally(() => {
hide();
});
} else {
saveLeqLevel(form)
.then((res) => {
if (res.data.code == 0) {
this.showEdit = false;
this.$message.success(res.data.msg);
this.reload();
} else {
this.$message.error(res.data.msg);
}
})
.catch((error) => {
this.$message.error(error.message);
})
.finally(() => {
hide();
});
}
},
/* 删除单个 */
remove(row) {
const hide = this.$message.loading('请求中..', 0);
removeLeqLevel(row.id).then((res) => {
hide();
if (res.data.code === 0) {
this.$message.success(res.data.msg);
this.reload();
} else {
this.$message.error(res.data.msg);
}
}).catch(e => {
hide();
this.$message.error(e.message);
})
},
/* 批量删除 */
removeBatch() {
const hide = this.$message.loading('请求中..', 0);
const ids = this.selectionList.map((item) => item.id);
removeBatchLeqLevel(ids).then((res) => {
if (res.data.code === 0) {
this.$message.success(res.data.msg);
this.reload();
} else {
this.$message.error(res.data.msg);
}
}).catch(e => {
this.$message.error(e.message);
}).finally(() => {
hide();
})
}
},
};
</script>
<style scoped lang="less">
</style>

View File

@@ -0,0 +1,353 @@
<template>
<div class="ele-body">
<a-card :bordered="false">
<a-modal
v-model:visible="showEdit"
:title="form.roadNoisePlaceId !== undefined ? '修改' : '添加'"
:confirm-loading="loading"
:width="800"
:body-style="{ paddingBottom: '8px' }"
@ok="save"
>
<a-form
ref="form"
:model="form"
:rules="rules"
:label-col="{ md: { span: 6 }, sm: { span: 24 } }"
:wrapper-col="{ md: { span: 18 }, sm: { span: 24 } }"
>
<a-form-item label="测点名称" name="placeName">
<a-input v-model:value="form.placeName" placeholder="请输入测点名称" allow-clear />
</a-form-item>
<a-form-item label="测点经度" name="placeLng">
<a-input v-model:value="form.placeLng" placeholder="请输入测点经度" allow-clear />
</a-form-item>
<a-form-item label="测点纬度" name="placeLat">
<a-input v-model:value="form.placeLat" placeholder="请输入测点纬度" allow-clear />
</a-form-item>
<a-form-item label="机动车车道数" name="motorway">
<a-input type="number" v-model:value="form.motorway" placeholder="请输入机动车车道数" allow-clear />
</a-form-item>
<a-form-item label="车道类别" name="motorwayType">
<a-input v-model:value="form.motorwayType" placeholder="请输入车道类别" allow-clear />
</a-form-item>
<a-form-item label="道路等级" name="motorwayLevel">
<a-input v-model:value="form.motorwayLevel" placeholder="请输入道路等级" allow-clear />
</a-form-item>
<a-form-item label="测点参照物" name="refObj">
<a-input v-model:value="form.refObj" placeholder="请输入测点参照物" allow-clear />
</a-form-item>
<a-form-item label="道路覆盖人口(万人)" name="people">
<a-input v-model:value="form.people" placeholder="请输入道路覆盖人口(万人)" allow-clear />
</a-form-item>
<a-form-item label="监测站名" name="station">
<a-input v-model:value="form.station" placeholder="请输入监测站名" allow-clear />
</a-form-item>
<a-form-item label="监测仪器型号" name="monitorInstrumentModel">
<a-input v-model:value="form.monitorInstrumentModel" placeholder="请输入测监测仪器型号" allow-clear />
</a-form-item>
<a-form-item label="监测仪器编号" name="monitorInstrumentCode">
<a-input v-model:value="form.monitorInstrumentCode" placeholder="请输入监测仪器编号" allow-clear />
</a-form-item>
<a-form-item label="监测前校准值" name="beforeMonitorValue">
<a-input v-model:value="form.beforeMonitorValue" placeholder="请输入监测前校准值" allow-clear />
</a-form-item>
<a-form-item label="监测后校准值" name="afterMonitorValue">
<a-input v-model:value="form.afterMonitorValue" placeholder="请输入监测后校准值" allow-clear />
</a-form-item>
<a-form-item label="声校准器测量声压值" name="soundPressureValue">
<a-input v-model:value="form.soundPressureValue" placeholder="请输入声校准器测量声压值" allow-clear />
</a-form-item>
<a-form-item label="声校准仪器型号" name="soundInstrumentModel">
<a-input v-model:value="form.soundInstrumentModel" placeholder="请输入声校准仪器型号" allow-clear />
</a-form-item>
<a-form-item label="声校准仪器编号" name="soundInstrumentCode">
<a-input v-model:value="form.soundInstrumentCode" placeholder="请输入声校准仪器编号" allow-clear />
</a-form-item>
</a-form>
</a-modal>
<!-- 表格 -->
<ele-pro-table
v-model:selection="selectionList"
ref="table"
row-key="roadNoisePlaceId"
:datasource="url"
:columns="columns"
:where="where"
:scroll="{ x: 'max-content' }"
>
<template #toolbar>
<a-space>
<a-button @click="openEdit" type="primary">新增</a-button>
<a-popconfirm
:disabled="selectionList.length == 0"
:title="`确认删除${selectionList.length}条数据吗?`"
ok-text="Yes"
cancel-text="No"
@confirm="removeBatch"
>
<a-button
:disabled="selectionList.length == 0"
type="primary"
ghost
danger
>删除
</a-button>
</a-popconfirm>
</a-space>
</template>
<template #action="{ record }">
<a-space>
<a-button
@click="openEdit(record)"
type="primary"
shape="round"
size="small"
>修改</a-button
>
<a-popconfirm
:title="`确认删除这条数据吗?`"
ok-text="Yes"
cancel-text="No"
@confirm="remove(record)"
>
<a-button type="primary" danger shape="round" size="small"
>删除</a-button
>
</a-popconfirm>
</a-space>
</template>
</ele-pro-table>
</a-card>
</div>
<!-- 编辑弹窗 -->
</template>
<script>
// import _ from "lodash";
import {
listAllUrl,
savePlace,
updatePlace,
removePlace,
removeBatchPlace
} from "@/api/ecology/noise/road-noise-place";
// import moment from "moment";
export default {
name: "RoadNoisePlace",
components: {},
data() {
return {
data: [],
// 表格数据接口
url: listAllUrl,
selection: [],
// 表格列配置
columns: [
{
title: "测点名称",
dataIndex: "placeName",
sorter: true,
},
{
title: "测点经度",
dataIndex: "placeLng",
sorter: true,
},
{
title: "测点纬度",
dataIndex: "placeLat",
sorter: true,
},
{
title: "机动车车道数",
dataIndex: "motorway",
sorter: true,
},
{
title: "车道类别",
dataIndex: "motorwayType",
sorter: true,
},
{
title: "道路等级",
dataIndex: "motorwayLevel",
sorter: true,
},
{
title: "测点参照物",
dataIndex: "refObj",
sorter: true,
},
{
title: "道路覆盖人口(万人)",
dataIndex: "people",
sorter: true,
},
{
title: "监测站名",
dataIndex: "station",
sorter: true,
},
{
title: "监测仪器型号",
dataIndex: "monitorInstrumentModel",
sorter: true,
},
{
title: "监测仪器编号",
dataIndex: "monitorInstrumentCode",
sorter: true,
},
{
title: "监测前校准值",
dataIndex: "beforeMonitorValue",
sorter: true,
},
{
title: "声校准器测量声压值",
dataIndex: "soundPressureValue",
sorter: true,
},
{
title: "声校准仪器型号",
dataIndex: "soundInstrumentModel",
sorter: true,
},
{
title: "声校准仪器编号",
dataIndex: "soundInstrumentCode",
sorter: true,
},
{
title: "操作",
key: "action",
width: 150,
align: "center",
fixed: "right",
slots: {
customRender: "action",
},
},
],
// 表格搜索条件
where: {},
// 表格选中数据
selectionList: [],
// 是否显示编辑弹窗
showEdit: false,
// 表单数据
form: {},
loading: false,
rules: {
placeName:[{required: true,message: '请选择测点名称'}],
placeLng: [{required: true,message: '请输入测点经度',},],
placeLat: [{required: true,message: '请输入测点纬度',},],
},
};
},
mounted() {
},
methods: {
/* 刷新表格 */
reload() {
this.$refs.table.reload({
where: this.where,
});
},
/* 重置搜索 */
reset() {
this.where = {};
this.reload();
},
/* 打开编辑弹窗 */
openEdit(row) {
// cloneRecord.mi
this.form = Object.assign({}, row);
this.showEdit = true;
this.$nextTick(() => {
this.$refs.form.clearValidate(); // 清除表单验证信息
});
},
async save() {
await this.$refs.form.validate();
const hide = this.$message.loading('请求中..', 0);
const form = this.form;
if (form.roadNoisePlaceId) {
updatePlace(form)
.then((res) => {
if (res.data.code == 0) {
this.showEdit = false;
this.$message.success(res.data.msg);
this.reload();
} else {
this.$message.error(res.data.msg);
}
})
.catch((error) => {
this.$message.error(error.message);
})
.finally(() => {
hide();
});
} else {
savePlace(form)
.then((res) => {
if (res.data.code == 0) {
this.showEdit = false;
this.$message.success(res.data.msg);
this.reload();
} else {
this.$message.error(res.data.msg);
}
})
.catch((error) => {
this.$message.error(error.message);
})
.finally(() => {
hide();
});
}
},
/* 删除单个 */
remove(row) {
const hide = this.$message.loading('请求中..', 0);
removePlace(row.roadNoisePlaceId).then((res) => {
hide();
if (res.data.code === 0) {
this.$message.success(res.data.msg);
this.reload();
} else {
this.$message.error(res.data.msg);
}
}).catch(e => {
hide();
this.$message.error(e.message);
})
},
/* 批量删除 */
removeBatch() {
const hide = this.$message.loading('请求中..', 0);
const ids = this.selectionList.map((item) => item.roadNoisePlaceId);
removeBatchPlace(ids).then((res) => {
if (res.data.code === 0) {
this.$message.success(res.data.msg);
this.reload();
} else {
this.$message.error(res.data.msg);
}
}).catch(e => {
this.$message.error(e.message);
}).finally(() => {
hide();
})
}
},
};
</script>
<style scoped lang="less">
</style>

View File

@@ -52,7 +52,7 @@
<script> <script>
// import _ from "lodash"; // import _ from "lodash";
import XLSX from "xlsx"; import XLSX from "xlsx";
import { pageZoneNoiseStatisticUrl, getColumnOptions } from "@/api/ecology/zone-sound"; import { pageZoneNoiseStatisticUrl, getColumnOptions } from "@/api/ecology/noise/zone-sound";
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 utils from "./utils"; // import utils from "./utils";
export default { export default {

View File

@@ -81,7 +81,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 { pageZoneNoiseUrl, getColumnOptions } from "@/api/ecology/noise/zone-sound";
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";

View File

@@ -52,7 +52,7 @@
<script> <script>
// import _ from "lodash"; // import _ from "lodash";
import XLSX from "xlsx"; import XLSX from "xlsx";
import { statisticSourceUrl, getColumnOptions } from "@/api/ecology/zone-sound"; import { statisticSourceUrl, getColumnOptions } from "@/api/ecology/noise/zone-sound";
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 utils from "./utils"; // import utils from "./utils";
export default { export default {

View File

@@ -65,7 +65,7 @@
<script> <script>
// import _ from "lodash"; // import _ from "lodash";
import XLSX from "xlsx"; import XLSX from "xlsx";
import { statisticYearUrl, getColumnOptions } from "@/api/ecology/zone-sound"; import { statisticYearUrl, getColumnOptions } from "@/api/ecology/noise/zone-sound";
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 utils from "./utils"; // import utils from "./utils";
export default { export default {

View File

@@ -31,7 +31,7 @@ import {
getGisBase, getGisBase,
getGisArea, getGisArea,
getColumnOptions, getColumnOptions,
} from "@/api/ecology/function-sound"; } from "@/api/ecology/noise/function-sound";
let scene = null; let scene = null;
let pointLayer = null; let pointLayer = null;
let cityLayer = null; let cityLayer = null;

View File

@@ -31,7 +31,7 @@ import {
getGisBase, getGisBase,
getGisArea, getGisArea,
getColumnOptions, getColumnOptions,
} from "@/api/ecology/road-sound"; } from "@/api/ecology/noise/road-sound";
let scene = null; let scene = null;
let pointLayer = null; let pointLayer = null;
let cityLayer = null; let cityLayer = null;

View File

@@ -96,7 +96,7 @@
<script> <script>
import _ from "lodash"; import _ from "lodash";
import XLSX from "xlsx"; import XLSX from "xlsx";
import { pageRoadNoiseStatisticUrl } from "@/api/ecology/road-sound"; import { pageRoadNoiseStatisticUrl } from "@/api/ecology/noise/road-sound";
const columns = [ const columns = [
{ {
title: "城区", title: "城区",

View File

@@ -71,7 +71,7 @@
<script> <script>
// import _ from "lodash"; // import _ from "lodash";
import XLSX from "xlsx"; import XLSX from "xlsx";
import { pageRoadNoiseUrl, getColumnOptions } from "@/api/ecology/road-sound"; import { pageRoadNoiseUrl, getColumnOptions } from "@/api/ecology/noise/road-sound";
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";

View File

@@ -106,7 +106,7 @@ import XLSX from "xlsx";
import { import {
pageRoadNoiseCompare, pageRoadNoiseCompare,
getHistoryyears, getHistoryyears,
} from "@/api/ecology/road-sound"; } from "@/api/ecology/noise/road-sound";
export default { export default {
name: "StatisticSoundRoadCompare", name: "StatisticSoundRoadCompare",
components: {}, components: {},

View File

@@ -0,0 +1,46 @@
<template>
<div class="ele-body">
<a-card :bordered="false">
<a-tabs v-model:activeKey="activeKey">
<a-tab-pane key="place" tab="点位信息">
<place></place>
</a-tab-pane>
<a-tab-pane key="standard" tab="标准限值">
<leq-level></leq-level>
</a-tab-pane>
</a-tabs>
</a-card>
</div>
</template>
<script>
/**
*
*
*
*/
import LeqLevel from "./surface-water"
import Place from "./place"
export default {
name: 'DrinkingWaterDictIndex',
components: {
LeqLevel,
Place
},
data() {
return {
activeKey: 'standard'
};
},
methods: {}
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,353 @@
<template>
<div class="ele-body">
<a-card :bordered="false">
<a-modal
v-model:visible="showEdit"
:title="form.roadNoisePlaceId !== undefined ? '修改' : '添加'"
:confirm-loading="loading"
:width="800"
:body-style="{ paddingBottom: '8px' }"
@ok="save"
>
<a-form
ref="form"
:model="form"
:rules="rules"
:label-col="{ md: { span: 6 }, sm: { span: 24 } }"
:wrapper-col="{ md: { span: 18 }, sm: { span: 24 } }"
>
<a-form-item label="测点名称" name="placeName">
<a-input v-model:value="form.placeName" placeholder="请输入测点名称" allow-clear />
</a-form-item>
<a-form-item label="测点经度" name="placeLng">
<a-input v-model:value="form.placeLng" placeholder="请输入测点经度" allow-clear />
</a-form-item>
<a-form-item label="测点纬度" name="placeLat">
<a-input v-model:value="form.placeLat" placeholder="请输入测点纬度" allow-clear />
</a-form-item>
<a-form-item label="机动车车道数" name="motorway">
<a-input type="number" v-model:value="form.motorway" placeholder="请输入机动车车道数" allow-clear />
</a-form-item>
<a-form-item label="车道类别" name="motorwayType">
<a-input v-model:value="form.motorwayType" placeholder="请输入车道类别" allow-clear />
</a-form-item>
<a-form-item label="道路等级" name="motorwayLevel">
<a-input v-model:value="form.motorwayLevel" placeholder="请输入道路等级" allow-clear />
</a-form-item>
<a-form-item label="测点参照物" name="refObj">
<a-input v-model:value="form.refObj" placeholder="请输入测点参照物" allow-clear />
</a-form-item>
<a-form-item label="道路覆盖人口(万人)" name="people">
<a-input v-model:value="form.people" placeholder="请输入道路覆盖人口(万人)" allow-clear />
</a-form-item>
<a-form-item label="监测站名" name="station">
<a-input v-model:value="form.station" placeholder="请输入监测站名" allow-clear />
</a-form-item>
<a-form-item label="监测仪器型号" name="monitorInstrumentModel">
<a-input v-model:value="form.monitorInstrumentModel" placeholder="请输入测监测仪器型号" allow-clear />
</a-form-item>
<a-form-item label="监测仪器编号" name="monitorInstrumentCode">
<a-input v-model:value="form.monitorInstrumentCode" placeholder="请输入监测仪器编号" allow-clear />
</a-form-item>
<a-form-item label="监测前校准值" name="beforeMonitorValue">
<a-input v-model:value="form.beforeMonitorValue" placeholder="请输入监测前校准值" allow-clear />
</a-form-item>
<a-form-item label="监测后校准值" name="afterMonitorValue">
<a-input v-model:value="form.afterMonitorValue" placeholder="请输入监测后校准值" allow-clear />
</a-form-item>
<a-form-item label="声校准器测量声压值" name="soundPressureValue">
<a-input v-model:value="form.soundPressureValue" placeholder="请输入声校准器测量声压值" allow-clear />
</a-form-item>
<a-form-item label="声校准仪器型号" name="soundInstrumentModel">
<a-input v-model:value="form.soundInstrumentModel" placeholder="请输入声校准仪器型号" allow-clear />
</a-form-item>
<a-form-item label="声校准仪器编号" name="soundInstrumentCode">
<a-input v-model:value="form.soundInstrumentCode" placeholder="请输入声校准仪器编号" allow-clear />
</a-form-item>
</a-form>
</a-modal>
<!-- 表格 -->
<ele-pro-table
v-model:selection="selectionList"
ref="table"
row-key="roadNoisePlaceId"
:datasource="url"
:columns="columns"
:where="where"
:scroll="{ x: 'max-content' }"
>
<template #toolbar>
<a-space>
<a-button @click="openEdit" type="primary">新增</a-button>
<a-popconfirm
:disabled="selectionList.length == 0"
:title="`确认删除${selectionList.length}条数据吗?`"
ok-text="Yes"
cancel-text="No"
@confirm="removeBatch"
>
<a-button
:disabled="selectionList.length == 0"
type="primary"
ghost
danger
>删除
</a-button>
</a-popconfirm>
</a-space>
</template>
<template #action="{ record }">
<a-space>
<a-button
@click="openEdit(record)"
type="primary"
shape="round"
size="small"
>修改</a-button
>
<a-popconfirm
:title="`确认删除这条数据吗?`"
ok-text="Yes"
cancel-text="No"
@confirm="remove(record)"
>
<a-button type="primary" danger shape="round" size="small"
>删除</a-button
>
</a-popconfirm>
</a-space>
</template>
</ele-pro-table>
</a-card>
</div>
<!-- 编辑弹窗 -->
</template>
<script>
// import _ from "lodash";
import {
listAllUrl,
savePlace,
updatePlace,
removePlace,
removeBatchPlace
} from "@/api/ecology/noise/road-noise-place";
// import moment from "moment";
export default {
name: "RoadNoisePlace",
components: {},
data() {
return {
data: [],
// 表格数据接口
url: listAllUrl,
selection: [],
// 表格列配置
columns: [
{
title: "测点名称",
dataIndex: "placeName",
sorter: true,
},
{
title: "测点经度",
dataIndex: "placeLng",
sorter: true,
},
{
title: "测点纬度",
dataIndex: "placeLat",
sorter: true,
},
{
title: "机动车车道数",
dataIndex: "motorway",
sorter: true,
},
{
title: "车道类别",
dataIndex: "motorwayType",
sorter: true,
},
{
title: "道路等级",
dataIndex: "motorwayLevel",
sorter: true,
},
{
title: "测点参照物",
dataIndex: "refObj",
sorter: true,
},
{
title: "道路覆盖人口(万人)",
dataIndex: "people",
sorter: true,
},
{
title: "监测站名",
dataIndex: "station",
sorter: true,
},
{
title: "监测仪器型号",
dataIndex: "monitorInstrumentModel",
sorter: true,
},
{
title: "监测仪器编号",
dataIndex: "monitorInstrumentCode",
sorter: true,
},
{
title: "监测前校准值",
dataIndex: "beforeMonitorValue",
sorter: true,
},
{
title: "声校准器测量声压值",
dataIndex: "soundPressureValue",
sorter: true,
},
{
title: "声校准仪器型号",
dataIndex: "soundInstrumentModel",
sorter: true,
},
{
title: "声校准仪器编号",
dataIndex: "soundInstrumentCode",
sorter: true,
},
{
title: "操作",
key: "action",
width: 150,
align: "center",
fixed: "right",
slots: {
customRender: "action",
},
},
],
// 表格搜索条件
where: {},
// 表格选中数据
selectionList: [],
// 是否显示编辑弹窗
showEdit: false,
// 表单数据
form: {},
loading: false,
rules: {
placeName:[{required: true,message: '请选择测点名称'}],
placeLng: [{required: true,message: '请输入测点经度',},],
placeLat: [{required: true,message: '请输入测点纬度',},],
},
};
},
mounted() {
},
methods: {
/* 刷新表格 */
reload() {
this.$refs.table.reload({
where: this.where,
});
},
/* 重置搜索 */
reset() {
this.where = {};
this.reload();
},
/* 打开编辑弹窗 */
openEdit(row) {
// cloneRecord.mi
this.form = Object.assign({}, row);
this.showEdit = true;
this.$nextTick(() => {
this.$refs.form.clearValidate(); // 清除表单验证信息
});
},
async save() {
await this.$refs.form.validate();
const hide = this.$message.loading('请求中..', 0);
const form = this.form;
if (form.roadNoisePlaceId) {
updatePlace(form)
.then((res) => {
if (res.data.code == 0) {
this.showEdit = false;
this.$message.success(res.data.msg);
this.reload();
} else {
this.$message.error(res.data.msg);
}
})
.catch((error) => {
this.$message.error(error.message);
})
.finally(() => {
hide();
});
} else {
savePlace(form)
.then((res) => {
if (res.data.code == 0) {
this.showEdit = false;
this.$message.success(res.data.msg);
this.reload();
} else {
this.$message.error(res.data.msg);
}
})
.catch((error) => {
this.$message.error(error.message);
})
.finally(() => {
hide();
});
}
},
/* 删除单个 */
remove(row) {
const hide = this.$message.loading('请求中..', 0);
removePlace(row.roadNoisePlaceId).then((res) => {
hide();
if (res.data.code === 0) {
this.$message.success(res.data.msg);
this.reload();
} else {
this.$message.error(res.data.msg);
}
}).catch(e => {
hide();
this.$message.error(e.message);
})
},
/* 批量删除 */
removeBatch() {
const hide = this.$message.loading('请求中..', 0);
const ids = this.selectionList.map((item) => item.roadNoisePlaceId);
removeBatchPlace(ids).then((res) => {
if (res.data.code === 0) {
this.$message.success(res.data.msg);
this.reload();
} else {
this.$message.error(res.data.msg);
}
}).catch(e => {
this.$message.error(e.message);
}).finally(() => {
hide();
})
}
},
};
</script>
<style scoped lang="less">
</style>

View File

@@ -0,0 +1,286 @@
<template>
<div class="ele-body">
<a-card :bordered="false">
<a-modal
v-model:visible="showEdit"
:title="form.surfaceWaterEvaluationStandardId !== undefined ? '修改' : '添加'"
:confirm-loading="loading"
:width="500"
:body-style="{ paddingBottom: '8px' }"
@ok="save"
>
<a-form
ref="form"
:model="form"
:rules="rules"
:label-col="{ md: { span: 6 }, sm: { span: 24 } }"
:wrapper-col="{ md: { span: 18 }, sm: { span: 24 } }"
>
<a-form-item label="指标名称" name="minLeq">
<a-input v-model:value="form.indicatorName" allow-clear></a-input>
</a-form-item>
<a-form-item label="类别" name="category">
<a-select v-model:value="form.category">
<a-select-option v-for="item in categoryOptions" :key="item.value">{{item.label}}</a-select-option>
</a-select>
</a-form-item>
<a-form-item label="比较符号" name="comparisonSymbol">
<a-select v-model:value="form.comparisonSymbol">
<a-select-option v-for="item in comparOptions" :key="item.value">{{item.label}}</a-select-option>
</a-select>
</a-form-item>
<a-form-item label="指数类别值" name="categoryValue">
<a-input type="number" v-model:value="form.categoryValue" />
</a-form-item>
</a-form>
</a-modal>
<!-- 表格 -->
<ele-pro-table
v-model:selection="selectionList"
ref="table"
row-key="surfaceWaterEvaluationStandardId"
:datasource="url"
:columns="columns"
:where="where"
:need-page="false"
:scroll="{ x: 'max-content' }"
>
<template #categoryValue="{ record }">
{{comparOptions.find(item=>item.value == record.comparisonSymbol).label}}
{{record.categoryValue}}
</template>
<template #toolbar>
<a-space>
<a-button @click="openEdit" type="primary">新增</a-button>
<a-popconfirm
:disabled="selectionList.length == 0"
:title="`确认删除${selectionList.length}条数据吗?`"
ok-text="Yes"
cancel-text="No"
@confirm="removeBatch"
>
<a-button
:disabled="selectionList.length == 0"
type="primary"
ghost
danger
>删除
</a-button>
</a-popconfirm>
</a-space>
</template>
<template #action="{ record }">
<a-space>
<a-button
@click="openEdit(record)"
type="primary"
shape="round"
size="small"
>修改</a-button
>
<a-popconfirm
:title="`确认删除这条数据吗?`"
ok-text="Yes"
cancel-text="No"
@confirm="remove(record)"
>
<a-button type="primary" danger shape="round" size="small"
>删除</a-button
>
</a-popconfirm>
</a-space>
</template>
</ele-pro-table>
</a-card>
</div>
<!-- 编辑弹窗 -->
</template>
<script>
// import _ from "lodash";
import {
pageSurfaceWaterStandardAllUrl,
saveSurfaceWaterStandard,
updateSurfaceWaterStandard,
removeBatchSurfaceWaterStandard,
removeSurfaceWaterStandard
} from "@/api/ecology/water/surface-water-standard";
// import moment from "moment";
export default {
name: "SurfaceWaterStandard",
components: {},
data() {
return {
data: [],
// 表格数据接口
url: pageSurfaceWaterStandardAllUrl,
selection: [],
// 表格列配置
columns: [
{
title: "指标名称",
dataIndex: "indicatorName",
},
{
title: "类别",
dataIndex: "category",
},
{
title: "指数类别值",
slots: {
customRender: "categoryValue",
},
},
{
title: "操作",
key: "action",
width: 150,
align: "center",
fixed: "right",
slots: {
customRender: "action",
},
},
],
comparOptions:[
{label:"=",value:"eq"},
{label:"≤",value:"le"},
{label:"≥",value:"ge"},
{label:"<",value:"lt"},
{label:">",value:"gt"},
],
categoryOptions:[
{label:"I",value:"I"},
{label:"II",value:"II"},
{label:"III",value:"III"},
{label:"IV",value:"IV"},
{label:"V",value:"V"},
],
// 表格搜索条件
where: {},
// 表格选中数据
selectionList: [],
// 是否显示编辑弹窗
showEdit: false,
// 表单数据
form: {},
loading: false,
rules: {
indicatorName:[{required: true,message: '请输入指标名称'}],
category: [{required: true,message: '请选择类别',},],
comparisonSymbol: [{required: true,message: '请选择比较符',},],
categoryValue: [{required: true,message: '请输入类别值',},],
},
};
},
mounted() {
},
methods: {
minLeqChange(e){
console.log(e)
},
/* 刷新表格 */
reload() {
this.$refs.table.reload({
where: this.where,
});
},
/* 重置搜索 */
reset() {
this.where = {};
this.reload();
},
/* 打开编辑弹窗 */
openEdit(row) {
// cloneRecord.mi
this.form = Object.assign({}, row);
this.showEdit = true;
this.$nextTick(() => {
this.$refs.form.clearValidate(); // 清除表单验证信息
});
},
async save() {
await this.$refs.form.validate();
const hide = this.$message.loading('请求中..', 0);
const form = this.form;
if (form.surfaceWaterEvaluationStandardId) {
updateSurfaceWaterStandard(form)
.then((res) => {
if (res.data.code == 0) {
this.showEdit = false;
this.$message.success(res.data.msg);
this.reload();
} else {
this.$message.error(res.data.msg);
}
})
.catch((error) => {
this.$message.error(error.message);
})
.finally(() => {
hide();
});
} else {
saveSurfaceWaterStandard(form)
.then((res) => {
if (res.data.code == 0) {
this.showEdit = false;
this.$message.success(res.data.msg);
this.reload();
} else {
this.$message.error(res.data.msg);
}
})
.catch((error) => {
this.$message.error(error.message);
})
.finally(() => {
hide();
});
}
},
/* 删除单个 */
remove(row) {
const hide = this.$message.loading('请求中..', 0);
removeSurfaceWaterStandard(row.surfaceWaterEvaluationStandardId).then((res) => {
hide();
if (res.data.code === 0) {
this.$message.success(res.data.msg);
this.reload();
} else {
this.$message.error(res.data.msg);
}
}).catch(e => {
hide();
this.$message.error(e.message);
})
},
/* 批量删除 */
removeBatch() {
const hide = this.$message.loading('请求中..', 0);
const ids = this.selectionList.map((item) => item.surfaceWaterEvaluationStandardId);
removeBatchSurfaceWaterStandard(ids).then((res) => {
if (res.data.code === 0) {
this.$message.success(res.data.msg);
this.reload();
} else {
this.$message.error(res.data.msg);
}
}).catch(e => {
this.$message.error(e.message);
}).finally(() => {
hide();
})
}
},
};
</script>
<style scoped lang="less">
</style>

View File

@@ -96,7 +96,7 @@
<script> <script>
import _ from "lodash"; import _ from "lodash";
import XLSX from "xlsx"; import XLSX from "xlsx";
import { pageRoadNoiseStatisticUrl } from "@/api/ecology/road-sound"; import { pageRoadNoiseStatisticUrl } from "@/api/ecology/noise/road-sound";
const columns = [ const columns = [
{ {
title: "城区", title: "城区",

View File

@@ -91,7 +91,7 @@
<script> <script>
// import _ from "lodash"; // import _ from "lodash";
import XLSX from "xlsx"; import XLSX from "xlsx";
import { pageRoadNoiseUrl, getColumnOptions } from "@/api/ecology/road-sound"; import { pageRoadNoiseUrl, getColumnOptions } from "@/api/ecology/noise/road-sound";
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";

View File

@@ -106,7 +106,7 @@ import XLSX from "xlsx";
import { import {
pageRoadNoiseCompare, pageRoadNoiseCompare,
getHistoryyears, getHistoryyears,
} from "@/api/ecology/road-sound"; } from "@/api/ecology/noise/road-sound";
export default { export default {
name: "StatisticSoundRoadCompare", name: "StatisticSoundRoadCompare",
components: {}, components: {},

View File

@@ -0,0 +1,134 @@
<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.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="roadNoiseId"
:datasource="url"
:columns="columns"
:where="where"
:scroll="{ x: 'max-content' }"
>
</ele-pro-table>
</a-card>
</div>
<!-- 编辑弹窗 -->
</template>
<script>
// import _ from "lodash";
import XLSX from "xlsx";
import { pageRoadNoiseUrl, getColumnOptions } from "@/api/ecology/noise/road-sound";
import locale from "ant-design-vue/es/date-picker/locale/zh_CN";
// import moment from "moment";
// import utils from "./utils";
export default {
name: "StatisticSoundRoadBase",
components: {},
data() {
return {
data: [],
locale,
bill: {},
// 表格数据接口
url: pageRoadNoiseUrl,
selection: [],
// 表格列配置
columns: [
{title: "年份",dataIndex: "year",},
{title: "路段总长度(米)",dataIndex: "roadLengthTotal",},
{title: "监测点数",dataIndex: "placeTotal",},
{title: "平均路长(米)",dataIndex: "roadLengthAvg",},
{title: "平均路宽(米)",dataIndex: "roadWidthAvg",},
{title: "超70分贝路段长度占总路长比例",dataIndex: "badProportion",},
],
areaOptions: [],
// 表格搜索条件
where: {
checked: 1,
},
// 表格选中数据
selectionList: [],
};
},
mounted() {
this.loadOptionData();
},
methods: {
/**获取下来框数据 */
loadOptionData() {
getColumnOptions("area").then((res) => {
this.areaOptions = res.data.data.map((item) => {
return {
label: item,
value: item,
};
});
});
},
/* 刷新表格 */
reload() {
this.$refs.table.reload({
where: this.where,
});
},
/* 重置搜索 */
reset() {
this.where = {
checked: 1,
};
this.reload();
},
exportFile() {
const columns = [
];
const arr = [];
const th = columns.map((item) => item.title);
arr.push(th);
this.data.forEach((d) => {
const td = columns.map((item) => d[item.dataIndex]);
arr.push(td);
});
let sheet = XLSX.utils.aoa_to_sheet(arr);
this.$util.exportSheet(XLSX, sheet, new Date().getTime().toString());
},
},
};
</script>
<style scoped lang="less">
</style>

View File

@@ -52,7 +52,7 @@
<script> <script>
// import _ from "lodash"; // import _ from "lodash";
import XLSX from "xlsx"; import XLSX from "xlsx";
import { pageZoneNoiseStatisticUrl, getColumnOptions } from "@/api/ecology/zone-sound"; import { pageZoneNoiseStatisticUrl, getColumnOptions } from "@/api/ecology/noise/zone-sound";
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 utils from "./utils"; // import utils from "./utils";
export default { export default {

View File

@@ -81,7 +81,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 { pageZoneNoiseUrl, getColumnOptions } from "@/api/ecology/noise/zone-sound";
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";

View File

@@ -52,7 +52,7 @@
<script> <script>
// import _ from "lodash"; // import _ from "lodash";
import XLSX from "xlsx"; import XLSX from "xlsx";
import { statisticSourceUrl, getColumnOptions } from "@/api/ecology/zone-sound"; import { statisticSourceUrl, getColumnOptions } from "@/api/ecology/noise/zone-sound";
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 utils from "./utils"; // import utils from "./utils";
export default { export default {

View File

@@ -65,7 +65,7 @@
<script> <script>
// import _ from "lodash"; // import _ from "lodash";
import XLSX from "xlsx"; import XLSX from "xlsx";
import { statisticYearUrl, getColumnOptions } from "@/api/ecology/zone-sound"; import { statisticYearUrl, getColumnOptions } from "@/api/ecology/noise/zone-sound";
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 utils from "./utils"; // import utils from "./utils";
export default { export default {

View File

@@ -96,7 +96,7 @@
<script> <script>
import _ from "lodash"; import _ from "lodash";
import XLSX from "xlsx"; import XLSX from "xlsx";
import { pageRoadNoiseStatisticUrl } from "@/api/ecology/road-sound"; import { pageRoadNoiseStatisticUrl } from "@/api/ecology/noise/road-sound";
const columns = [ const columns = [
{ {
title: "城区", title: "城区",

View File

@@ -91,7 +91,7 @@
<script> <script>
// import _ from "lodash"; // import _ from "lodash";
import XLSX from "xlsx"; import XLSX from "xlsx";
import { pageRoadNoiseUrl, getColumnOptions } from "@/api/ecology/road-sound"; import { pageRoadNoiseUrl, getColumnOptions } from "@/api/ecology/noise/road-sound";
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";

View File

@@ -106,7 +106,7 @@ import XLSX from "xlsx";
import { import {
pageRoadNoiseCompare, pageRoadNoiseCompare,
getHistoryyears, getHistoryyears,
} from "@/api/ecology/road-sound"; } from "@/api/ecology/noise/road-sound";
export default { export default {
name: "StatisticSoundRoadCompare", name: "StatisticSoundRoadCompare",
components: {}, components: {},

View File

@@ -52,7 +52,7 @@
<script> <script>
// import _ from "lodash"; // import _ from "lodash";
import XLSX from "xlsx"; import XLSX from "xlsx";
import { pageZoneNoiseStatisticUrl, getColumnOptions } from "@/api/ecology/zone-sound"; import { pageZoneNoiseStatisticUrl, getColumnOptions } from "@/api/ecology/noise/zone-sound";
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 utils from "./utils"; // import utils from "./utils";
export default { export default {

View File

@@ -81,7 +81,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 { pageZoneNoiseUrl, getColumnOptions } from "@/api/ecology/noise/zone-sound";
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";

View File

@@ -52,7 +52,7 @@
<script> <script>
// import _ from "lodash"; // import _ from "lodash";
import XLSX from "xlsx"; import XLSX from "xlsx";
import { statisticSourceUrl, getColumnOptions } from "@/api/ecology/zone-sound"; import { statisticSourceUrl, getColumnOptions } from "@/api/ecology/noise/zone-sound";
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 utils from "./utils"; // import utils from "./utils";
export default { export default {

View File

@@ -65,7 +65,7 @@
<script> <script>
// import _ from "lodash"; // import _ from "lodash";
import XLSX from "xlsx"; import XLSX from "xlsx";
import { statisticYearUrl, getColumnOptions } from "@/api/ecology/zone-sound"; import { statisticYearUrl, getColumnOptions } from "@/api/ecology/noise/zone-sound";
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 utils from "./utils"; // import utils from "./utils";
export default { export default {

View File

@@ -91,7 +91,7 @@
<script> <script>
// import _ from "lodash"; // import _ from "lodash";
import XLSX from "xlsx"; import XLSX from "xlsx";
import { pageRoadNoiseUrl, getColumnOptions } from "@/api/ecology/road-sound"; import { pageRoadNoiseUrl, getColumnOptions } from "@/api/ecology/noise/road-sound";
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";