|
|
|
|
@ -205,18 +205,18 @@
|
|
|
|
|
<icon name="el-icon-Close" :size="28" /> |
|
|
|
|
</button> |
|
|
|
|
<div class="btn-content"> |
|
|
|
|
<el-button @click="download" type="primary" plain> |
|
|
|
|
<template #icon> |
|
|
|
|
<icon name="el-icon-Download" :size="20" /> |
|
|
|
|
</template> |
|
|
|
|
下载文件 |
|
|
|
|
</el-button> |
|
|
|
|
<el-button v-print="'#printTable'" type="primary" plain> |
|
|
|
|
<template #icon> |
|
|
|
|
<icon name="el-icon-Download" :size="20" /> |
|
|
|
|
</template> |
|
|
|
|
打印文件 |
|
|
|
|
</el-button> |
|
|
|
|
<!-- <el-button @click="download" type="primary" plain>--> |
|
|
|
|
<!-- <template #icon>--> |
|
|
|
|
<!-- <icon name="el-icon-Download" :size="20" />--> |
|
|
|
|
<!-- </template>--> |
|
|
|
|
<!-- 下载文件--> |
|
|
|
|
<!-- </el-button>--> |
|
|
|
|
<!-- <el-button v-print="'#printTable'" type="primary" plain>--> |
|
|
|
|
<!-- <template #icon>--> |
|
|
|
|
<!-- <icon name="el-icon-Download" :size="20" />--> |
|
|
|
|
<!-- </template>--> |
|
|
|
|
<!-- 打印文件--> |
|
|
|
|
<!-- </el-button>--> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
</div> |
|
|
|
|
@ -265,6 +265,7 @@ function filePreview(file) {
|
|
|
|
|
translateX.value = 0; |
|
|
|
|
translateY.value = 0; |
|
|
|
|
moveFlag = false; |
|
|
|
|
downloadFile(file) |
|
|
|
|
// if (!file?.filePath) { |
|
|
|
|
// ElMessage?.warning?.('文件路径不存在,无法下载') |
|
|
|
|
// return |
|
|
|
|
@ -309,6 +310,15 @@ function filePreview(file) {
|
|
|
|
|
// moveFlag = false; |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
function downloadFile(file) { |
|
|
|
|
const a = document.createElement('a') |
|
|
|
|
a.href = `${BASE_PATH}/file/stream/${file.filePath}` |
|
|
|
|
a.download = file.fileName || '' |
|
|
|
|
a.style.display = 'none' |
|
|
|
|
document.body.appendChild(a) |
|
|
|
|
a.click() |
|
|
|
|
document.body.removeChild(a) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function remove(index) { |
|
|
|
|
const files = [...props.files]; |
|
|
|
|
|