|
|
|
@ -313,17 +313,17 @@ function filePreview(file) { |
|
|
|
translateY.value = 0; |
|
|
|
translateY.value = 0; |
|
|
|
moveFlag = false; |
|
|
|
moveFlag = false; |
|
|
|
// downloadFile(file) |
|
|
|
// downloadFile(file) |
|
|
|
// if (!file?.filePath) { |
|
|
|
if (!file?.filePath) { |
|
|
|
// ElMessage?.warning?.('文件路径不存在,无法下载') |
|
|
|
ElMessage?.warning?.('文件路径不存在,无法下载') |
|
|
|
// return |
|
|
|
return |
|
|
|
// } |
|
|
|
} |
|
|
|
// const url = `${BASE_PATH}/file/stream/${file.filePath}` |
|
|
|
const url = `${BASE_PATH}/file/stream/${file.filePath}` |
|
|
|
// const type = getFileType(file.fileName) |
|
|
|
const type = getFileType(file.fileName) |
|
|
|
// // 1. PDF:新窗口打开 |
|
|
|
// 1. PDF:新窗口打开 |
|
|
|
// if (type === FileType.PDF) { |
|
|
|
if (type === FileType.PDF) { |
|
|
|
// window.open(url, '_blank') |
|
|
|
window.open(url, '_blank') |
|
|
|
// return |
|
|
|
return |
|
|
|
// } |
|
|
|
} |
|
|
|
// // 2. Word / Excel:直接下载(不打开窗口) |
|
|
|
// // 2. Word / Excel:直接下载(不打开窗口) |
|
|
|
// if ( |
|
|
|
// if ( |
|
|
|
// type === FileType.WORD || |
|
|
|
// type === FileType.WORD || |
|
|
|
|