导出
This commit is contained in:
14054
package-lock.json
generated
Normal file
14054
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -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"],
|
||||
];
|
||||
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);
|
||||
const arr = [];
|
||||
const th = this.columns.map(item=>item.title);
|
||||
|
||||
this.$util.exportSheet(XLSX, sheet, new Date().getTime());
|
||||
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());
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user