This commit is contained in:
tdg930622 2024-12-25 18:01:09 +08:00
parent d33240b322
commit 42d9bdda88
2 changed files with 50 additions and 22 deletions

View File

@ -94,8 +94,8 @@ export default {
})
},
async handlePreview(item) {
let previewUrl = `/mediate/minio/preview/${item.url}`
if(item.url.includes('http')){previewUrl = item.url}
let previewUrl = `/mediate/minio/preview/${item.fullUrl}`
if(item.fullUrl.includes('http')){previewUrl = item.fullUrl}
let analysisType = this.$util.getFileType(item.url);
if (analysisType === 'image'){
this.previewPath = previewUrl
@ -126,13 +126,16 @@ export default {
}).catch(() => {});
},
handleDownload(item) {
fetchApi.downFile({
path: item.url,
fileName: item.name
}).then(res => {
console.log(res)
this.$util.downloadFileByBlob(res, item.name)
})
let url = item.fullUrl + `&response-content-disposition=attachment;filename="${item.name}"`
console.log(url, '---url')
this.$util.downloadFileByUrl(url, item.name)
// fetchApi.downFile({
// path: item.url,
// fileName: item.name
// }).then(res => {
// console.log(res)
// this.$util.downloadFileByBlob(res, item.name)
// })
}
}
}

View File

@ -9,8 +9,8 @@
<div class="case-detail-des flex-column mb-16" v-for="(item, index) in tableData" :key="index">
<div class="background-color-F5F5F5 p-16 flex-row border-radius-8">
<a class="case-img"><img :src="reg_img(item.url)"/></a>
<div class="flex-column">
<a class="case-img"><img :src="reg_img(item.fullUrl)"/></a>
<div class="flex-column pl-8">
<a class="mt-8 f-weight500">{{item.materialType}}</a>
<a class="color-86909C">{{item.createBy + ' ' + item.createAt}}</a>
</div>
@ -90,9 +90,9 @@ export default {
return require('@/assets/image/util/yswj.jpg')
}
else {
let previewUrl = `/mediate/minio/preview/${fileUrl}`
// let previewUrl = `/mediate/minio/preview/${fileUrl}`
// return service.service.serviceurl+fileUrl
return previewUrl
return fileUrl
}
},
//
@ -110,8 +110,8 @@ export default {
})
},
async handlePreview(item) {
let previewUrl = `/mediate/minio/preview/${item.url}`
if(item.url.includes('http')){previewUrl = item.url}
let previewUrl = `/mediate/minio/preview/${item.fullUrl}`
if(item.fullUrl.includes('http')){previewUrl = item.fullUrl}
let analysisType = this.$util.getFileType(item.url);
if (analysisType === 'image'){
this.previewPath = previewUrl
@ -155,14 +155,39 @@ export default {
</script>
<style scoped lang="scss">
.width120px {
width: 140px;
.background-color-F5F5F5 {
background-color: #F5F5F5;
}
.case-materials-person {
.case-detail-des {
border: solid 1px #E5E6EB;
padding: 10px 15px;
border-radius: 8px;
font-size: 14px;
.width180px {
width: 220px;
}
.width200px {
width: calc(50% - 320px);
span {
margin: 3px 0;
padding: 3px 10px;
// a:first-child{width: 120px;display: inline-block;text-align: right;}
}
span:nth-child(even) {
background-color: #F7F8FA;
}
.case-img {
width: 50px;
height: 50px;
text-align: center;
line-height: 50px;
img {
max-width: 50px;
max-height: 50px;
}
}
i {
margin-right: 4px;
}
}
}
</style>