From ef9f19192df89a5ec2dea8425d0fac0fd7eff6e6 Mon Sep 17 00:00:00 2001
From: zhouwx <1175765986@qq.com>
Date: Mon, 17 Mar 2025 16:25:50 +0800
Subject: [PATCH] 接口对接
---
src/views/signProject/components/viewPdf.vue | 38 +++++++++++++++++---------------------
1 files changed, 17 insertions(+), 21 deletions(-)
diff --git a/src/views/signProject/components/viewPdf.vue b/src/views/signProject/components/viewPdf.vue
index 84ae76d..eacc044 100644
--- a/src/views/signProject/components/viewPdf.vue
+++ b/src/views/signProject/components/viewPdf.vue
@@ -2,13 +2,20 @@
<div class="notice">
<el-dialog
v-model="dialogVisible"
- title="流转记录"
- width="500px"
+ width="50%"
+ title="文件预览"
:before-close="handleClose"
:close-on-press-escape="false"
:close-on-click-modal="false"
>
- <iframe :src="state.pdfUrl" width="100%" height="600px" sandbox="allow-scripts"></iframe>
+ <div style="width: 100%;height: auto;">
+ <iframe
+ :src="state.iframeSrc"
+ width="100%"
+ height="750px"
+ class="custom-iframe"
+ ></iframe>
+ </div>
</el-dialog>
</div>
</template>
@@ -20,13 +27,12 @@
const emit = defineEmits(["getList"]);
const state = reactive({
- pdfUrl: ''
+ iframeSrc: ''
})
const openDialog = async (value) => {
- state.pdfUrl = import.meta.env.VITE_APP_BASE_API +value.itemFile
- console.log('11',state.pdfUrl)
+ state.iframeSrc = import.meta.env.VITE_APP_BASE_API + value.itemFile
dialogVisible.value = true;
}
@@ -36,7 +42,7 @@
emit("getList")
}
const reset = () => {
-state.pdfUrl = ''
+state.iframeSrc = ''
}
defineExpose({
@@ -47,20 +53,10 @@
<style scoped lang="scss">
.notice{
- /* 针对 iframe 的滚动条 */
- iframe::-webkit-scrollbar {
- width: 12px; /* 滚动条宽度 */
- }
- iframe::-webkit-scrollbar-track {
- background: #f1f1f1; /* 滚动条轨道背景 */
- border-radius: 10px;
- }
- iframe::-webkit-scrollbar-thumb {
- background: #888; /* 滚动条滑块颜色 */
- border-radius: 10px;
- }
- iframe::-webkit-scrollbar-thumb:hover {
- background: #555; /* 鼠标悬停时滑块颜色 */
+ .custom-iframe {
+ border: 1px solid #9b9999;
+ /* 隐藏原生滚动条 */
+ overflow: hidden;
}
}
</style>
--
Gitblit v1.9.2