feat: export

This commit is contained in:
ulleo
2025-08-05 10:56:59 +08:00
parent 8b20110ebc
commit 86abe25e27
5 changed files with 30 additions and 22 deletions
@@ -232,8 +232,13 @@ function exportToExcel() {
chatApi
.export2Excel({ ...chartRef.value?.getExcelData(), name: chartObject.value.title })
.then((res) => {
console.log('download_path: ' + res)
//todo download
const blob = new Blob([res.data])
const link = document.createElement('a')
link.href = URL.createObjectURL(blob)
link.download = `${chartObject.value.title ?? 'Excel'}.xlsx`
document.body.appendChild(link)
link.click()
document.body.removeChild(link)
})
exportRef.value?.hide()
}