<template>
  <div>
    <a-card :bordered="false">
      <!-- <iframe :src="url" :class="$style.iframe"></iframe> -->
    </a-card>
  </div>
</template>

<script>
import axios from '@/common/services/axios-instance'
import components from './_import-components/iam-dm-finereport-link-import'

export default {
  name: 'IamDmFinereportLink',
  metaInfo: {
    title: 'IamDmFinereportLink',
  },
  components,
  data() {
    return {
      url: '',
    }
  },
  mounted() {
    this.getUrl()
  },
  methods: {
    getUrl() {
      const reportCode = this.$route.query.reportCode
      axios({
        url: `api/xcoa-mobile/v1/iamFineReport/fineReportUrl?reportCode=` + reportCode,
        method: 'get',
      }).then((res) => {
        if (res.data) {
          this.url = res.data.fineReportURL
          window.location.href = res.data.fineReportURL // 改为新窗口打开之后，直接本窗口跳转，防止系统内打开多余页签
        }
      })
    },
  },
}
</script>

<style module lang="scss">
@use '@/common/design' as *;
.iframe {
  width: 100%;
  height: 99%;
  border: none;
}
</style>
