This commit is contained in:
weicw
2021-08-18 17:54:49 +08:00
parent 6c5aeb1e3e
commit e2cc8520f7
2 changed files with 14063 additions and 15 deletions

View File

@@ -11,6 +11,7 @@
:initLoad="false"
:scroll="{ x: 'max-content' }"
:method="'POST'"
@done="d=>data = d.data"
>
<template #toolbar>
<!-- 搜索表单 -->
@@ -335,23 +336,16 @@ export default {
this.columns = columns;
},
exportFile() {
let array = [
["测点", "路段", "城区", "路长", "路宽", "平均Leq", "平均SD"],
];
const arr = [];
const th = this.columns.map(item=>item.title);
arr.push(th)
this.data.forEach((d) => {
array.push([
d.place,
d.road,
d.area,
d.roadLength,
d.roadWidth,
d.avgLeq,
d.avgSD,
]);
const td = this.columns.map(item=>d[item.dataIndex]);
arr.push(td);
});
let sheet = XLSX.utils.aoa_to_sheet(array);
this.$util.exportSheet(XLSX, sheet, new Date().getTime());
let sheet = XLSX.utils.aoa_to_sheet(arr);
this.$util.exportSheet(XLSX, sheet, new Date().getTime().toString());
},
},
};