自定义阅片附件下载

uat_us
caiyiling 2024-04-26 17:39:10 +08:00
parent 8a6a7962ae
commit cc0b201036
4 changed files with 33 additions and 8 deletions

View File

@ -794,8 +794,14 @@ export default {
}, },
// //
handlePictureCardPreview(file) { handlePictureCardPreview(file) {
this.imageUrl = this.OSSclientConfig.basePath + file.url var suffix = file.url.substring(file.url.lastIndexOf(".")+1)
this.imgVisible = true suffix = suffix ? suffix.toLowerCase() : ''
if (suffix === 'doc' || suffix === 'docx' || suffix === 'pdf'){
window.open(this.OSSclientConfig.basePath + file.url,'_blank')
}else{
this.imageUrl = this.OSSclientConfig.basePath + file.url
this.imgVisible = true
}
}, },
// //
handleRemove(file, fileList) { handleRemove(file, fileList) {

View File

@ -302,8 +302,14 @@ export default {
}, },
// //
handlePictureCardPreview(file) { handlePictureCardPreview(file) {
this.imageUrl = this.OSSclientConfig.basePath + file.url var suffix = file.url.substring(file.url.lastIndexOf(".")+1)
this.imgVisible = true suffix = suffix ? suffix.toLowerCase() : ''
if (suffix === 'doc' || suffix === 'docx' || suffix === 'pdf'){
window.open(this.OSSclientConfig.basePath + file.url,'_blank')
}else{
this.imageUrl = this.OSSclientConfig.basePath + file.url
this.imgVisible = true
}
}, },
// //
handleRemove(file, fileList) { handleRemove(file, fileList) {

View File

@ -486,8 +486,15 @@ export default {
}, },
// //
handlePictureCardPreview(file) { handlePictureCardPreview(file) {
this.imageUrl = this.OSSclientConfig.basePath + file.url var suffix = file.url.substring(file.url.lastIndexOf(".")+1)
this.imgVisible = true suffix = suffix ? suffix.toLowerCase() : ''
if (suffix === 'doc' || suffix === 'docx' || suffix === 'pdf'){
window.open(this.OSSclientConfig.basePath + file.url,'_blank')
}else{
this.imageUrl = this.OSSclientConfig.basePath + file.url
this.imgVisible = true
}
}, },
// //
handleRemove(file, fileList) { handleRemove(file, fileList) {

View File

@ -136,8 +136,14 @@ name: "CustomizeReportPageUpload",
}, },
// //
handlePictureCardPreview(file) { handlePictureCardPreview(file) {
this.imageUrl = this.OSSclientConfig.basePath + file.url var suffix = file.url.substring(file.url.lastIndexOf(".")+1)
this.imgVisible = true suffix = suffix ? suffix.toLowerCase() : ''
if (suffix === 'doc' || suffix === 'docx' || suffix === 'pdf'){
window.open(this.OSSclientConfig.basePath + file.url,'_blank')
}else{
this.imageUrl = this.OSSclientConfig.basePath + file.url
this.imgVisible = true
}
}, },
// //
handleRemove(file, fileList) { handleRemove(file, fileList) {