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