reidtraffic.vue
1.69 KB
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
<template>
<div class="customgroup-wrapper">
<div class="element-main behavior-main">
<iframe
:src="devLogUrl"
width="100%"
:height="iframeHeight"
frameborder="0"
name="device_log"
class="log-iframe"></iframe>
</div>
</div>
</template>
<script>
export default {
data() {
return {
devLogUrl: '',
iframeHeight: 0,
}
},
created() {
this.iframeHeight = this.computedHeight('px');
window.addEventListener('resize', () => {
this.iframeHeight = this.computedHeight('px');
})
this.devLogUrl = window._vionConfig.reidUrl;
},
mounted() {
this.devLogUrl = window._vionConfig.reidUrl;
},
methods: {
computedHeight(unit) {
let computedH = 0
, winH = $(window).height()
, scale = 0.16;
if(winH <= 720) {
scale = 0.16
} else if (winH <= 768) {
scale = 0.15
} else if (winH <= 900) {
scale = 0.14
} else if (winH <= 1080) {
scale = 0.10
}
computedH = winH - winH * scale;
computedH = unit ? computedH + unit : computedH;
return computedH;
}
}
}
</script>
<style scoped>
.customgroup-wrapper {
width: 100%;
}
.log-iframe {
margin-top: 10px;
}
>>>.element-main, .behavior-main {
margin-top: 51px !important;
}
@media (max-width: 1680px) {
.element-main, .behavior-main {
margin-top: 45px !important;
}
}
</style>