修正统计平均值

This commit is contained in:
weicw
2021-08-23 18:20:11 +08:00
parent fb2239a0b7
commit a460e0c3e4
6 changed files with 105 additions and 272 deletions

View File

@@ -246,7 +246,7 @@ export default {
hide(); hide();
Modal.error({ Modal.error({
title: "导入失败", title: "导入失败",
content: "表格格式有误,请检查后重新上传!", content: error.message,
}); });
} }
// console.log(billData); // console.log(billData);

View File

@@ -419,6 +419,15 @@
</a-space> </a-space>
</template> </template>
<template #Leq="{ text,record }">
<a-tag v-if="(record.timeSlot == '昼' && text <= 68) || (record.timeSlot == '夜' && text <= 58)" color="green">{{text}}</a-tag>
<a-tag v-else-if="(record.timeSlot == '昼' && text > 68 && text <=70) || (record.timeSlot == '夜' && text > 58 && text <=60)" color="blue">{{text}}</a-tag>
<a-tag v-else-if="(record.timeSlot == '昼' && text > 70 && text <=72) || (record.timeSlot == '夜' && text > 60 && text <=62)" color="red">{{text}}</a-tag>
<a-tag v-else-if="(record.timeSlot == '昼' && text > 62 && text <=74) || (record.timeSlot == '夜' && text > 62 && text <=64)" color="red">{{text}}</a-tag>
<a-tag v-else-if="(record.timeSlot == '昼' && text > 74 ) || (record.timeSlot == '夜' && text > 64)" color="red">{{text}}</a-tag>
<template v-else color="#FFF">{{text}}</template>
</template>
<template #action="{ record }"> <template #action="{ record }">
<a-space> <a-space>
<a-button <a-button
@@ -547,6 +556,7 @@ export default {
{ {
title: "LeqdB(A)", title: "LeqdB(A)",
dataIndex: "indexLeq", dataIndex: "indexLeq",
slots: {customRender: "Leq"},
sorter: true, sorter: true,
}, },
{ {

View File

@@ -18,7 +18,7 @@ export default {
} else { } else {
quarter = 4 quarter = 4
} }
return { const row = {
monitorYear: item[0], monitorYear: item[0],
place: item[1], place: item[1],
placeCode: item[2], placeCode: item[2],
@@ -44,8 +44,20 @@ export default {
indexLmin: item[19], indexLmin: item[19],
indexLmax: item[20], indexLmax: item[20],
quarter quarter
} }
if (row.monitorHour >= 6 && row.monitorHour <= 22 && row.timeSlot != "昼") {
throw new Error(row.place + "时段有误")
}
if (row.monitorHour <= 6 && row.monitorHour > 22 && row.timeSlot != "夜") {
throw new Error(row.place + "时段有误")
}
if(row.indexL10 < row.indexL50 || row.indexL50 < row.indexL90){
throw new Error(row.place + "数值有误")
}
return row;
}) })
}, },
@@ -97,7 +109,7 @@ export default {
if (item[16] >= 6 && item[16] <= 22) { if (item[16] >= 6 && item[16] <= 22) {
timeSlot = "昼" timeSlot = "昼"
} }
return { const row = {
regionCode: item[0], regionCode: item[0],
regionLevel: "县级", regionLevel: "县级",
monitorYear: item[1], monitorYear: item[1],
@@ -141,6 +153,10 @@ export default {
quarter quarter
} }
if(row.indexL10 < row.indexL50 || row.indexL50 < row.indexL90){
throw new Error(row.place + "数值有误")
}
return row;
}) })
} }
} }

View File

@@ -6,12 +6,6 @@
<!-- 搜索表单 --> <!-- 搜索表单 -->
<a-form :model="where" layout="inline" :labelCol="{ offset: 1}"> <a-form :model="where" layout="inline" :labelCol="{ offset: 1}">
<a-row> <a-row>
<a-col :lg="6" :md="12" :sm="24" :xs="24">
<a-form-item label="统计模块:">
<a-select :options="modelOptions" v-model:value="where.model" placeholder="统计模块">
</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 :options="timeSlotOptions" v-model:value="where.timeSlot" placeholder="昼夜"> <a-select :options="timeSlotOptions" v-model:value="where.timeSlot" placeholder="昼夜">
@@ -50,20 +44,13 @@
import { import {
pageRoadNoiseStatisticUrl pageRoadNoiseStatisticUrl
} from "@/api/ecology/road-sound" } from "@/api/ecology/road-sound"
const columns = [{ const columns = [
title: '测点',
dataIndex: 'place',
},
{
title: '路段',
dataIndex: 'road',
},
{ {
title: '城区', title: '城区',
dataIndex: 'area', dataIndex: 'area',
}, },
{ {
title: '市', title: '市',
dataIndex: 'city', dataIndex: 'city',
@@ -71,248 +58,32 @@
{ {
title: '路长', title: '路长',
dataIndex: 'roadLength', dataIndex: 'roadLength',
customRender: ({
text
}) => Math.round(text)
}, },
{ {
title: '路宽', title: '路宽',
dataIndex: 'roadWidth', dataIndex: 'roadWidth',
customRender: ({
text
}) => Math.round(text)
},
{
title: '20分钟中小型车流量',
children: [{
title: '平均',
dataIndex: 'avgSmallTrafficFlow',
customRender: ({
text
}) => Math.round(text)
},
{
title: '最大',
dataIndex: 'maxSmallTrafficFlow',
customRender: ({
text
}) => Math.round(text)
},
{
title: '最小',
dataIndex: 'minSmallTrafficFlow',
customRender: ({
text
}) => Math.round(text)
},
],
},
{
title: '20分钟大型车流量',
children: [{
title: '平均',
dataIndex: 'avgLargeTrafficFlow',
customRender: ({
text
}) => Math.round(text)
},
{
title: '最大',
dataIndex: 'maxLargeTrafficFlow',
customRender: ({
text
}) => Math.round(text)
},
{
title: '最小',
dataIndex: 'minLargeTrafficFlow',
customRender: ({
text
}) => Math.round(text)
},
]
}, },
{ {
title: 'LeqdB(A)', title: 'LeqdB(A)',
children: [{
title: '平均',
dataIndex: 'avgLeq', dataIndex: 'avgLeq',
customRender: ({
text
}) => Number(text).toFixed(2)
}, },
{ {
title: '最大', title: 'SDdB(A)',
dataIndex: 'maxLeq',
customRender: ({
text
}) => Number(text).toFixed(2)
},
{
title: '最小',
dataIndex: 'minLeq',
customRender: ({
text
}) => Number(text).toFixed(2)
},
]
},
{
title: "SDdB(A)",
children: [{
title: '平均',
dataIndex: 'avgSD', dataIndex: 'avgSD',
customRender: ({
text
}) => Number(text).toFixed(2)
}, },
{ {
title: '最大', title: 'L10dB(A)',
dataIndex: 'maxSD',
customRender: ({
text
}) => Number(text).toFixed(2)
},
{
title: '最小',
dataIndex: 'minSD',
customRender: ({
text
}) => Number(text).toFixed(2)
},
]
},
{
title: "L10dB(A)",
children: [
{
title: '平均',
dataIndex: 'avgL10', dataIndex: 'avgL10',
customRender: ({
text
}) => Number(text).toFixed(2)
}, },
{ {
title: '最大',
dataIndex: 'maxL10',
customRender: ({
text
}) => Number(text).toFixed(2)
},
{
title: '最小',
dataIndex: 'minL10',
customRender: ({
text
}) => Number(text).toFixed(2)
},
]
}, {
title: 'L50dB(A)', title: 'L50dB(A)',
children: [{
title: '平均',
dataIndex: 'avgL50', dataIndex: 'avgL50',
customRender: ({
text
}) => Number(text).toFixed(2)
}, },
{ {
title: '最大', title: 'L90dB(A)',
dataIndex: 'maxL50',
customRender: ({
text
}) => Number(text).toFixed(2)
},
{
title: '最小',
dataIndex: 'minL50',
customRender: ({
text
}) => Number(text).toFixed(2)
},
]
},
{
title: "L90dB(A)",
children: [
{
title: '平均',
dataIndex: 'avgL90', dataIndex: 'avgL90',
customRender: ({
text
}) => Number(text).toFixed(2)
}, },
{
title: '最大',
dataIndex: 'maxL90',
customRender: ({
text
}) => Number(text).toFixed(2)
},
{
title: '最小',
dataIndex: 'minL90',
customRender: ({
text
}) => Number(text).toFixed(2)
},
]
},
{
title: "LmindB(A)",
children: [{
title: '平均',
dataIndex: 'avgLmin',
customRender: ({
text
}) => Number(text).toFixed(2)
},
{
title: '最大',
dataIndex: 'maxLmin',
customRender: ({
text
}) => Number(text).toFixed(2)
},
{
title: '最小',
dataIndex: 'minLmin',
customRender: ({
text
}) => Number(text).toFixed(2)
},
]
}, {
title: 'LmaxdB(A)',
children: [{
title: '平均',
dataIndex: 'avgLmax',
customRender: ({
text
}) => Number(text).toFixed(2)
},
{
title: '最大',
dataIndex: 'maxLmax',
customRender: ({
text
}) => Number(text).toFixed(2)
},
{
title: '最小',
dataIndex: 'minLmax',
customRender: ({
text
}) => Number(text).toFixed(2)
},
]
},
] ]
export default { export default {
name: 'StatisticSoundRoadAverage', name: 'StatisticSoundRoadAverage',
@@ -324,7 +95,7 @@
url: pageRoadNoiseStatisticUrl, url: pageRoadNoiseStatisticUrl,
data: [], data: [],
where: { where: {
model: "place" model: "area"
}, },
timeScope: [], timeScope: [],
columns, columns,
@@ -380,7 +151,7 @@
/* 重置搜索 */ /* 重置搜索 */
reset() { reset() {
this.where = { this.where = {
model: "place", model: "area",
timeSlot: "昼" timeSlot: "昼"
}; };
this.this.timeScope = [] this.this.timeScope = []

View File

@@ -74,6 +74,14 @@
:scroll="{ x: 'max-content' }" :scroll="{ x: 'max-content' }"
@done="(d) => (data = d.data)" @done="(d) => (data = d.data)"
> >
<template #Leq="{ text,record }">
<a-tag v-if="(record.timeSlot == '昼' && text <= 68) || (record.timeSlot == '夜' && text <= 58)" color="green">{{text}}</a-tag>
<a-tag v-else-if="(record.timeSlot == '昼' && text > 68 && text <=70) || (record.timeSlot == '夜' && text > 58 && text <=60)" color="blue">{{text}}</a-tag>
<a-tag v-else-if="(record.timeSlot == '昼' && text > 70 && text <=72) || (record.timeSlot == '夜' && text > 60 && text <=62)" color="red">{{text}}</a-tag>
<a-tag v-else-if="(record.timeSlot == '昼' && text > 62 && text <=74) || (record.timeSlot == '夜' && text > 62 && text <=64)" color="red">{{text}}</a-tag>
<a-tag v-else-if="(record.timeSlot == '昼' && text > 74 ) || (record.timeSlot == '夜' && text > 64)" color="red">{{text}}</a-tag>
<template v-else color="#FFF">{{text}}</template>
</template>
</ele-pro-table> </ele-pro-table>
</a-card> </a-card>
</div> </div>
@@ -173,7 +181,9 @@ export default {
{ {
title: "LeqdB(A)", title: "LeqdB(A)",
dataIndex: "indexLeq", dataIndex: "indexLeq",
slots: {customRender: "Leq"},
sorter: true, sorter: true,
}, },
{ {
title: "SDdB(A)", title: "SDdB(A)",

View File

@@ -261,123 +261,149 @@ export default {
this.hisYears.forEach((item) => { this.hisYears.forEach((item) => {
if ( if (
(!this.where.timeRange[0] || (!this.where.timeRange[0] || this.where.timeRange[0] <= item) &&
this.where.timeRange[0] <= item) && (!this.where.timeRange[1] || this.where.timeRange[1] >= item)
(!this.where.timeRange[1] ||
this.where.timeRange[1] >= item)
) { ) {
if (this.where.groupTimeLength == "quarter") { if (this.where.groupTimeLength == "quarter") {
columns.push({ columns.push({
title: item + "年第一季度Leq", title: item + "年第一季度Leq",
dataIndex: item + "1" + "Leq", dataIndex: item + "1" + "Leq",
customRender: ({ text }) =>text? Number(text).toFixed(1):"",
}); });
columns.push({ columns.push({
title: item + "年第二季度Leq", title: item + "年第二季度Leq",
dataIndex: item + "2" + "Leq", dataIndex: item + "2" + "Leq",
customRender: ({ text }) =>text? Number(text).toFixed(1):"",
}); });
columns.push({ columns.push({
title: item + "年第三季度Leq", title: item + "年第三季度Leq",
dataIndex: item + "3" + "Leq", dataIndex: item + "3" + "Leq",
customRender: ({ text }) =>text? Number(text).toFixed(1):"",
}); });
columns.push({ columns.push({
title: item + "年第四季度Leq", title: item + "年第四季度Leq",
dataIndex: item + "4" + "Leq", dataIndex: item + "4" + "Leq",
customRender: ({ text }) =>text? Number(text).toFixed(1):"",
}); });
columns.push({ columns.push({
title: item + "年第一季度SD", title: item + "年第一季度SD",
dataIndex: item + "1" + "Sd", dataIndex: item + "1" + "Sd",
customRender: ({ text }) =>text? Number(text).toFixed(1):"",
}); });
columns.push({ columns.push({
title: item + "年第二季度SD", title: item + "年第二季度SD",
dataIndex: item + "2" + "Sd", dataIndex: item + "2" + "Sd",
customRender: ({ text }) =>text? Number(text).toFixed(1):"",
}); });
columns.push({ columns.push({
title: item + "年第三季度SD", title: item + "年第三季度SD",
dataIndex: item + "3" + "Sd", dataIndex: item + "3" + "Sd",
customRender: ({ text }) =>text? Number(text).toFixed(1):"",
}); });
columns.push({ columns.push({
title: item + "年第四季度SD", title: item + "年第四季度SD",
dataIndex: item + "4" + "Sd", dataIndex: item + "4" + "Sd",
customRender: ({ text }) =>text? Number(text).toFixed(1):"",
}); });
columns.push({ columns.push({
title: item + "年第一季度L10", title: item + "年第一季度L10",
dataIndex: item + "1" + "L10", dataIndex: item + "1" + "L10",
customRender: ({ text }) =>text? Number(text).toFixed(1):"",
}); });
columns.push({ columns.push({
title: item + "年第二季度L10", title: item + "年第二季度L10",
dataIndex: item + "2" + "L10", dataIndex: item + "2" + "L10",
customRender: ({ text }) =>text? Number(text).toFixed(1):"",
}); });
columns.push({ columns.push({
title: item + "年第三季度L10", title: item + "年第三季度L10",
dataIndex: item + "3" + "L10", dataIndex: item + "3" + "L10",
customRender: ({ text }) =>text? Number(text).toFixed(1):"",
}); });
columns.push({ columns.push({
title: item + "年第四季度L10", title: item + "年第四季度L10",
dataIndex: item + "4" + "L10", dataIndex: item + "4" + "L10",
customRender: ({ text }) =>text? Number(text).toFixed(1):"",
}); });
columns.push({ columns.push({
title: item + "年第一季度L50", title: item + "年第一季度L50",
dataIndex: item + "1" + "L50", dataIndex: item + "1" + "L50",
customRender: ({ text }) =>text? Number(text).toFixed(1):"",
}); });
columns.push({ columns.push({
title: item + "年第二季度L50", title: item + "年第二季度L50",
dataIndex: item + "2" + "L50", dataIndex: item + "2" + "L50",
customRender: ({ text }) =>text? Number(text).toFixed(1):"",
}); });
columns.push({ columns.push({
title: item + "年第三季度L50", title: item + "年第三季度L50",
dataIndex: item + "3" + "L50", dataIndex: item + "3" + "L50",
customRender: ({ text }) =>text? Number(text).toFixed(1):"",
}); });
columns.push({ columns.push({
title: item + "年第四季度L50", title: item + "年第四季度L50",
dataIndex: item + "4" + "L50", dataIndex: item + "4" + "L50",
customRender: ({ text }) =>text? Number(text).toFixed(1):"",
}); });
columns.push({ columns.push({
title: item + "年第一季度L90", title: item + "年第一季度L90",
dataIndex: item + "1" + "L90", dataIndex: item + "1" + "L90",
customRender: ({ text }) =>text? Number(text).toFixed(1):"",
}); });
columns.push({ columns.push({
title: item + "年第二季度L90", title: item + "年第二季度L90",
dataIndex: item + "2" + "L90", dataIndex: item + "2" + "L90",
customRender: ({ text }) =>text? Number(text).toFixed(1):"",
}); });
columns.push({ columns.push({
title: item + "年第三季度L90", title: item + "年第三季度L90",
dataIndex: item + "3" + "L90", dataIndex: item + "3" + "L90",
customRender: ({ text }) =>text? Number(text).toFixed(1):"",
}); });
columns.push({ columns.push({
title: item + "年第四季度L90", title: item + "年第四季度L90",
dataIndex: item + "4" + "L90", dataIndex: item + "4" + "L90",
customRender: ({ text }) =>text? Number(text).toFixed(1):"",
}); });
columns.push({ columns.push({
title: item + "年第一季度Lmin", title: item + "年第一季度Lmin",
dataIndex: item + "1" + "Lmin", dataIndex: item + "1" + "Lmin",
customRender: ({ text }) =>text? Number(text).toFixed(1):"",
}); });
columns.push({ columns.push({
title: item + "年第二季度Lmin", title: item + "年第二季度Lmin",
dataIndex: item + "2" + "Lmin", dataIndex: item + "2" + "Lmin",
customRender: ({ text }) =>text? Number(text).toFixed(1):"",
}); });
columns.push({ columns.push({
title: item + "年第三季度Lmin", title: item + "年第三季度Lmin",
dataIndex: item + "3" + "Lmin", dataIndex: item + "3" + "Lmin",
customRender: ({ text }) =>text? Number(text).toFixed(1):"",
}); });
columns.push({ columns.push({
title: item + "年第四季度Lmin", title: item + "年第四季度Lmin",
dataIndex: item + "4" + "Lmin", dataIndex: item + "4" + "Lmin",
customRender: ({ text }) =>text? Number(text).toFixed(1):"",
}); });
columns.push({ columns.push({
title: item + "年第一季度Lmax", title: item + "年第一季度Lmax",
dataIndex: item + "1" + "Lmax", dataIndex: item + "1" + "Lmax",
customRender: ({ text }) =>text? Number(text).toFixed(1):"",
}); });
columns.push({ columns.push({
title: item + "年第二季度Lmax", title: item + "年第二季度Lmax",
dataIndex: item + "2" + "Lmax", dataIndex: item + "2" + "Lmax",
customRender: ({ text }) =>text? Number(text).toFixed(1):"",
}); });
columns.push({ columns.push({
title: item + "年第三季度Lmax", title: item + "年第三季度Lmax",
dataIndex: item + "3" + "Lmax", dataIndex: item + "3" + "Lmax",
customRender: ({ text }) =>text? Number(text).toFixed(1):"",
}); });
columns.push({ columns.push({
title: item + "年第四季度Lmax", title: item + "年第四季度Lmax",
dataIndex: item + "4" + "Lmax", dataIndex: item + "4" + "Lmax",
customRender: ({ text }) =>text? Number(text).toFixed(1):"",
}); });
} else { } else {
if (this.where.valueType.includes("index_Leq")) { if (this.where.valueType.includes("index_Leq")) {