【添加】JUpload组件提供下载功能

This commit is contained in:
zer0Black
2022-04-23 17:10:15 +08:00
parent 79e738d704
commit 65964f0572
+14
View File
@@ -13,6 +13,10 @@
:returnUrl="returnUrl" :returnUrl="returnUrl"
:listType="complistType" :listType="complistType"
@preview="handlePreview" @preview="handlePreview"
@download="handleDownload"
:showUploadList="{
showDownloadIcon: isDownload
}"
v-bind="$attrs" v-bind="$attrs"
v-on="childListeners" v-on="childListeners"
:class="{'uploadty-disabled':disabled}"> :class="{'uploadty-disabled':disabled}">
@@ -114,6 +118,10 @@
beforeUpload: { beforeUpload: {
type: Function type: Function
}, },
isDownload: {
type: Boolean,
default: true
}
}, },
watch:{ watch:{
value:{ value:{
@@ -283,6 +291,12 @@
window.open(url) window.open(url)
} }
}, },
handleDownload(file) {
if (file && file.url) {
var fileFullUrl = `${window._CONFIG['domianWebSocketURL']}/sys/common/download/${file.response.result.id}?token=${Vue.ls.get(ACCESS_TOKEN)}&fullfilename=${file.name}`
window.open(fileFullUrl)
}
}
}, },
mounted(){}, mounted(){},
model: { model: {