<template>
  <i-frame :src="openUrl" id="jimuview"/>
</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()
    }
  }
}
</script>

<style scoped></style>