|
@@ -245,11 +245,25 @@ const handleCommand = (command: string | number | object, item) => {
|
|
handleDel(item)
|
|
handleDel(item)
|
|
break;
|
|
break;
|
|
default:
|
|
default:
|
|
- window.open(item.filesUrl)
|
|
|
|
|
|
+ // window.open(item.filesUrl)
|
|
|
|
+ downloadFile(item.filesUrl, item.fileName+'.'+item.fileFormat)
|
|
console.log("other", command);
|
|
console.log("other", command);
|
|
}
|
|
}
|
|
// ElMessage(`click on item ${command}`)
|
|
// ElMessage(`click on item ${command}`)
|
|
}
|
|
}
|
|
|
|
+// 下载文件
|
|
|
|
+function downloadFile(sourceUrl, fileName,) {
|
|
|
|
+ const link = document.createElement('a');
|
|
|
|
+ link.style.display = 'none';
|
|
|
|
+ // 设置下载地址
|
|
|
|
+ link.setAttribute('href', sourceUrl);
|
|
|
|
+ // 设置文件名
|
|
|
|
+ link.setAttribute('download', fileName);
|
|
|
|
+ document.body.appendChild(link);
|
|
|
|
+ link.click();
|
|
|
|
+ document.body.removeChild(link);
|
|
|
|
+}
|
|
|
|
+
|
|
function handleClose(e) {
|
|
function handleClose(e) {
|
|
console.log("handleClose", e);
|
|
console.log("handleClose", e);
|
|
}
|
|
}
|