zhouwx
2025-03-14 3533b11c19b628e45f26d25bedd7c82e0aa2037a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<template>
  <div class="notice">
    <el-dialog
        v-model="dialogVisible"
        title="流转记录"
        width="500px"
        :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>
    </el-dialog>
  </div>
</template>
<script setup>
import {reactive, ref, toRefs} from 'vue'
const dialogVisible = ref(false);
const title = ref("");
 
const emit = defineEmits(["getList"]);
 
const state = reactive({
  pdfUrl: ''
})
 
 
const openDialog = async (value) => {
  state.pdfUrl =  import.meta.env.VITE_APP_BASE_API  +value.itemFile
  console.log('11',state.pdfUrl)
  dialogVisible.value = true;
}
 
const handleClose = () => {
  reset();
  dialogVisible.value = false;
  emit("getList")
}
const reset = () => {
state.pdfUrl = ''
}
 
defineExpose({
  openDialog
});
 
</script>
 
<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; /* 鼠标悬停时滑块颜色 */
  }
}
</style>