处理预览拦截
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="附件预览">
|
||||
<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" />
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
@ -103,9 +103,13 @@ const isImageFile = (suffix) => {
|
|||
|
||||
// 图片预览
|
||||
const handleCardPreview = (filePath, _suffix) => {
|
||||
suffix.value = _suffix
|
||||
dialogImageUrl.value = filePath
|
||||
dialogVisible.value = true
|
||||
if (isImageFile(_suffix) || _suffix == 'pdf') {
|
||||
suffix.value = _suffix
|
||||
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())
|
||||
}
|
||||
|
||||
// 图片预览
|
||||
const handleCardPreview = (filePath, _suffix) => {
|
||||
suffix.value = _suffix
|
||||
dialogImageUrl.value = filePath
|
||||
dialogVisible.value = true
|
||||
if (isImageFile(_suffix) || _suffix == 'pdf') {
|
||||
suffix.value = _suffix
|
||||
dialogImageUrl.value = filePath
|
||||
dialogVisible.value = true
|
||||
} else {
|
||||
proxy.$modal.msgWarning('该类型文件不支持预览!!!')
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user