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
<template>
<div class="h-full iframe-page">
<iframe :src="iframeSrc" style="border: 0;width: 100%;height: 99%" :key="iframeSrc" v-if="iframeSrc" allowFullscreen>
</iframe>
<div v-else/>
</div>
</template>
<script>
// import {getCateInfoByMenuId} from "@/views/statScreen/config";
export default {
props: {
src: String
},
data() {
return {
iframeSrc: ''
}
},
// computed:{
// stat(){
// return this.$route.params.stat
// }
// },
beforeUnmount() {
this.iframeSrc = ''
},
watch: {
src: {
handler() {
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 {
debugger
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
}
}
}
</script>
<style lang="less" scoped>
</style>