
<template>
    <i-frame :src="openUrl"/>
  </template>
  
  <script>
  import {getToken} from '@/utils/auth'
  import iFrame from "@/components/iFrame/index";
  
  export default {
    name: 'jimuview',
    components: {iFrame},
    props: {
      reportID: {
        type: [String],
        required: false,
        default: ''
      },
    },
    data() {
      return {
        serverUrl: 'http://192.168.100.39:8080',
        openUrl: '',
      }
    },
    created() {
      if (this.reportID.length != 0) {
        this.openUrl = this.serverUrl + '/report/jmreport/view/' + this.reportID + '?token=' +  getToken()
      } else {
        this.openUrl = this.serverUrl + '/report/jmreport/view/' + this.$route.path.substring(this.$route.path.lastIndexOf("/") + 1) + '?token=' + getToken()
      }
      console.log(this.openUrl)
    }
  }
  </script>
  
  <style scoped>
  
  </style>