gaoshp
2024-01-05 b5db49ce1e4c678ce4a7120928811a9621128b8e
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
<template>
  <div class="app-container">
    <div class="iframe">
      <iframe id="iframeStatusMonitor" :src="iframeUrlStatusMonitor"></iframe>
    </div>
  </div>
</template>
 
<style scoped>
  #iframeStatusMonitor{display: block; width: 100%; border: 0; overflow: hidden}
</style>
 
<script>
  export default {
    data() {
      return {
        iframeUrlStatusMonitor: ''
      }
    },
    mounted() {
      this.setReportHeight()
      this.setReport(this.$route.fullPath)
    },
    watch: {
      $route(val, from) {
        console.log(val, from)
        this.setReport(val.fullPath)
      }
    },
    methods: {
      setReportHeight() {
        var iframe = document.getElementById('iframeStatusMonitor')
        var bodyheight = document.documentElement.clientHeight
        iframe.height = bodyheight
      },
      setReport(path) {
        this.showStatusMonitor()
      },
      showStatusMonitor() {
        this.iframeUrlStatusMonitor = 'http://192.168.234.2:9528/api/mdc/status-monitor2/index.html'
      }
    }
  }
</script>