处理预览拦截
This commit is contained in:
parent
3da79a6056
commit
2be4b9e2a3
|
|
@ -43,7 +43,7 @@
|
||||||
<!-- 图片预览 -->
|
<!-- 图片预览 -->
|
||||||
<el-dialog v-model="dialogVisible" width="1090px" class="my_dialog" align-center title="附件预览">
|
<el-dialog v-model="dialogVisible" width="1090px" class="my_dialog" align-center title="附件预览">
|
||||||
<img v-if="isImageFile(suffix)" :src="dialogImageUrl" class="preview-image" alt="Preview Image" />
|
<img v-if="isImageFile(suffix)" :src="dialogImageUrl" class="preview-image" alt="Preview Image" />
|
||||||
<div v-else class="unsupported-file">
|
<div v-else-if="suffix == 'pdf'" class="unsupported-file">
|
||||||
<pdf-preview :pdf-url="dialogImageUrl" />
|
<pdf-preview :pdf-url="dialogImageUrl" />
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
@ -103,9 +103,13 @@ const isImageFile = (suffix) => {
|
||||||
|
|
||||||
// 图片预览
|
// 图片预览
|
||||||
const handleCardPreview = (filePath, _suffix) => {
|
const handleCardPreview = (filePath, _suffix) => {
|
||||||
suffix.value = _suffix
|
if (isImageFile(_suffix) || _suffix == 'pdf') {
|
||||||
dialogImageUrl.value = filePath
|
suffix.value = _suffix
|
||||||
dialogVisible.value = true
|
dialogImageUrl.value = filePath
|
||||||
|
dialogVisible.value = true
|
||||||
|
} else {
|
||||||
|
proxy.$modal.msgWarning('该类型文件不支持预览!!!')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除图片
|
// 删除图片
|
||||||
|
|
|
||||||
|
|
@ -66,15 +66,19 @@ const setFileInfo = (files) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
// 判断是否为图片文件
|
// 判断是否为图片文件
|
||||||
const isImageFile = (suffix) => {
|
const isImageFile = (suffix) => {
|
||||||
return ['jpeg', 'jpg', 'png'].includes(suffix.toLowerCase())
|
return ['jpeg', 'jpg', 'png'].includes(suffix.toLowerCase())
|
||||||
}
|
}
|
||||||
|
|
||||||
// 图片预览
|
// 图片预览
|
||||||
const handleCardPreview = (filePath, _suffix) => {
|
const handleCardPreview = (filePath, _suffix) => {
|
||||||
suffix.value = _suffix
|
if (isImageFile(_suffix) || _suffix == 'pdf') {
|
||||||
dialogImageUrl.value = filePath
|
suffix.value = _suffix
|
||||||
dialogVisible.value = true
|
dialogImageUrl.value = filePath
|
||||||
|
dialogVisible.value = true
|
||||||
|
} else {
|
||||||
|
proxy.$modal.msgWarning('该类型文件不支持预览!!!')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user