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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
<template>
<div class='h-full iframe-page'>
<div class='p-3 text-black text-center shrink-0 doc-nav-bar'>
<span @click='onBack' class='text-12 back-bt'>
<doc-icon type='doc-left2' />
</span>
<span style='min-height: .16rem;display: inline-block'>{{ pageTitle }}</span>
</div>
<iframe :src='iframeSrc' style='border: 0;width: 100%;height: calc(99% - 50px)' :key='iframeSrc' v-if='iframeSrc'
allowFullscreen>
</iframe>
<div v-else />
</div>
</template>
<script>
// import {getCateInfoByMenuId} from "@/views/statScreen/config";
export default {
props: {
src: String,
pageTitle: String
},
data() {
return {
iframeSrc: ''
}
},
/* computed: {
pageTitle() {
return this.$route.query.pageTitle || ''
}
},*/
beforeUnmount() {
this.iframeSrc = ''
},
watch: {
src: {
handler() {
debugger
this.load()
},
immediate: true
}
},
methods: {
load() {
// let menuList = this.$store.state.menu || []
// let rou = this.$route.fullPath
// let result = menuList.filter(item => item.frontActionUrl == rou)[0]
// let menuId = result.id
// let lobId = result.lobId
// if (lobId && lobId!='0'){
// getCateInfoByMenuId(menuId).then(res => {
// this.openIframe(res.data.treeCode, menuId);
// });
// }else {
this.iframeSrc = `${this.src}`
// }
},
openIframe(treeCode, menuId) {
let res = ''
res = `${this.src}${this.src?.includes('?') ? '&' : '?'}source=MB&menuId=${menuId}`
if (treeCode) {
res = `${this.src}${this.src?.includes('?') ? '&' : '?'}treeCode=${treeCode}&unitTreeCode=${treeCode}&source=MB&menuId=${menuId}`
}
this.iframeSrc = res
},
onBack() {
this.$router.back()
}
}
}
</script>
<style lang='less' scoped>
// 顶部导航栏
.doc-nav-bar {
position: relative;
border-bottom: 1px solid #3C3C435C;
font-size: 18px;
font-weight: 600;
.back-bt {
position: absolute;
left: .16rem;
top: 50%;
transform: translateY(-50%);
}
}
</style>