This commit is contained in:
bb_pan 2025-12-29 09:32:18 +08:00
parent 5ef89d5c85
commit 987388f71b
3 changed files with 16 additions and 5 deletions

BIN
src/assets/images/pdf.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

View File

@ -158,6 +158,13 @@
<!-- 文件格式下载图片格式预览 -->
<div slot="file" slot-scope="{ file }">
<img
v-if="isPdf(file)"
class="el-upload-list__item-thumbnail"
src="@/assets/images/pdf.png"
alt=""
/>
<img
v-else
class="el-upload-list__item-thumbnail"
:src="file.url"
alt=""
@ -587,6 +594,11 @@ export default {
}
},
methods: {
isPdf(file) {
const url = file.response ? file.response.data.url : file.url.replaceAll('#', '%23')
if (!url) return false
return url.toLowerCase().includes('.pdf')
},
//
handleQuery() {
//
@ -1278,6 +1290,10 @@ export default {
console.log("xxxxxxxxxxxx",file)
this.dialogImageUrl =file.response ? file.response.data.url : file.url.replaceAll('#', '%23')
console.log("zzzzzzzzzz",this.dialogImageUrl)
if (this.isPdf(file)) {
window.open(this.dialogImageUrl, '_blank')
return
}
// const parts = file.name ? file.name:file.url.split('.')
// console.log("yyyyyyyyy",parts)
// const extension = parts?.pop()

View File

@ -45,11 +45,6 @@
<span>{{ (queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1 }}</span>
</template>
</el-table-column>
<el-table-column label="标准箱类型" align="center" prop="boxType" show-overflow-tooltip>
<template slot-scope="scope">
<dict-tag :options="dict.type.qr_box_type" :value="scope.row.boxType" />
</template>
</el-table-column>
<el-table-column label="标准箱名称" align="center" prop="boxName" show-overflow-tooltip />
<el-table-column label="标准箱编码" align="center" prop="boxCode" show-overflow-tooltip />
<el-table-column label="标准箱机具数" align="center" prop="devNum" show-overflow-tooltip />