|
|
@ -1,9 +1,11 @@ |
|
|
|
<template> |
|
|
|
<el-dialog class="preview" v-model="showDialog" style="" @close="closeView"> |
|
|
|
<el-dialog ref="dialog" :style="{height:dialogHeight+'px'}" class="preview" :append-to-body="false" fullscreen v-model="showDialog" @close="closeView"> |
|
|
|
<iframe v-if="isPDF" ref="pdfRef" width="100%" :height="frameHeight" :src="pdfUrl" frameborder="0"></iframe> |
|
|
|
<el-carousel justify="center" v-else indicator-position="outside"> |
|
|
|
<el-carousel :height="(dialogHeight-130)+'px'" justify="center" v-else indicator-position="outside"> |
|
|
|
<el-carousel-item class="carousel-item" v-for="url in imageArray" :key="url"> |
|
|
|
<el-image style="height:100%" fit="contain" :src="url" loading="lazy" /> |
|
|
|
<div style="height:100%;overflow: auto;display: flex;justify-content: center;align-items: center;"> |
|
|
|
<el-image fit="contain" :src="url" /> |
|
|
|
</div> |
|
|
|
</el-carousel-item> |
|
|
|
</el-carousel> |
|
|
|
</el-dialog> |
|
|
@ -20,6 +22,8 @@ const imageArray = ref<string[]>([]) // 图片数组 |
|
|
|
const closeView = () => { |
|
|
|
showDialog.value = false |
|
|
|
} |
|
|
|
|
|
|
|
const dialogHeight = ref(window.innerHeight) |
|
|
|
// 打开预览 |
|
|
|
const openPreview = async (data:string[]|string)=>{ |
|
|
|
showDialog.value = true |
|
|
|