提交 c552d274 authored 作者: 刘旭's avatar 刘旭

优化

上级 7fb823c8
......@@ -194,20 +194,19 @@ const handleDelete = (id: number) => {
// 导出
const handleExport = (data: any) => {
licInfoFileCreate(data.macAddress, data.effectiveTime, data.verificationInterval).then((res: any) => {
ElMessageBox.confirm("确认导出文件?", "导出", {
confirmButtonText: "确认",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
ElMessageBox.confirm("确认导出文件?", "导出", {
confirmButtonText: "确认",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
licInfoFileCreate(data.macAddress, data.effectiveTime, data.verificationInterval).then((res: any) => {
const content = res;
const blob = new Blob([content])
const downloadElement = document.createElement('a')
// 创建下载的链接
const href = window.URL.createObjectURL(blob)
downloadElement.href = href
console.log("href", href)
// 下载后文件名
downloadElement.download = "lic.tmp";
document.body.appendChild(downloadElement)
......@@ -217,14 +216,14 @@ const handleExport = (data: any) => {
document.body.removeChild(downloadElement)
// 释放掉blob对象
window.URL.revokeObjectURL(href)
})
.catch(() => {
ElMessage({
type: "info",
message: "取消导出!",
});
});
})
})
.catch(() => {
ElMessage({
type: "info",
message: "取消导出!",
});
})
}
const handleClose = () => {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论