This commit is contained in:
2023-10-12 14:39:59 +08:00
parent 348714edaf
commit 9f53ea6981
3 changed files with 585 additions and 143 deletions

View File

@@ -100,9 +100,10 @@ export default {
}
this.chartData = this.list
},
exportData() {
exportData(val) {
if (this.list.length > 0) {
var wb = XLSX.utils.table_to_book(document.querySelector(".yoy-out-table"))
let fileName = val.name + "同比分析.xlsx"
var wbout = XLSX.write(wb, {
bookType: "xlsx",
bookSST: true,
@@ -111,7 +112,7 @@ export default {
try {
FileSaver.saveAs(
new Blob([wbout], { type: "application/octet-stream" }),
"同比分析.xlsx"
fileName
)
} catch (e) {
if (typeof console !== "undefined") console.log(e, wbout);