功能区县级导入

This commit is contained in:
weicw
2021-08-24 16:55:51 +08:00
parent b797562ab4
commit 2d8e8ae7ee
6 changed files with 119 additions and 43 deletions

View File

@@ -159,9 +159,9 @@ export default {
const reportDate = aoa[1][0].replace(/[^\d]+/g, "-");
const functionNoiseList = aoa.filter((item) => {
return item.length >= 35 && item[0] != "行政区划代码";
return item.length >= 28 && typeof item[0] != "string";
});
// 解析成对象数组
const billName = aoa[0][0];
const billData = utils.toAreaObjData(functionNoiseList);

View File

@@ -7,6 +7,13 @@
<!-- 搜索表单 -->
<a-form layout="inline" :model="where" :labelCol="{ offset: 1}">
<a-form-item label="区域等级:">
<a-select v-model:value="where.regionLevel" allowClear placeholder="未选择">
<a-select-option :value="'市级'">市级</a-select-option>
<a-select-option :value="'县级'">县级</a-select-option>
</a-select>
</a-form-item>
<a-form-item label="审核状态:">
<a-select v-model:value="where.checked" allowClear placeholder="未选择">
<a-select-option :value="1">已审核</a-select-option>

View File

@@ -202,6 +202,16 @@
allow-clear
/>
</a-form-item>
</a-col>
<a-col :md="12" :sm="24">
<a-form-item label="测点高度" name="placeHeight">
<a-input
type="number"
v-model:value="form.placeHeight"
placeholder="请输入测点高度"
allow-clear
/>
</a-form-item>
</a-col>
<a-col :md="12" :sm="24">
<a-form-item label="测点参照物" name="refObj">
@@ -222,6 +232,15 @@
/>
</a-form-item>
</a-col>
<a-col :md="12" :sm="24">
<a-form-item label="监测站名" name="station">
<a-input
v-model:value="form.station"
placeholder="请输入监测站名"
allow-clear
/>
</a-form-item>
</a-col>
<a-col :md="12" :sm="24">
<a-form-item label="监测仪器型号" name="monitorInstrumentModel">
<a-input
@@ -329,47 +348,10 @@
</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>
<a-tag v-if="record.functionType == 0 && record.timeSlot == '昼' && text <=50" color="green">{{ text }}</a-tag>
<a-tag v-else-if="record.functionType == 0 && record.timeSlot == '昼' && text >50" color="red">{{ text }}</a-tag>
<a-tag v-if="record.functionType == 0 && record.timeSlot == '昼' && text <=50" color="green">{{ text }}</a-tag>
<a-tag v-else-if="record.functionType == 0 && record.timeSlot == '' && text >50" color="red">{{ text }}</a-tag>
</template>
<template #action="{ record }">
@@ -518,6 +500,11 @@ export default {
dataIndex: "placeLat",
sorter: true,
},
{
title: "测点高度",
dataIndex: "placeHeight",
sorter: true,
},
{
title: "测点参照物",
dataIndex: "refObj",
@@ -527,6 +514,11 @@ export default {
title: "功能区代码",
dataIndex: "functionCode",
sorter: true,
},
{
title: "监测站名",
dataIndex: "station",
sorter: true,
},
{
title: "监测仪器型号",

View File

@@ -20,6 +20,7 @@ export default {
}
const row = {
regionCode: "450100",
monitorYear: item[0],
place: item[1],
placeCode: item[2],
@@ -36,6 +37,8 @@ export default {
indexL90: item[12],
indexLmax: item[13],
indexLmin: item[14],
regionLevel: "市级",
city: '南宁',
quarter
}
@@ -71,5 +74,72 @@ export default {
}
})
},
// 解析县级数据
toAreaObjData(excelData) {
return excelData.map(item => {
const monitorTime = new Date();
monitorTime.setFullYear(item[1]);
monitorTime.setMonth(item[14] - 1);
monitorTime.setDate(item[15]);
monitorTime.setHours(item[16]);
monitorTime.setMinutes(item[17]);
let quarter = 1;
const month = item[14]
if (month < 4) {
quarter = 1
} else if (month < 7) {
quarter = 2
} else if (month < 10) {
quarter = 3
} else {
quarter = 4
}
let timeSlot = "夜";
if (item[16] >= 6 && item[16] <= 22) {
timeSlot = "昼"
}
const row = {
regionCode: item[0],
regionLevel: "县级",
monitorYear: item[1],
placeCode: item[2],
place: item[3],
placeLng: item[4],
placeLat: item[5],
placeHeight: item[6],
refObj: item[7],
functionCode: item[8],
monitorMonth: item[9],
monitorDay: item[10],
monitorHour: item[11],
monitorMinute: item[12],
indexLeq: item[13],
indexL10: item[14],
indexL50: item[15],
indexL90: item[16],
indexLmax: item[17],
indexLmin: item[18],
indexSd: item[19],
station: item[20],
monitorInstrumentModel: item[21],
monitorInstrumentCode: item[22],
beforeMonitorValue: item[23],
afterMonitorValue: item[24],
soundPressureValue: item[25],
soundInstrumentModel: item[26],
soundInstrumentCode: item[27],
remark: item[28],
city: '南宁',
timeSlot,
monitorTime: monitorTime.getTime(),
quarter
}
if(row.indexL10 < row.indexL50 || row.indexL50 < row.indexL90){
throw new Error(row.place + "数值有误")
}
return row;
})
}
}