噪声新增、修复
This commit is contained in:
@@ -14,25 +14,26 @@
|
||||
<!-- 搜索表单 -->
|
||||
<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-button @click="exportFile">导出excel</a-button>
|
||||
<!-- <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>
|
||||
@@ -54,7 +55,13 @@ const columns = [
|
||||
{title: "平均路宽(米)",dataIndex: "roadWidthAvg",},
|
||||
{title: "车流量(辆/20分钟)",dataIndex: "trafficFlow",},
|
||||
{title: "超70分贝路段长度占总路长比例(%)",dataIndex: "badProportion",},
|
||||
{title: "Leq(分贝)",dataIndex: "leq",},
|
||||
{title: "Leq(分贝)",dataIndex: "leq",customRender:({text})=>{
|
||||
if(typeof text == "number"){
|
||||
return text.toFixed(1)
|
||||
}
|
||||
return text
|
||||
}},
|
||||
{title: "噪声等级",dataIndex: "level",},
|
||||
|
||||
|
||||
];
|
||||
@@ -116,27 +123,22 @@ export default {
|
||||
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, "道路交通噪声统计表");
|
||||
const columns = this.columns.filter(item=>item.dataIndex)
|
||||
const arr = [];
|
||||
const th = columns.map((item) => item.title);
|
||||
arr.push(th);
|
||||
this.data.forEach((d) => {
|
||||
const td = columns.map((item) => {
|
||||
let val = d[item.dataIndex]
|
||||
if(typeof val == "number"){
|
||||
val = val.toFixed(1);
|
||||
}
|
||||
return val;
|
||||
});
|
||||
arr.push(td);
|
||||
});
|
||||
let sheet = XLSX.utils.aoa_to_sheet(arr);
|
||||
this.$util.exportSheet(XLSX, sheet, new Date().getTime().toString());
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user