提交 4b423865 authored 作者: lidongxu's avatar lidongxu

Merge branch 'zhijian_app' into dev

......@@ -38,6 +38,19 @@
</van-cell-group>
</van-list>
</van-pull-refresh>
<!-- 移动端特殊,覆盖一个 iframe 在当前页顶层显示 pdf -->
<div class="iframe-wrap"
v-if="showPdfIframe">
<iframe :src="pdfUrl"
width="100%"
height="100%"
frameborder="0"
allow="fullscreen" />
<!-- 覆盖一层 div,透明的,用于接收点击交互关闭 -->
<div class="click-cover"
@click="closeIframe"></div>
</div>
</div>
</template>
......@@ -86,6 +99,8 @@ const getPlanListFn = async () => {
getPlanListFn()
/*************** 附件类型/预览 ***************/
const showPdfIframe = ref(false)
const pdfUrl = ref('')
// 判断文件类型
const isImageFile = (url) => {
if (!url) return false
......@@ -124,12 +139,19 @@ const handleReportClick = (url) => {
const originDomain = import.meta.env.VITE_APP_OSS_ORIGIN_DOMAIN
const customDomain = import.meta.env.VITE_APP_OSS_CUSTOM_DOMAIN
url = url.replace(originDomain, customDomain)
window.open(url, '_blank')
pdfUrl.value = url
showPdfIframe.value = true
} else {
// 其他文件类型:默认打开新链接
window.open(url, '_blank')
}
}
// 关闭 iframe
const closeIframe = () => {
showPdfIframe.value = false
}
</script>
<style scoped
......@@ -155,7 +177,25 @@ const handleReportClick = (url) => {
}
}
/* ::v-deep(.zebra-row) {
background-color: #f9f9f9;
} */
/* iframe 样式 */
.iframe-wrap {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.8);
z-index: 9998;
display: flex;
align-items: center;
justify-content: center;
}
.click-cover{
position: absolute;
top: 56px;
left: 0;
width: 100%;
height: 100%;
z-index: 9999;
}
</style>
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论