更新
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { ref } from "vue";
|
||||
import { message } from "@/utils/message";
|
||||
import axios from 'axios';
|
||||
import {
|
||||
queryAndroidList,
|
||||
DeteleAndroidLog
|
||||
@@ -74,21 +75,17 @@ export function useData() {
|
||||
}
|
||||
}
|
||||
const downloadData = (rowData) => {
|
||||
console.log(rowData)
|
||||
// 创建Blob对象的临时URL
|
||||
const blobUrl = window.URL.createObjectURL(new Blob([rowData.log_url]));
|
||||
|
||||
// 创建a标签并触发下载
|
||||
downloadZip(rowData.log_url, rowData.log_name)
|
||||
}
|
||||
const downloadZip = (fileUrl, fileName) => {
|
||||
// 创建一个隐藏的a标签
|
||||
const link = document.createElement('a');
|
||||
link.href = blobUrl;
|
||||
link.setAttribute('download', rowData.log_name); // 设置下载的文件名
|
||||
link.href = fileUrl;
|
||||
link.download = fileName; // 设置下载的文件名
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
|
||||
// 清理和释放URL对象
|
||||
link.remove();
|
||||
window.URL.revokeObjectURL(blobUrl);
|
||||
}
|
||||
document.body.removeChild(link);
|
||||
};
|
||||
return {
|
||||
onSearch,
|
||||
isShow,
|
||||
|
||||
Reference in New Issue
Block a user